]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ada-xref.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / progmodes / ada-xref.el
index c37d11910d46c3a3404f43f18f6dd40492dc4343..cea783e60bbd82424fc407752649ffb2bac8913b 100644 (file)
@@ -1,7 +1,7 @@
 ;; ada-xref.el --- for lookup and completion in Ada mode
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;               2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;               2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
 ;;      Rolf Ebert <ebert@inf.enst.fr>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,9 +22,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;; This Package provides a set of functions to use the output of the
@@ -564,7 +562,7 @@ Completion is available."
   (let ((file (ada-find-src-file-in-dir filename)))
     (if file
        (find-file file)
-      (error (concat filename " not found in src_dir")))))
+      (error "%s not found in src_dir" filename))))
 
 
 ;; ----- Utilities -------------------------------------------------
@@ -617,7 +615,7 @@ If NO-USER-QUESTION, don't prompt user for file.  Call
 
 (defun ada-convert-file-name (name)
   "Convert from NAME to a name that can be used by the compilation commands.
-This is overriden on VMS to convert from VMS filenames to Unix filenames."
+This is overridden on VMS to convert from VMS filenames to Unix filenames."
   name)
 ;; FIXME: use convert-standard-filename instead
 
@@ -648,8 +646,8 @@ is non-nil, prompt the user to select one.  If none are found, return
 
   (let (selected)
 
-    (if (or (not (string= mode-name "Ada"))
-           (not (buffer-file-name)))
+    (if (not (and (derived-mode-p 'ada-mode)
+                  buffer-file-name))
 
        ;;  Not in an Ada buffer, or current buffer not associated
        ;;  with a file (for instance an emerge buffer)
@@ -1706,7 +1704,7 @@ Information is extracted from the ali file."
            (beginning-of-line)
            ;; while we have a continuation line, go up one line
            (while (looking-at "^\\.")
-             (previous-line 1)
+             (forward-line -1)
              (beginning-of-line))
            (unless (looking-at (concat "[0-9]+.[0-9]+[ *]"
                                        (ada-name-of identlist) "[ <{=\(\[]"))
@@ -1722,8 +1720,8 @@ Information is extracted from the ali file."
          ;; No more idea to find the declaration.  Give up
          (progn
            (kill-buffer ali-buffer)
-           (error (concat "No declaration of " (ada-name-of identlist)
-                          " found."))
+
+           (error "No declaration of %s found." (ada-name-of identlist))
            )))
       )
 
@@ -1735,11 +1733,11 @@ Information is extracted from the ali file."
        (let ((current-line (buffer-substring
                             (point) (save-excursion (end-of-line) (point)))))
          (save-excursion
-           (next-line 1)
+           (forward-line 1)
            (beginning-of-line)
            (while (looking-at "^\\.\\(.*\\)")
              (set 'current-line (concat current-line (match-string 1)))
-             (next-line 1))
+             (forward-line 1))
            )
 
          (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9_.-]+\\)" nil t)
@@ -1808,10 +1806,8 @@ This function is disabled for operators, and only works for identifiers."
           ;; none => error
           ((= len 0)
            (kill-buffer (current-buffer))
-           (error (concat "No declaration of "
-                          (ada-name-of identlist)
-                          " recorded in .ali file")))
-
+           (error "No declaration of %s recorded in .ali file"
+                  (ada-name-of identlist)))
           ;; one => should be the right one
           ((= len 1)
            (goto-line (caar declist)))
@@ -2011,7 +2007,7 @@ the declaration and documentation of the subprograms one is using."
                                  (string-to-number (nth 2 (car list)))
                                  identlist
                                  other-frame)
-       (error (concat (caar list) " not found in src_dir")))
+       (error "%s not found in src_dir"  (caar list)))
       (message "This is only a (good) guess at the cross-reference.")
       )
 
@@ -2312,5 +2308,5 @@ For instance, it creates the gnat-specific menus, sets some hooks for
 
 (provide 'ada-xref)
 
-;;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e
+;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e
 ;;; ada-xref.el ends here