X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/e41ab416d9de2946bba59440fb397c8f258dc757..f10533854f4c7bb54247a11981191bf37b70cb36:/packages/ada-mode/ada-gnat-xref.el diff --git a/packages/ada-mode/ada-gnat-xref.el b/packages/ada-mode/ada-gnat-xref.el index 05961a08d..4d49aa74a 100644 --- a/packages/ada-mode/ada-gnat-xref.el +++ b/packages/ada-mode/ada-gnat-xref.el @@ -1,4 +1,4 @@ -;;; ada-gnat-xref.el --- Ada mode cross-reference functionality provided by the 'gnat xref' tool -*- lexical-binding:t -*- +;;; 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. @@ -44,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. @@ -93,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 @@ -119,15 +119,14 @@ ;; error in *.gpr; ignore here. (forward-line 1) ;; else process line - (progn - (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")) @@ -159,7 +158,7 @@ (compilation-start cmd 'compilation-mode - (lambda (mode) (concat mode "-gnatfind"))) + (lambda (name) (concat name "-gnatfind"))) )))) ;;;;; setup