comparison lisp/minibuffer.el @ 111449:132f2dfd549f

Merge from emacs-23
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 09 Nov 2010 15:07:10 -0500
parents 4c0e52d5ae12 93e249d6d27c
children 4ed7d6375e3b
comparison
equal deleted inserted replaced
111448:321fbae3e04d 111449:132f2dfd549f
40 ;; - choose-completion can't automatically figure out the boundaries 40 ;; - choose-completion can't automatically figure out the boundaries
41 ;; corresponding to the displayed completions because we only 41 ;; corresponding to the displayed completions because we only
42 ;; provide the start info but not the end info in 42 ;; provide the start info but not the end info in
43 ;; completion-base-position. 43 ;; completion-base-position.
44 ;; - quoting is problematic. E.g. the double-dollar quoting used in 44 ;; - quoting is problematic. E.g. the double-dollar quoting used in
45 ;; substitie-in-file-name (and hence read-file-name-internal) bumps 45 ;; substitute-in-file-name (and hence read-file-name-internal) bumps
46 ;; into various bugs: 46 ;; into various bugs:
47 ;; - choose-completion doesn't know how to quote the text it inserts. 47 ;; - choose-completion doesn't know how to quote the text it inserts.
48 ;; E.g. it fails to double the dollars in file-name completion, or 48 ;; E.g. it fails to double the dollars in file-name completion, or
49 ;; to backslash-escape spaces and other chars in comint completion. 49 ;; to backslash-escape spaces and other chars in comint completion.
50 ;; - when completing ~/tmp/fo$$o, the highligting in *Completions* 50 ;; - when completing ~/tmp/fo$$o, the highligting in *Completions*
1131 (defun minibuffer-completion-help () 1131 (defun minibuffer-completion-help ()
1132 "Display a list of possible completions of the current minibuffer contents." 1132 "Display a list of possible completions of the current minibuffer contents."
1133 (interactive) 1133 (interactive)
1134 (message "Making completion list...") 1134 (message "Making completion list...")
1135 (lexical-let* ((start (field-beginning)) 1135 (lexical-let* ((start (field-beginning))
1136 (end (field-end))
1136 (string (field-string)) 1137 (string (field-string))
1137 (completions (completion-all-completions 1138 (completions (completion-all-completions
1138 string 1139 string
1139 minibuffer-completion-table 1140 minibuffer-completion-table
1140 minibuffer-completion-predicate 1141 minibuffer-completion-predicate
1162 (funcall completion-annotate-function s))) 1163 (funcall completion-annotate-function s)))
1163 (if ann (list s ann) s))) 1164 (if ann (list s ann) s)))
1164 completions))) 1165 completions)))
1165 (with-current-buffer standard-output 1166 (with-current-buffer standard-output
1166 (set (make-local-variable 'completion-base-position) 1167 (set (make-local-variable 'completion-base-position)
1167 ;; FIXME: We should provide the END part as well, but 1168 (list (+ start base-size)
1168 ;; currently completion-all-completions does not give 1169 ;; FIXME: We should pay attention to completion
1169 ;; us the necessary information. 1170 ;; boundaries here, but currently
1170 (list (+ start base-size) nil))) 1171 ;; completion-all-completions does not give us the
1172 ;; necessary information.
1173 end)))
1171 (display-completion-list completions))) 1174 (display-completion-list completions)))
1172 1175
1173 ;; If there are no completions, or if the current input is already the 1176 ;; If there are no completions, or if the current input is already the
1174 ;; only possible completion, then hide (previous&stale) completions. 1177 ;; only possible completion, then hide (previous&stale) completions.
1175 (minibuffer-hide-completions) 1178 (minibuffer-hide-completions)