]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ada-mode/ada-gnat-compile.el
* packages/ada-mode: Miscellaneous cleanups.
[gnu-emacs-elpa] / packages / ada-mode / ada-gnat-compile.el
index b17ebe94d7f3db5c83961ebb7221a8f89bbe92b8..98f658027c10fd3d11f0f03cf0c3554b3a2af807 100644 (file)
@@ -222,25 +222,20 @@ Prompt user if more than one."
                                (< pos limit))))
                   (when (not done)
                     (let* ((item (get-text-property pos 'ada-secondary-error))
-                           (unit-file (nth 0 item)))
-                      (add-to-list 'choices (ada-ada-name-from-file-name unit-file))
+                           (unit-file (nth 0 item))
+                            (choice (ada-ada-name-from-file-name unit-file)))
+                       (unless (member choice choices) (push choice choices))
                       (goto-char (1+ pos))
                       (goto-char (1+ (next-single-property-change (point) 'ada-secondary-error nil limit)))
                       (when (eolp) (forward-line 1))
                       ))
                   )));; unless while let
 
-            (cond
-             ((= 0 (length choices))
-              (setq unit-name nil))
-
-             ((= 1 (length choices))
-              (setq unit-name (car choices)))
-
-             (t ;; multiple choices
-              (setq unit-name
-                    (completing-read "package name: " choices)))
-             );; cond
+            (setq unit-name (cond
+                              ((= 0 (length choices)) nil)
+                              ((= 1 (length choices)) (car choices))
+                              (t ;; multiple choices
+                               (completing-read "package name: " choices))))
 
             (when unit-name
               (pop-to-buffer source-buffer)