comparison 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
comparison
equal deleted inserted replaced
94061:d4e9da5a29d5 94062:9fefa536be58
1511 ;; unless STRING starts with an open-paren. 1511 ;; unless STRING starts with an open-paren.
1512 (defun Info-read-node-name-1 (string predicate code) 1512 (defun Info-read-node-name-1 (string predicate code)
1513 (cond 1513 (cond
1514 ;; First complete embedded file names. 1514 ;; First complete embedded file names.
1515 ((string-match "\\`([^)]*\\'" string) 1515 ((string-match "\\`([^)]*\\'" string)
1516 (let ((file (substring string 1))) 1516 (completion-table-with-context
1517 (cond 1517 "("
1518 ((eq code nil) 1518 (apply-partially 'completion-table-with-terminator
1519 (let ((comp (try-completion file 'Info-read-node-name-2 1519 ")" 'Info-read-node-name-2)
1520 (cons Info-directory-list 1520 (substring string 1)
1521 (mapcar 'car Info-suffix-list))))) 1521 (cons Info-directory-list
1522 (cond 1522 (mapcar 'car Info-suffix-list))
1523 ((eq comp t) (concat string ")")) 1523 code))
1524 (comp (concat "(" comp))))) 1524
1525 ((eq code t)
1526 (all-completions file 'Info-read-node-name-2
1527 (cons Info-directory-list
1528 (mapcar 'car Info-suffix-list))))
1529 (t nil))))
1530 ;; If a file name was given, then any node is fair game. 1525 ;; If a file name was given, then any node is fair game.
1531 ((string-match "\\`(" string) 1526 ((string-match "\\`(" string)
1532 (cond 1527 (cond
1533 ((eq code nil) string) 1528 ((eq code nil) string)
1534 ((eq code t) nil) 1529 ((eq code t) nil)
1535 (t t))) 1530 (t t)))
1536 ;; Otherwise use Info-read-node-completion-table. 1531 ;; Otherwise use Info-read-node-completion-table.
1537 ((eq code nil) 1532 (t (complete-with-action
1538 (try-completion string Info-read-node-completion-table predicate)) 1533 code Info-read-node-completion-table string predicate))))
1539 ((eq code t)
1540 (all-completions string Info-read-node-completion-table predicate))
1541 (t
1542 (test-completion string Info-read-node-completion-table predicate))))
1543 1534
1544 ;; Arrange to highlight the proper letters in the completion list buffer. 1535 ;; Arrange to highlight the proper letters in the completion list buffer.
1545 (put 'Info-read-node-name-1 'completion-base-size-function 1536
1546 (lambda ()
1547 (if (string-match "\\`([^)]*\\'"
1548 (or completion-common-substring
1549 (minibuffer-completion-contents)))
1550 1
1551 0)))
1552 1537
1553 (defun Info-read-node-name (prompt) 1538 (defun Info-read-node-name (prompt)
1554 (let* ((completion-ignore-case t) 1539 (let* ((completion-ignore-case t)
1555 (Info-read-node-completion-table (Info-build-node-completions)) 1540 (Info-read-node-completion-table (Info-build-node-completions))
1556 (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) 1541 (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))