]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ada-mode/ada-gnat-compile.el
Fix some quoting problems in doc strings
[gnu-emacs-elpa] / packages / ada-mode / ada-gnat-compile.el
index f3d69ac2d9061f287cfdc3f233eb177c137a0d64..c0d2156d7f3211bb854dd90e445cf4d81c532806 100644 (file)
@@ -1,5 +1,5 @@
-;; Ada mode compiling functionality provided by the 'gnat'
-;; tool. Includes related functions, such as gnatprep support.
+;; ada-gnat-compile.el --- Ada mode compiling functionality provided by 'gnat'  -*- lexical-binding:t -*-
+;; Includes related functions, such as gnatprep support.
 ;;
 ;; These tools are all Ada-specific; use Makefiles for multi-language
 ;; GNAT compilation tools.
@@ -165,7 +165,7 @@ Prompt user if more than one."
       (completing-read "correct spelling: " choices))
      )))
 
-(defun ada-gnat-fix-error (msg source-buffer source-window)
+(defun ada-gnat-fix-error (_msg source-buffer _source-window)
   "For `ada-gnat-fix-error-hook'."
   (let ((start-pos (point))
        message-column
@@ -192,8 +192,7 @@ Prompt user if more than one."
          ;; Then style errors.
 
          ((looking-at (concat ada-gnat-quoted-name-regexp " is not visible"))
-          (let ((ident (match-string 1))
-                (done nil)
+          (let ((done nil)
                 (file-line-struct (progn (beginning-of-line) (ada-get-compilation-message)))
                 pos choices unit-name)
             ;; next line may contain a reference to where ident is
@@ -348,24 +347,23 @@ Prompt user if more than one."
               t)))
 
          ((looking-at (concat "expected \\(private \\)?type " ada-gnat-quoted-name-regexp))
-          (let ((type (match-string 2)))
-            (forward-line 1)
-            (move-to-column message-column)
-            (cond
-             ((looking-at "found type access")
-              (pop-to-buffer source-buffer)
-              (if (looking-at "'Access")
-                  (kill-word 1)
-                (forward-word 1)
-                (insert ".all"))
-              t)
-            ((looking-at "found type .*_Access_Type")
-              ;; assume just need '.all'
-              (pop-to-buffer source-buffer)
+          (forward-line 1)
+          (move-to-column message-column)
+          (cond
+           ((looking-at "found type access")
+            (pop-to-buffer source-buffer)
+            (if (looking-at "'Access")
+                (kill-word 1)
               (forward-word 1)
-              (insert ".all")
-              t)
-            )))
+              (insert ".all"))
+            t)
+           ((looking-at "found type .*_Access_Type")
+            ;; assume just need '.all'
+            (pop-to-buffer source-buffer)
+            (forward-word 1)
+            (insert ".all")
+            t)
+           ))
 
          ((looking-at "extra \".\" ignored")
           (set-buffer source-buffer)
@@ -382,7 +380,9 @@ Prompt user if more than one."
           ;; also 'possible missing "with Ada.Text_IO; use Ada.Text_IO"' - ignoring the 'use'
           (let ((package-name (match-string-no-properties 1)))
             (pop-to-buffer source-buffer)
-            ;; FIXME (later): should check if prefix is already with'd, extend it
+            ;; Could check if prefix is already with'd, extend
+            ;; it. But no one has reported that case yet; this
+            ;; message only occurs for predefined Ada packages.
             (ada-fix-add-with-clause package-name))
           t)
 
@@ -470,8 +470,7 @@ Prompt user if more than one."
           t)
 
          ((looking-at (concat "warning: formal parameter " ada-gnat-quoted-name-regexp " is not modified"))
-          (let ((param (match-string 1))
-                (mode-regexp "\"\\([in out]+\\)\"")
+          (let ((mode-regexp "\"\\([in out]+\\)\"")
                 new-mode
                 old-mode)
             (forward-line 1)
@@ -581,7 +580,7 @@ Prompt user if more than one."
 
 (defun ada-gnat-compile-select-prj ()
   (setq ada-fix-error-hook 'ada-gnat-fix-error-hook)
-  (setq ada-prj-show-path 'gnat-prj-show-path)
+  (setq ada-prj-show-prj-path 'gnat-prj-show-prj-path)
   (add-to-list 'completion-ignored-extensions ".ali") ;; gnat library files
   (add-hook 'ada-syntax-propertize-hook 'ada-gnat-syntax-propertize)
   (add-hook 'ada-syntax-propertize-hook 'gnatprep-syntax-propertize)
@@ -617,7 +616,7 @@ Prompt user if more than one."
   )
 
 (defun ada-gnat-compile ()
-  "Set Ada mode global vars to use 'gnat' for compiling."
+  "Set Ada mode global vars to use `gnat' for compiling."
   (add-to-list 'ada-prj-file-ext-extra     "gpr")
   (add-to-list 'ada-prj-parser-alist       '("gpr" . gnat-parse-gpr))
   (add-to-list 'ada-select-prj-compiler    '(gnat  . ada-gnat-compile-select-prj))