changeset 93134:4e8466e2b7c4

* 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.
author Juri Linkov <juri@jurta.org>
date Fri, 21 Mar 2008 23:58:06 +0000
parents 503666735e0c
children c3e303fc7a15
files lisp/comint.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Fri Mar 21 23:52:27 2008 +0000
+++ b/lisp/comint.el	Fri Mar 21 23:58:06 2008 +0000
@@ -2972,7 +2972,7 @@
 		   ((or comint-completion-autolist
 			(string-equal stub completion))
 		    ;; It's not unique, list possible completions.
-		    (comint-dynamic-list-completions completions)
+		    (comint-dynamic-list-completions completions stub)
 		    'listed)
 		   (t
 		    (unless minibuffer-p
@@ -2998,7 +2998,8 @@
 	    (minibuffer-message (format " [No completions of %s]" filename))
 	  (message "No completions of %s" filename))
       (comint-dynamic-list-completions
-       (mapcar 'comint-quote-filename completions)))))
+       (mapcar 'comint-quote-filename completions)
+       filenondir))))
 
 
 ;; This is bound locally in a *Completions* buffer to the list of
@@ -3008,8 +3009,9 @@
 
 (defvar comint-dynamic-list-completions-config nil)
 
-(defun comint-dynamic-list-completions (completions)
+(defun comint-dynamic-list-completions (completions &optional common-substring)
   "List in help buffer sorted COMPLETIONS.
+The meaning of COMMON-SUBSTRING is the same as in `display-completion-list'.
 Typing SPC flushes the help buffer."
   (let ((window (get-buffer-window "*Completions*" 0)))
     (setq completions (sort completions 'string-lessp))
@@ -3041,7 +3043,7 @@
       (setq comint-dynamic-list-completions-config
 	    (current-window-configuration))
       (with-output-to-temp-buffer "*Completions*"
-	(display-completion-list completions))
+	(display-completion-list completions common-substring))
       (if (window-minibuffer-p (selected-window))
 	  (minibuffer-message " [Type space to flush; repeat completion command to scroll]")
 	(message "Type space to flush; repeat completion command to scroll")))