changeset 7766:4a427472e21f

(comint-dynamic-complete-as-filename) (comint-dynamic-complete-filename): Suppress most messages when completing in the minibuffer.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 Jun 1994 16:29:05 +0000
parents 688637ba31c5
children 5be3332469e7
files lisp/comint.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Wed Jun 01 20:37:42 1994 +0000
+++ b/lisp/comint.el	Thu Jun 02 16:29:05 1994 +0000
@@ -1837,7 +1837,8 @@
 Returns t if successful."
   (interactive)
   (if (comint-match-partial-filename)
-      (prog2 (message "Completing file name...")
+      (prog2 (or (eq (selected-window) (minibuffer-window))
+		 (message "Completing file name..."))
 	  (comint-dynamic-complete-as-filename))))
 
 
@@ -1851,13 +1852,14 @@
 	 (pathdir (file-name-directory filename))
 	 (pathnondir (file-name-nondirectory filename))
 	 (directory (if pathdir (comint-directory pathdir) default-directory))
-	 (completion (file-name-completion pathnondir directory)))
+	 (completion (file-name-completion pathnondir directory))
+	 (mini-flag (eq (selected-window) (minibuffer-window))))
     (cond ((null completion)
            (message "No completions of %s" filename)
 	   (setq success nil))
           ((eq completion t)            ; Means already completed "file".
            (if comint-completion-addsuffix (insert " "))
-           (message "Sole completion"))
+           (or mini-flag (message "Sole completion")))
           ((string-equal completion "") ; Means completion on "directory/".
            (comint-dynamic-list-filename-completions))
           (t                            ; Completion string returned.
@@ -1868,19 +1870,19 @@
                     ;; We inserted a unique completion.
                     (if comint-completion-addsuffix
                         (insert (if (file-directory-p file) "/" " ")))
-                    (message "Completed"))
+                    (or mini-flag (message "Completed")))
                    ((and comint-completion-recexact comint-completion-addsuffix
                          (string-equal pathnondir completion)
                          (file-exists-p file))
                     ;; It's not unique, but user wants shortest match.
                     (insert (if (file-directory-p file) "/" " "))
-                    (message "Completed shortest"))
+                    (or mini-flag (message "Completed shortest")))
                    ((or comint-completion-autolist
                         (string-equal pathnondir completion))
                     ;; It's not unique, list possible completions.
                     (comint-dynamic-list-filename-completions))
                    (t
-                    (message "Partially completed"))))))
+                    (or mini-flag (message "Partially completed")))))))
     success))