]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ada-mode/ada-gnat-xref.el
Fix some quoting problems in doc strings
[gnu-emacs-elpa] / packages / ada-mode / ada-gnat-xref.el
index c5f675e170b096c24d22e1aa97a5a4c943bb2095..4d49aa74a262110d85c7da0eb9cd4472464b53ce 100644 (file)
@@ -1,5 +1,4 @@
-;; Ada mode cross-reference functionality provided by the 'gnat xref'
-;; tool.
+;;; ada-gnat-xref.el --- Ada mode cross-reference functionality provided by 'gnat xref'  -*- lexical-binding:t -*-
 ;;
 ;; These tools are all Ada-specific; see gpr-query for multi-language
 ;; GNAT cross-reference tools.
@@ -45,7 +44,7 @@
 (defconst ada-gnat-file-line-col-regexp "\\(.*\\):\\([0-9]+\\):\\([0-9]+\\)")
 
 (defun ada-gnat-xref-other (identifier file line col)
-  "For `ada-xref-other-function', using 'gnat find', which is Ada-specific."
+  "For `ada-xref-other-function', using `gnat find', which is Ada-specific."
 
   (when (eq ?\" (aref identifier 0))
     ;; gnat find wants the quotes on operators, but the column is after the first quote.
@@ -57,7 +56,6 @@
         (switches (concat
                     "-a"
                     (when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 'gpr_ext)))))
-        status
         (result nil))
     (with-current-buffer (gnat-run-buffer)
       (gnat-run-gnat "find" (list switches arg))
@@ -95,7 +93,7 @@
     result))
 
 (defun ada-gnat-xref-parents (identifier file line col)
-  "For `ada-xref-parents-function', using 'gnat find', which is Ada-specific."
+  "For `ada-xref-parents-function', using `gnat find', which is Ada-specific."
 
   (let* ((arg (format "%s:%s:%d:%d" identifier file line col))
         (switches (list
            ;; error in *.gpr; ignore here.
            (forward-line 1)
          ;; else process line
-         (let ((found-file (match-string 1))
-               (found-line (string-to-number (match-string 2)))
-               (found-col  (string-to-number (match-string 3))))
-
-           (skip-syntax-forward "^ ")
-           (skip-syntax-forward " ")
-           (if (looking-at (concat "derived from .* (" ada-gnat-file-line-col-regexp ")"))
-               ;; found other item
-               (setq result (list (match-string 1)
-                                  (string-to-number (match-string 2))
-                                  (1- (string-to-number (match-string 3)))))
-             (forward-line 1)))
+         (skip-syntax-forward "^ ")
+         (skip-syntax-forward " ")
+         (if (looking-at (concat "derived from .* (" ada-gnat-file-line-col-regexp ")"))
+             ;; found other item
+             (setq result (list (match-string 1)
+                                (string-to-number (match-string 2))
+                                (1- (string-to-number (match-string 3)))))
+           (forward-line 1))
          )
        (when (eobp)
          (error "gnat find did not return parent types"))
 
        (compilation-start cmd
                           'compilation-mode
-                          (lambda (mode-name) (concat mode-name "-gnatfind")))
+                          (lambda (name) (concat name "-gnatfind")))
     ))))
 
 ;;;;; setup