Mercurial > emacs
diff lisp/info.el @ 94062:9fefa536be58
* minibuffer.el (completion-all-completion-with-base-size): New var.
(completion--some): New function.
(completion-table-with-context, completion--file-name-table):
Return the base-size if requested.
(completion-table-in-turn): Generalize to multiple arguments.
(complete-in-turn): Compatibility alias.
(completion-styles-alist): New var.
(completion-styles): New customization.
(minibuffer-try-completion, minibuffer-all-completions):
New functions.
(minibuffer--do-completion, minibuffer-complete-and-exit)
(minibuffer-try-word-completion): Use them.
(display-completion-list, minibuffer-completion-help): Use them.
Handle all-completions's new base-size info to set completion-base-size.
* info.el (Info-read-node-name-1): Use completion-table-with-context,
completion-table-with-terminator and complete-with-action.
Remove the now obsolete completion-base-size-function property.
* simple.el (completion-list-mode-map): Move init into declaration.
(completion-list-mode): Use define-derived-mode.
(completion-setup-function): Use any completion-base-size that may
have been set before. Remove handling of completion-base-size-function.
* loadup.el: Move abbrev.el up earlier.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 13 Apr 2008 22:12:02 +0000 |
parents | 7498dcd3cee6 |
children | 959a3833d833 |
line wrap: on
line diff
--- a/lisp/info.el Sun Apr 13 18:07:54 2008 +0000 +++ b/lisp/info.el Sun Apr 13 22:12:02 2008 +0000 @@ -1513,20 +1513,15 @@ (cond ;; First complete embedded file names. ((string-match "\\`([^)]*\\'" string) - (let ((file (substring string 1))) - (cond - ((eq code nil) - (let ((comp (try-completion file 'Info-read-node-name-2 - (cons Info-directory-list - (mapcar 'car Info-suffix-list))))) - (cond - ((eq comp t) (concat string ")")) - (comp (concat "(" comp))))) - ((eq code t) - (all-completions file 'Info-read-node-name-2 - (cons Info-directory-list - (mapcar 'car Info-suffix-list)))) - (t nil)))) + (completion-table-with-context + "(" + (apply-partially 'completion-table-with-terminator + ")" 'Info-read-node-name-2) + (substring string 1) + (cons Info-directory-list + (mapcar 'car Info-suffix-list)) + code)) + ;; If a file name was given, then any node is fair game. ((string-match "\\`(" string) (cond @@ -1534,21 +1529,11 @@ ((eq code t) nil) (t t))) ;; Otherwise use Info-read-node-completion-table. - ((eq code nil) - (try-completion string Info-read-node-completion-table predicate)) - ((eq code t) - (all-completions string Info-read-node-completion-table predicate)) - (t - (test-completion string Info-read-node-completion-table predicate)))) + (t (complete-with-action + code Info-read-node-completion-table string predicate)))) ;; Arrange to highlight the proper letters in the completion list buffer. -(put 'Info-read-node-name-1 'completion-base-size-function - (lambda () - (if (string-match "\\`([^)]*\\'" - (or completion-common-substring - (minibuffer-completion-contents))) - 1 - 0))) + (defun Info-read-node-name (prompt) (let* ((completion-ignore-case t)