aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-03-21 23:51:40 +0000
committerJuri Linkov2008-03-21 23:51:40 +0000
commit4b0dc1de40c1cc113f1f508be94a7f6a24cd1fcf (patch)
tree0327b65d92dce6312d10cf2b0f2466a93fcd29fc
parent4a7c4c40fb221845dce6e881b464bb21b473f4a6 (diff)
downloademacs-4b0dc1de40c1cc113f1f508be94a7f6a24cd1fcf.tar.gz
emacs-4b0dc1de40c1cc113f1f508be94a7f6a24cd1fcf.zip
(comint-dynamic-complete-as-filename)
(comint-dynamic-list-filename-completions) (comint-dynamic-simple-complete): Use `minibuffer-message' to display message "No completions of %s" when a command is called in the minibuffer. (comint-dynamic-simple-complete): Don't display other completion messages when a command is called in the minibuffer. (comint-dynamic-list-completions): Use `minibuffer-message' to display message " [Type space to flush ...]" when a command is called in the minibuffer.
-rw-r--r--lisp/comint.el29
1 files changed, 21 insertions, 8 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 6c9befa5460..748006b1b2b 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2871,7 +2871,9 @@ See `comint-dynamic-complete-filename'. Returns t if successful."
2871 (directory (if filedir (comint-directory filedir) default-directory)) 2871 (directory (if filedir (comint-directory filedir) default-directory))
2872 (completion (file-name-completion filenondir directory))) 2872 (completion (file-name-completion filenondir directory)))
2873 (cond ((null completion) 2873 (cond ((null completion)
2874 (message "No completions of %s" filename) 2874 (if minibuffer-p
2875 (minibuffer-message (format " [No completions of %s]" filename))
2876 (message "No completions of %s" filename))
2875 (setq success nil)) 2877 (setq success nil))
2876 ((eq completion t) ; Means already completed "file". 2878 ((eq completion t) ; Means already completed "file".
2877 (insert filesuffix) 2879 (insert filesuffix)
@@ -2935,19 +2937,24 @@ Returns `listed' if a completion listing was shown.
2935 2937
2936See also `comint-dynamic-complete-filename'." 2938See also `comint-dynamic-complete-filename'."
2937 (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin))) 2939 (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
2940 (minibuffer-p (window-minibuffer-p (selected-window)))
2938 (suffix (cond ((not comint-completion-addsuffix) "") 2941 (suffix (cond ((not comint-completion-addsuffix) "")
2939 ((not (consp comint-completion-addsuffix)) " ") 2942 ((not (consp comint-completion-addsuffix)) " ")
2940 (t (cdr comint-completion-addsuffix)))) 2943 (t (cdr comint-completion-addsuffix))))
2941 (completions (all-completions stub candidates))) 2944 (completions (all-completions stub candidates)))
2942 (cond ((null completions) 2945 (cond ((null completions)
2943 (message "No completions of %s" stub) 2946 (if minibuffer-p
2947 (minibuffer-message (format " [No completions of %s]" stub))
2948 (message "No completions of %s" stub))
2944 nil) 2949 nil)
2945 ((= 1 (length completions)) ; Gotcha! 2950 ((= 1 (length completions)) ; Gotcha!
2946 (let ((completion (car completions))) 2951 (let ((completion (car completions)))
2947 (if (string-equal completion stub) 2952 (if (string-equal completion stub)
2948 (message "Sole completion") 2953 (unless minibuffer-p
2954 (message "Sole completion"))
2949 (insert (substring completion (length stub))) 2955 (insert (substring completion (length stub)))
2950 (message "Completed")) 2956 (unless minibuffer-p
2957 (message "Completed")))
2951 (insert suffix) 2958 (insert suffix)
2952 'sole)) 2959 'sole))
2953 (t ; There's no unique completion. 2960 (t ; There's no unique completion.
@@ -2959,7 +2966,8 @@ See also `comint-dynamic-complete-filename'."
2959 (member completion completions)) 2966 (member completion completions))
2960 ;; It's not unique, but user wants shortest match. 2967 ;; It's not unique, but user wants shortest match.
2961 (insert suffix) 2968 (insert suffix)
2962 (message "Completed shortest") 2969 (unless minibuffer-p
2970 (message "Completed shortest"))
2963 'shortest) 2971 'shortest)
2964 ((or comint-completion-autolist 2972 ((or comint-completion-autolist
2965 (string-equal stub completion)) 2973 (string-equal stub completion))
@@ -2967,7 +2975,8 @@ See also `comint-dynamic-complete-filename'."
2967 (comint-dynamic-list-completions completions) 2975 (comint-dynamic-list-completions completions)
2968 'listed) 2976 'listed)
2969 (t 2977 (t
2970 (message "Partially completed") 2978 (unless minibuffer-p
2979 (message "Partially completed"))
2971 'partial))))))) 2980 'partial)))))))
2972 2981
2973 2982
@@ -2985,7 +2994,9 @@ See also `comint-dynamic-complete-filename'."
2985 (directory (if filedir (comint-directory filedir) default-directory)) 2994 (directory (if filedir (comint-directory filedir) default-directory))
2986 (completions (file-name-all-completions filenondir directory))) 2995 (completions (file-name-all-completions filenondir directory)))
2987 (if (not completions) 2996 (if (not completions)
2988 (message "No completions of %s" filename) 2997 (if (window-minibuffer-p (selected-window))
2998 (minibuffer-message (format " [No completions of %s]" filename))
2999 (message "No completions of %s" filename))
2989 (comint-dynamic-list-completions 3000 (comint-dynamic-list-completions
2990 (mapcar 'comint-quote-filename completions))))) 3001 (mapcar 'comint-quote-filename completions)))))
2991 3002
@@ -3031,7 +3042,9 @@ Typing SPC flushes the help buffer."
3031 (current-window-configuration)) 3042 (current-window-configuration))
3032 (with-output-to-temp-buffer "*Completions*" 3043 (with-output-to-temp-buffer "*Completions*"
3033 (display-completion-list completions)) 3044 (display-completion-list completions))
3034 (message "Type space to flush; repeat completion command to scroll")) 3045 (if (window-minibuffer-p (selected-window))
3046 (minibuffer-message " [Type space to flush; repeat completion command to scroll]")
3047 (message "Type space to flush; repeat completion command to scroll")))
3035 3048
3036 ;; Read the next key, to process SPC. 3049 ;; Read the next key, to process SPC.
3037 (let (key first) 3050 (let (key first)