aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO2005-10-16 09:31:48 +0000
committerMasatake YAMATO2005-10-16 09:31:48 +0000
commitf5fab556d45e13d12f83b2d8cd49fe343546c2f6 (patch)
treeb7b647699c7aaf6d26553dbfe2090e0bead36fd2
parent2416ec641247bc8d59cca8cac038cd00eba646f9 (diff)
downloademacs-f5fab556d45e13d12f83b2d8cd49fe343546c2f6.tar.gz
emacs-f5fab556d45e13d12f83b2d8cd49fe343546c2f6.zip
* message.el (message-expand-group): Pass the common
prefix substring of completion to `display-completion-list'. * mh-comp.el (mh-complete-word): Pass the common prefix substring of completion to `display-completion-list'. * dabbrev.el (dabbrev-completion): Pass the common prefix substring of completion to `display-completion-list'. * filecache.el (file-cache-minibuffer-complete) (file-cache-complete): Ditto. * tempo.el (tempo-display-completions): Ditto. * wid-edit.el (widget-file-complete, widget-color-complete): Ditto. * emacs-lisp/lisp.el (lisp-complete-symbol): Ditto. * eshell/em-hist.el (eshell-list-history): Ditto. * mail/mailabbrev.el (mail-abbrev-complete-alias): Ditto. * progmodes/etags.el (complete-tag): Ditto. * progmodes/make-mode.el (makefile-complete): Ditto. * progmodes/meta-mode.el (meta-complete-symbol): Ditto. * progmodes/octave-mod.el (octave-complete-symbol): Ditto. * progmodes/pascal.el (pascal-complete-word) (pascal-show-completions): Ditto. * textmodes/bibtex.el (bibtex-complete-internal): Ditto. * simple.el (completion-common-substring): New variable. (completion-setup-function): Use `completion-common-substring' to put faces. * minibuf.c (Fdisplay_completion_list): Add new optional argument COMMON_SUBSTRING. Bind `completion-common-substring' to the optional argument during running `completion-setup-hook'.
-rw-r--r--lisp/ChangeLog41
-rw-r--r--lisp/dabbrev.el3
-rw-r--r--lisp/emacs-lisp/lisp.el2
-rw-r--r--lisp/eshell/em-hist.el2
-rw-r--r--lisp/filecache.el4
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/message.el2
-rw-r--r--lisp/mail/mailabbrev.el3
-rw-r--r--lisp/mh-e/ChangeLog5
-rw-r--r--lisp/mh-e/mh-comp.el3
-rw-r--r--lisp/progmodes/etags.el3
-rw-r--r--lisp/progmodes/make-mode.el2
-rw-r--r--lisp/progmodes/meta-mode.el2
-rw-r--r--lisp/progmodes/octave-mod.el2
-rw-r--r--lisp/progmodes/pascal.el4
-rw-r--r--lisp/simple.el26
-rw-r--r--lisp/tempo.el6
-rw-r--r--lisp/textmodes/bibtex.el3
-rw-r--r--lisp/wid-edit.el6
-rw-r--r--src/ChangeLog6
-rw-r--r--src/minibuf.c32
21 files changed, 130 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e5a4976e73a..a40199fd91c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,44 @@
12005-10-16 Masatake YAMATO <jet@gyve.org>
2
3 * dabbrev.el (dabbrev-completion): Pass the common
4 prefix substring of completion to `display-completion-list'.
5
6 * filecache.el (file-cache-minibuffer-complete)
7 (file-cache-complete): Ditto.
8
9 * tempo.el (tempo-display-completions): Ditto.
10
11 * wid-edit.el (widget-file-complete, widget-color-complete): Ditto.
12
13 * emacs-lisp/lisp.el (lisp-complete-symbol): Ditto.
14
15 * eshell/em-hist.el (eshell-list-history): Ditto.
16
17 * mail/mailabbrev.el (mail-abbrev-complete-alias): Ditto.
18
19 * mail/mailalias.el (mail-complete): Ditto.
20
21 * progmodes/etags.el (complete-tag): Ditto.
22
23 * progmodes/make-mode.el (makefile-complete): Ditto.
24
25 * progmodes/meta-mode.el (meta-complete-symbol): Ditto.
26
27 * progmodes/octave-mod.el (octave-complete-symbol): Ditto.
28
29 * progmodes/pascal.el (pascal-complete-word)
30 (pascal-show-completions): Ditto.
31
32 * progmodes/python.el (python-complete-symbol): Ditto.
33
34 * textmodes/bibtex.el (bibtex-complete-internal): Ditto.
35
36 * textmodes/org.el (org-complete): Ditto.
37
38 * simple.el (completion-common-substring): New variable.
39 (completion-setup-function): Use `completion-common-substring'
40 to put faces.
41
12005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 422005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 43
3 * term/mac-win.el: Apply 2005-10-09 change for term/x-win.el. 44 * term/mac-win.el: Apply 2005-10-09 change for term/x-win.el.
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 2139e7c5761..b330f2b10d7 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -461,7 +461,8 @@ if there is a suitable one already."
461 ;; * String is a common substring completion already. Make list. 461 ;; * String is a common substring completion already. Make list.
462 (message "Making completion list...") 462 (message "Making completion list...")
463 (with-output-to-temp-buffer "*Completions*" 463 (with-output-to-temp-buffer "*Completions*"
464 (display-completion-list (all-completions init my-obarray))) 464 (display-completion-list (all-completions init my-obarray)
465 init))
465 (message "Making completion list...done"))) 466 (message "Making completion list...done")))
466 (and (window-minibuffer-p (selected-window)) 467 (and (window-minibuffer-p (selected-window))
467 (message nil)))) 468 (message nil))))
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index d248882d882..4b799ebfedf 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -586,7 +586,7 @@ considered."
586 (setq list (cdr list))) 586 (setq list (cdr list)))
587 (setq list (nreverse new)))) 587 (setq list (nreverse new))))
588 (with-output-to-temp-buffer "*Completions*" 588 (with-output-to-temp-buffer "*Completions*"
589 (display-completion-list list))) 589 (display-completion-list list pattern)))
590 (message "Making completion list...%s" "done"))))))) 590 (message "Making completion list...%s" "done")))))))
591 591
592;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e 592;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index fd887e5fa86..e7844028542 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -507,7 +507,7 @@ See also `eshell-read-history'."
507 ;; Change "completion" to "history reference" 507 ;; Change "completion" to "history reference"
508 ;; to make the display accurate. 508 ;; to make the display accurate.
509 (with-output-to-temp-buffer history-buffer 509 (with-output-to-temp-buffer history-buffer
510 (display-completion-list history) 510 (display-completion-list history prefix)
511 (set-buffer history-buffer) 511 (set-buffer history-buffer)
512 (forward-line 3) 512 (forward-line 3)
513 (while (search-backward "completion" nil 'move) 513 (while (search-backward "completion" nil 'move)
diff --git a/lisp/filecache.el b/lisp/filecache.el
index bb45bb392f3..442f729dd15 100644
--- a/lisp/filecache.el
+++ b/lisp/filecache.el
@@ -607,7 +607,7 @@ the name is considered already unique; only the second substitution
607 completion-setup-hook))) 607 completion-setup-hook)))
608 ) 608 )
609 (with-output-to-temp-buffer file-cache-completions-buffer 609 (with-output-to-temp-buffer file-cache-completions-buffer
610 (display-completion-list completion-list)) 610 (display-completion-list completion-list string))
611 ) 611 )
612 ) 612 )
613 (setq file-cache-string (file-cache-file-name completion-string)) 613 (setq file-cache-string (file-cache-file-name completion-string))
@@ -700,7 +700,7 @@ the name is considered already unique; only the second substitution
700 ) 700 )
701 (t 701 (t
702 (with-output-to-temp-buffer "*Completions*" 702 (with-output-to-temp-buffer "*Completions*"
703 (display-completion-list all)) 703 (display-completion-list all pattern))
704 )) 704 ))
705 )) 705 ))
706 706
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index abbfb096ab1..ba1298f3650 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12005-10-16 Masatake YAMATO <jet@gyve.org>
2
3 * message.el (message-expand-group): Pass the common
4 prefix substring of completion to `display-completion-list'.
5
12005-10-09 Daniel Brockman <daniel@brockman.se> 62005-10-09 Daniel Brockman <daniel@brockman.se>
2 7
3 * format-spec.el (format-spec): Propagate text properties of % spec. 8 * format-spec.el (format-spec): Propagate text properties of % spec.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index d64d8dbd2bf..b7607ad30e0 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -6691,7 +6691,7 @@ those headers."
6691 (let ((buffer-read-only nil)) 6691 (let ((buffer-read-only nil))
6692 (erase-buffer) 6692 (erase-buffer)
6693 (let ((standard-output (current-buffer))) 6693 (let ((standard-output (current-buffer)))
6694 (display-completion-list (sort completions 'string<))) 6694 (display-completion-list (sort completions 'string<) string))
6695 (goto-char (point-min)) 6695 (goto-char (point-min))
6696 (delete-region (point) (progn (forward-line 3) (point)))))))))) 6696 (delete-region (point) (progn (forward-line 3) (point))))))))))
6697 6697
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 06af543b4da..587b7d0187e 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -587,7 +587,8 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
587 (prog2 587 (prog2
588 (message "Making completion list...") 588 (message "Making completion list...")
589 (all-completions alias mail-abbrevs) 589 (all-completions alias mail-abbrevs)
590 (message "Making completion list...done")))))))) 590 (message "Making completion list...done"))
591 alias))))))
591 592
592(defun mail-abbrev-next-line (&optional arg) 593(defun mail-abbrev-next-line (&optional arg)
593 "Expand any mail abbrev, then move cursor vertically down ARG lines. 594 "Expand any mail abbrev, then move cursor vertically down ARG lines.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index d69d36c10af..0b995552c85 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,8 @@
12005-10-16 Masatake YAMATO <jet@gyve.org>
2
3 * mh-comp.el (mh-complete-word): Pass the common
4 prefix substring of completion to `display-completion-list'.
5
12005-10-15 Satyaki Das <satyaki@theforce.stanford.edu> 62005-10-15 Satyaki Das <satyaki@theforce.stanford.edu>
2 7
3 * mh-init.el (mh-image-load-path-called-flag): New variable which 8 * mh-init.el (mh-image-load-path-called-flag): New variable which
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 7289207cfb2..2aec8e8df9a 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1650,7 +1650,8 @@ Any match found replaces the text from BEGIN to END."
1650 ((stringp completion) 1650 ((stringp completion)
1651 (if (equal word completion) 1651 (if (equal word completion)
1652 (with-output-to-temp-buffer completions-buffer 1652 (with-output-to-temp-buffer completions-buffer
1653 (display-completion-list (all-completions word choices))) 1653 (display-completion-list (all-completions word choices)
1654 word))
1654 (ignore-errors 1655 (ignore-errors
1655 (kill-buffer completions-buffer)) 1656 (kill-buffer completions-buffer))
1656 (delete-region begin end) 1657 (delete-region begin end)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index f6e8697543f..ac2cc23048a 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2015,7 +2015,8 @@ for \\[find-tag] (which see)."
2015 (message "Making completion list...") 2015 (message "Making completion list...")
2016 (with-output-to-temp-buffer "*Completions*" 2016 (with-output-to-temp-buffer "*Completions*"
2017 (display-completion-list 2017 (display-completion-list
2018 (all-completions pattern 'tags-complete-tag nil))) 2018 (all-completions pattern 'tags-complete-tag nil)
2019 pattern))
2019 (message "Making completion list...%s" "done"))))) 2020 (message "Making completion list...%s" "done")))))
2020 2021
2021(dolist (x '("^No tags table in use; use .* to select one$" 2022(dolist (x '("^No tags table in use; use .* to select one$"
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 11ae1c66aa7..3a55129c899 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1176,7 +1176,7 @@ The context determines which are considered."
1176 (message "Making completion list...") 1176 (message "Making completion list...")
1177 (let ((list (all-completions try table))) 1177 (let ((list (all-completions try table)))
1178 (with-output-to-temp-buffer "*Completions*" 1178 (with-output-to-temp-buffer "*Completions*"
1179 (display-completion-list list))) 1179 (display-completion-list list try)))
1180 (message "Making completion list...done")))))) 1180 (message "Making completion list...done"))))))
1181 1181
1182 1182
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 9ae3e5a5935..f5bbb4d68db 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -509,7 +509,7 @@ If the list was changed, sort the list and remove duplicates first."
509 (message "Making completion list...") 509 (message "Making completion list...")
510 (let ((list (all-completions symbol list nil))) 510 (let ((list (all-completions symbol list nil)))
511 (with-output-to-temp-buffer "*Completions*" 511 (with-output-to-temp-buffer "*Completions*"
512 (display-completion-list list))) 512 (display-completion-list list symbol)))
513 (message "Making completion list... done")))) 513 (message "Making completion list... done"))))
514 (funcall (nth 1 entry))))) 514 (funcall (nth 1 entry)))))
515 515
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index e37f3b14a15..b65ad9eac1a 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -1252,7 +1252,7 @@ variables."
1252 ;; Taken from comint.el 1252 ;; Taken from comint.el
1253 (message "Making completion list...") 1253 (message "Making completion list...")
1254 (with-output-to-temp-buffer "*Completions*" 1254 (with-output-to-temp-buffer "*Completions*"
1255 (display-completion-list list)) 1255 (display-completion-list list string))
1256 (message "Hit space to flush") 1256 (message "Hit space to flush")
1257 (let (key first) 1257 (let (key first)
1258 (if (save-excursion 1258 (if (save-excursion
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 3cd243580e2..801096b9b0f 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1378,7 +1378,7 @@ indent of the current line in parameterlist."
1378 ((and (not (null (cdr allcomp))) (= (length pascal-str) 1378 ((and (not (null (cdr allcomp))) (= (length pascal-str)
1379 (length match))) 1379 (length match)))
1380 (with-output-to-temp-buffer "*Completions*" 1380 (with-output-to-temp-buffer "*Completions*"
1381 (display-completion-list allcomp)) 1381 (display-completion-list allcomp pascal-str))
1382 ;; Wait for a keypress. Then delete *Completion* window 1382 ;; Wait for a keypress. Then delete *Completion* window
1383 (momentary-string-display "" (point)) 1383 (momentary-string-display "" (point))
1384 (delete-window (get-buffer-window (get-buffer "*Completions*"))) 1384 (delete-window (get-buffer-window (get-buffer "*Completions*")))
@@ -1398,7 +1398,7 @@ indent of the current line in parameterlist."
1398 (all-completions pascal-str 'pascal-completion)))) 1398 (all-completions pascal-str 'pascal-completion))))
1399 ;; Show possible completions in a temporary buffer. 1399 ;; Show possible completions in a temporary buffer.
1400 (with-output-to-temp-buffer "*Completions*" 1400 (with-output-to-temp-buffer "*Completions*"
1401 (display-completion-list allcomp)) 1401 (display-completion-list allcomp pascal-str))
1402 ;; Wait for a keypress. Then delete *Completion* window 1402 ;; Wait for a keypress. Then delete *Completion* window
1403 (momentary-string-display "" (point)) 1403 (momentary-string-display "" (point))
1404 (delete-window (get-buffer-window (get-buffer "*Completions*"))))) 1404 (delete-window (get-buffer-window (get-buffer "*Completions*")))))
diff --git a/lisp/simple.el b/lisp/simple.el
index cab04c135d9..8f98b1cc907 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4844,10 +4844,13 @@ Called from `temp-buffer-show-hook'."
4844 "Normal hook run at the end of setting up a completion list buffer. 4844 "Normal hook run at the end of setting up a completion list buffer.
4845When this hook is run, the current buffer is the one in which the 4845When this hook is run, the current buffer is the one in which the
4846command to display the completion list buffer was run. 4846command to display the completion list buffer was run.
4847The completion list buffer is available as the value of `standard-output'.") 4847The completion list buffer is available as the value of `standard-output'.
4848The common prefix substring for completion may be available as the
4849value of `completion-common-substring'. See also `display-completion-list'.")
4850
4851
4852;; Variables and faces used in `completion-setup-function'.
4848 4853
4849;; This function goes in completion-setup-hook, so that it is called
4850;; after the text of the completion list buffer is written.
4851(defface completions-first-difference 4854(defface completions-first-difference
4852 '((t (:inherit bold))) 4855 '((t (:inherit bold)))
4853 "Face put on the first uncommon character in completions in *Completions* buffer." 4856 "Face put on the first uncommon character in completions in *Completions* buffer."
@@ -4867,6 +4870,17 @@ of the differing parts is, by contrast, slightly highlighted."
4867(defvar completion-root-regexp "^/" 4870(defvar completion-root-regexp "^/"
4868 "Regexp to use in `completion-setup-function' to find the root directory.") 4871 "Regexp to use in `completion-setup-function' to find the root directory.")
4869 4872
4873(defvar completion-common-substring nil
4874 "Common prefix substring to use in `completion-setup-function' to put faces.
4875The value is set by `display-completion-list' during running `completion-setup-hook'.
4876
4877To put faces, `completions-first-difference' and `completions-common-part'
4878into \"*Completions*\* buffer, the common prefix substring in completions is
4879needed as a hint. (Minibuffer is a special case. The content of minibuffer itself
4880is the substring.)")
4881
4882;; This function goes in completion-setup-hook, so that it is called
4883;; after the text of the completion list buffer is written.
4870(defun completion-setup-function () 4884(defun completion-setup-function ()
4871 (let ((mainbuf (current-buffer)) 4885 (let ((mainbuf (current-buffer))
4872 (mbuf-contents (minibuffer-contents))) 4886 (mbuf-contents (minibuffer-contents)))
@@ -4905,9 +4919,11 @@ of the differing parts is, by contrast, slightly highlighted."
4905 (funcall (get minibuffer-completion-table 'completion-base-size-function))) 4919 (funcall (get minibuffer-completion-table 'completion-base-size-function)))
4906 (setq completion-base-size 0)))) 4920 (setq completion-base-size 0))))
4907 ;; Put faces on first uncommon characters and common parts. 4921 ;; Put faces on first uncommon characters and common parts.
4908 (when completion-base-size 4922 (when (or completion-base-size completion-common-substring)
4909 (let* ((common-string-length 4923 (let* ((common-string-length
4910 (- (length mbuf-contents) completion-base-size)) 4924 (if completion-base-size
4925 (- (length mbuf-contents) completion-base-size)
4926 (length completion-common-substring)))
4911 (element-start (next-single-property-change 4927 (element-start (next-single-property-change
4912 (point-min) 4928 (point-min)
4913 'mouse-face)) 4929 'mouse-face))
diff --git a/lisp/tempo.el b/lisp/tempo.el
index 4939715a31c..62ba3c9acae 100644
--- a/lisp/tempo.el
+++ b/lisp/tempo.el
@@ -717,11 +717,13 @@ non-nil, a buffer containing possible completions is displayed."
717 (if tempo-leave-completion-buffer 717 (if tempo-leave-completion-buffer
718 (with-output-to-temp-buffer "*Completions*" 718 (with-output-to-temp-buffer "*Completions*"
719 (display-completion-list 719 (display-completion-list
720 (all-completions string tag-list))) 720 (all-completions string tag-list)
721 string))
721 (save-window-excursion 722 (save-window-excursion
722 (with-output-to-temp-buffer "*Completions*" 723 (with-output-to-temp-buffer "*Completions*"
723 (display-completion-list 724 (display-completion-list
724 (all-completions string tag-list))) 725 (all-completions string tag-list)
726 string))
725 (sit-for 32767)))) 727 (sit-for 32767))))
726 728
727;;; 729;;;
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 2177f72fd0d..50d8ccad764 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -2522,7 +2522,8 @@ of a word, all strings are listed. Return completion."
2522 (message "Making completion list...") 2522 (message "Making completion list...")
2523 (with-output-to-temp-buffer "*Completions*" 2523 (with-output-to-temp-buffer "*Completions*"
2524 (display-completion-list (all-completions part-of-word 2524 (display-completion-list (all-completions part-of-word
2525 completions))) 2525 completions)
2526 part-of-word))
2526 (message "Making completion list...done") 2527 (message "Making completion list...done")
2527 ;; return value is handled by choose-completion-string-functions 2528 ;; return value is handled by choose-completion-string-functions
2528 nil)))) 2529 nil))))
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 9dea809dc91..8335a202120 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -3012,7 +3012,8 @@ It will read a file name from the minibuffer when invoked."
3012 (with-output-to-temp-buffer "*Completions*" 3012 (with-output-to-temp-buffer "*Completions*"
3013 (display-completion-list 3013 (display-completion-list
3014 (sort (file-name-all-completions name-part directory) 3014 (sort (file-name-all-completions name-part directory)
3015 'string<))) 3015 'string<)
3016 name-part))
3016 (message "Making completion list...%s" "done"))))) 3017 (message "Making completion list...%s" "done")))))
3017 3018
3018(defun widget-file-prompt-value (widget prompt value unbound) 3019(defun widget-file-prompt-value (widget prompt value unbound)
@@ -3571,7 +3572,8 @@ example:
3571 (t 3572 (t
3572 (message "Making completion list...") 3573 (message "Making completion list...")
3573 (with-output-to-temp-buffer "*Completions*" 3574 (with-output-to-temp-buffer "*Completions*"
3574 (display-completion-list (all-completions prefix list nil))) 3575 (display-completion-list (all-completions prefix list nil)
3576 prefix))
3575 (message "Making completion list...done"))))) 3577 (message "Making completion list...done")))))
3576 3578
3577(defun widget-color-sample-face-get (widget) 3579(defun widget-color-sample-face-get (widget)
diff --git a/src/ChangeLog b/src/ChangeLog
index 4a27cac6fb9..d0b52872983 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12005-10-16 Masatake YAMATO <jet@gyve.org>
2
3 * minibuf.c (Fdisplay_completion_list): Add new optional
4 argument COMMON_SUBSTRING. Bind `completion-common-substring'
5 to the optional argument during running `completion-setup-hook'.
6
12005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 72005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 8
3 * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp): 9 * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp):
diff --git a/src/minibuf.c b/src/minibuf.c
index 28789b60bde..d7ef048c138 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2351,7 +2351,7 @@ Return nil if there is no valid completion, else t. */)
2351} 2351}
2352 2352
2353DEFUN ("display-completion-list", Fdisplay_completion_list, Sdisplay_completion_list, 2353DEFUN ("display-completion-list", Fdisplay_completion_list, Sdisplay_completion_list,
2354 1, 1, 0, 2354 1, 2, 0,
2355 doc: /* Display the list of completions, COMPLETIONS, using `standard-output'. 2355 doc: /* Display the list of completions, COMPLETIONS, using `standard-output'.
2356Each element may be just a symbol or string 2356Each element may be just a symbol or string
2357or may be a list of two strings to be printed as if concatenated. 2357or may be a list of two strings to be printed as if concatenated.
@@ -2361,14 +2361,23 @@ alternative, the second serves as annotation.
2361The actual completion alternatives, as inserted, are given `mouse-face' 2361The actual completion alternatives, as inserted, are given `mouse-face'
2362properties of `highlight'. 2362properties of `highlight'.
2363At the end, this runs the normal hook `completion-setup-hook'. 2363At the end, this runs the normal hook `completion-setup-hook'.
2364It can find the completion buffer in `standard-output'. */) 2364It can find the completion buffer in `standard-output'.
2365 (completions) 2365The optional second arg COMMON-SUBSTRING is a string.
2366It is used to put faces, `completions-first-difference` and
2367`completions-common-part' on the completion bufffer. The
2368`completions-common-part' face is put on the common substring
2369specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil,
2370the faces are not put.
2371Internally, COMMON-SUBSTRING is bound to `completion-common-substring'
2372during running `completion-setup-hook'. */)
2373 (completions, common_substring)
2366 Lisp_Object completions; 2374 Lisp_Object completions;
2375 Lisp_Object common_substring;
2367{ 2376{
2368 Lisp_Object tail, elt; 2377 Lisp_Object tail, elt;
2369 register int i; 2378 register int i;
2370 int column = 0; 2379 int column = 0;
2371 struct gcpro gcpro1, gcpro2; 2380 struct gcpro gcpro1, gcpro2, gcpro3;
2372 struct buffer *old = current_buffer; 2381 struct buffer *old = current_buffer;
2373 int first = 1; 2382 int first = 1;
2374 2383
@@ -2377,7 +2386,7 @@ It can find the completion buffer in `standard-output'. */)
2377 except for ELT. ELT can be pointing to a string 2386 except for ELT. ELT can be pointing to a string
2378 when terpri or Findent_to calls a change hook. */ 2387 when terpri or Findent_to calls a change hook. */
2379 elt = Qnil; 2388 elt = Qnil;
2380 GCPRO2 (completions, elt); 2389 GCPRO3 (completions, elt, common_substring);
2381 2390
2382 if (BUFFERP (Vstandard_output)) 2391 if (BUFFERP (Vstandard_output))
2383 set_buffer_internal (XBUFFER (Vstandard_output)); 2392 set_buffer_internal (XBUFFER (Vstandard_output));
@@ -2526,13 +2535,20 @@ It can find the completion buffer in `standard-output'. */)
2526 } 2535 }
2527 } 2536 }
2528 2537
2529 UNGCPRO;
2530
2531 if (BUFFERP (Vstandard_output)) 2538 if (BUFFERP (Vstandard_output))
2532 set_buffer_internal (old); 2539 set_buffer_internal (old);
2533 2540
2534 if (!NILP (Vrun_hooks)) 2541 if (!NILP (Vrun_hooks))
2535 call1 (Vrun_hooks, intern ("completion-setup-hook")); 2542 {
2543 int count1 = SPECPDL_INDEX ();
2544
2545 specbind (intern ("completion-common-substring"), common_substring);
2546 call1 (Vrun_hooks, intern ("completion-setup-hook"));
2547
2548 unbind_to (count1, Qnil);
2549 }
2550
2551 UNGCPRO;
2536 2552
2537 return Qnil; 2553 return Qnil;
2538} 2554}