diff options
| author | Juri Linkov | 2008-03-21 23:58:06 +0000 |
|---|---|---|
| committer | Juri Linkov | 2008-03-21 23:58:06 +0000 |
| commit | c59a65bdacba84581a6bbc8c6b5615ad717d55fb (patch) | |
| tree | 620f7d0abba0707b05499431c82fea3ea82254cb | |
| parent | c35be7ec907278bf13968530b2c091fd91a93eba (diff) | |
| download | emacs-c59a65bdacba84581a6bbc8c6b5615ad717d55fb.tar.gz emacs-c59a65bdacba84581a6bbc8c6b5615ad717d55fb.zip | |
* comint.el (comint-dynamic-simple-complete):
Use variable `stub' for the second arg `common-substring'
of `comint-dynamic-list-completions'.
(comint-dynamic-list-filename-completions):
Use variable `filenondir' for the second arg `common-substring'
of `comint-dynamic-list-completions'.
(comint-dynamic-list-completions): Add new optional arg
`common-substring'. Add `common-substring' as the
second arg of the call to `display-completion-list'. Doc fix.
| -rw-r--r-- | lisp/comint.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 748006b1b2b..2a872e4fb99 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2972,7 +2972,7 @@ See also `comint-dynamic-complete-filename'." | |||
| 2972 | ((or comint-completion-autolist | 2972 | ((or comint-completion-autolist |
| 2973 | (string-equal stub completion)) | 2973 | (string-equal stub completion)) |
| 2974 | ;; It's not unique, list possible completions. | 2974 | ;; It's not unique, list possible completions. |
| 2975 | (comint-dynamic-list-completions completions) | 2975 | (comint-dynamic-list-completions completions stub) |
| 2976 | 'listed) | 2976 | 'listed) |
| 2977 | (t | 2977 | (t |
| 2978 | (unless minibuffer-p | 2978 | (unless minibuffer-p |
| @@ -2998,7 +2998,8 @@ See also `comint-dynamic-complete-filename'." | |||
| 2998 | (minibuffer-message (format " [No completions of %s]" filename)) | 2998 | (minibuffer-message (format " [No completions of %s]" filename)) |
| 2999 | (message "No completions of %s" filename)) | 2999 | (message "No completions of %s" filename)) |
| 3000 | (comint-dynamic-list-completions | 3000 | (comint-dynamic-list-completions |
| 3001 | (mapcar 'comint-quote-filename completions))))) | 3001 | (mapcar 'comint-quote-filename completions) |
| 3002 | filenondir)))) | ||
| 3002 | 3003 | ||
| 3003 | 3004 | ||
| 3004 | ;; This is bound locally in a *Completions* buffer to the list of | 3005 | ;; This is bound locally in a *Completions* buffer to the list of |
| @@ -3008,8 +3009,9 @@ See also `comint-dynamic-complete-filename'." | |||
| 3008 | 3009 | ||
| 3009 | (defvar comint-dynamic-list-completions-config nil) | 3010 | (defvar comint-dynamic-list-completions-config nil) |
| 3010 | 3011 | ||
| 3011 | (defun comint-dynamic-list-completions (completions) | 3012 | (defun comint-dynamic-list-completions (completions &optional common-substring) |
| 3012 | "List in help buffer sorted COMPLETIONS. | 3013 | "List in help buffer sorted COMPLETIONS. |
| 3014 | The meaning of COMMON-SUBSTRING is the same as in `display-completion-list'. | ||
| 3013 | Typing SPC flushes the help buffer." | 3015 | Typing SPC flushes the help buffer." |
| 3014 | (let ((window (get-buffer-window "*Completions*" 0))) | 3016 | (let ((window (get-buffer-window "*Completions*" 0))) |
| 3015 | (setq completions (sort completions 'string-lessp)) | 3017 | (setq completions (sort completions 'string-lessp)) |
| @@ -3041,7 +3043,7 @@ Typing SPC flushes the help buffer." | |||
| 3041 | (setq comint-dynamic-list-completions-config | 3043 | (setq comint-dynamic-list-completions-config |
| 3042 | (current-window-configuration)) | 3044 | (current-window-configuration)) |
| 3043 | (with-output-to-temp-buffer "*Completions*" | 3045 | (with-output-to-temp-buffer "*Completions*" |
| 3044 | (display-completion-list completions)) | 3046 | (display-completion-list completions common-substring)) |
| 3045 | (if (window-minibuffer-p (selected-window)) | 3047 | (if (window-minibuffer-p (selected-window)) |
| 3046 | (minibuffer-message " [Type space to flush; repeat completion command to scroll]") | 3048 | (minibuffer-message " [Type space to flush; repeat completion command to scroll]") |
| 3047 | (message "Type space to flush; repeat completion command to scroll"))) | 3049 | (message "Type space to flush; repeat completion command to scroll"))) |