TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Subject:
From:
Matthew Heaney <[log in to unmask]>
Date:
Fri, 22 Jan 1999 23:44:11 -0800
In-Reply-To:
Daniel Wengelin's message of "Sat, 16 Jan 1999 16:45:06 +0100"
X-To:
Reply-To:
Matthew Heaney <[log in to unmask]>
Parts/Attachments:
text/plain (52 lines)
Daniel Wengelin <[log in to unmask]> writes:

> I have downloaded Emacs 20.2.1 and emacs-ada-mode 2.23.
>
> I am having problems with the Xref function. When I try to Goto Declaration of
> something, I often get the message "file C doesn't exist". It appears as if it
> only runs into trouble when the file the declaration is in has been prefixed
> with a full path by gnatf. I even get the feeling that the C in the above statement
> is the disk, as in C: (I edited the .xrb file and found that I could set it to W or anything)
>
> It appears as if the failing function is ada-xref-get-filename in the ada-xref.el lisp file.
> M. Laurent Guerby has inserted a cryptic comment in the code where the bug
> should be, but I fail to interpret it and with my total lack of LISP knowledge
> I cannot get any further.

This is what I have in my version of ada-xref.el:


(defun ada-xref-get-filename ()
  "Returns the name of the file where the declaration should be.
Assumes point to be on the name of the identifier in the Xref file."
  (save-excursion
    (re-search-backward "^\\(%%\\|--\\) \\([a-zA-Z0-9\\._/\\-]+\\)"
                        nil t)
;;    Laurent Guerby                                      ^^^
;    (file-name-nondirectory
     (buffer-substring (match-beginning 2)
                       (match-end 2))))


We can dissect the regexp as follows:

 "^"  means beginning of line


 "\\(%%\\|--\\) "
  means double percent or double-hyphen, followed by a space


  "\\([a-zA-Z0-9\\._/\\-]+\\)"
  means one or more letters, numbers, periods, underscores, forward
  slashes, or hyphens (this is the syntax of a Unix path-name, including
  dir and file)

The (match-beginning 2) and (match-end 2) simply mean the range of text
in the second set of parens of the regexp; here, the name of the
directory-filename.

Can you post the code that's failing?  I will try to help you.

Matt

ATOM RSS1 RSS2