diff options
| author | Stefan Monnier | 2001-11-30 01:13:59 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-30 01:13:59 +0000 |
| commit | d006d95766d167759962b916cacbc2fd7c94d05c (patch) | |
| tree | f252daab78439a6b6cc55d7e408dbb895b12764c /lisp | |
| parent | e0b163225fcba986a267c9e68f8792cccadc5656 (diff) | |
| download | emacs-d006d95766d167759962b916cacbc2fd7c94d05c.tar.gz emacs-d006d95766d167759962b916cacbc2fd7c94d05c.zip | |
(completing-read-multiple): Better preserve
the value of require-match in minibuffer-completion-confirm.
Use crm-local-completion-map.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/crm.el | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index dda03743080..26a34204008 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | ;; `crm-default-separator' (comma). The separator character may be | 41 | ;; `crm-default-separator' (comma). The separator character may be |
| 42 | ;; changed by modifying the value of `crm-separator'. | 42 | ;; changed by modifying the value of `crm-separator'. |
| 43 | 43 | ||
| 44 | ;; Continguous strings of non-separator-characters are referred to as | 44 | ;; Contiguous strings of non-separator-characters are referred to as |
| 45 | ;; 'elements'. In the aforementioned example, the elements are: | 45 | ;; 'elements'. In the aforementioned example, the elements are: |
| 46 | ;; 'alice', 'bob', and 'eve'. | 46 | ;; 'alice', 'bob', and 'eve'. |
| 47 | 47 | ||
| @@ -529,7 +529,7 @@ This keymap inherits from the keymap named `minibuffer-local-completion-map'. | |||
| 529 | The only difference is that TAB is bound to `crm-minibuffer-complete' in | 529 | The only difference is that TAB is bound to `crm-minibuffer-complete' in |
| 530 | the inheriting keymap. | 530 | the inheriting keymap. |
| 531 | 531 | ||
| 532 | If REQUIRE-MACTH is non-nil, the keymap `crm-local-must-match-map' is used. | 532 | If REQUIRE-MATCH is non-nil, the keymap `crm-local-must-match-map' is used. |
| 533 | This keymap inherits from the keymap named `minibuffer-local-must-match-map'. | 533 | This keymap inherits from the keymap named `minibuffer-local-must-match-map'. |
| 534 | The inheriting keymap binds RET to `crm-minibuffer-complete-and-exit' | 534 | The inheriting keymap binds RET to `crm-minibuffer-complete-and-exit' |
| 535 | and TAB to `crm-minibuffer-complete'." | 535 | and TAB to `crm-minibuffer-complete'." |
| @@ -574,7 +574,7 @@ The default value for the separator character is the value of | |||
| 574 | `crm-default-separator' (comma). The separator character may be | 574 | `crm-default-separator' (comma). The separator character may be |
| 575 | changed by modifying the value of `crm-separator'. | 575 | changed by modifying the value of `crm-separator'. |
| 576 | 576 | ||
| 577 | Continguous strings of non-separator-characters are referred to as | 577 | Contiguous strings of non-separator-characters are referred to as |
| 578 | 'elements'. In the aforementioned example, the elements are: 'alice', | 578 | 'elements'. In the aforementioned example, the elements are: 'alice', |
| 579 | 'bob', and 'eve'. | 579 | 'bob', and 'eve'. |
| 580 | 580 | ||
| @@ -590,9 +590,8 @@ INHERIT-INPUT-METHOD." | |||
| 590 | (let ((minibuffer-completion-table (function crm-collection-fn)) | 590 | (let ((minibuffer-completion-table (function crm-collection-fn)) |
| 591 | (minibuffer-completion-predicate predicate) | 591 | (minibuffer-completion-predicate predicate) |
| 592 | ;; see completing_read in src/minibuf.c | 592 | ;; see completing_read in src/minibuf.c |
| 593 | (minibuffer-completion-confirm (if (eq require-match t) | 593 | (minibuffer-completion-confirm |
| 594 | nil | 594 | (unless (eq require-match t) require-match)) |
| 595 | t)) | ||
| 596 | (crm-completion-table table) | 595 | (crm-completion-table table) |
| 597 | crm-last-exact-completion | 596 | crm-last-exact-completion |
| 598 | crm-current-element | 597 | crm-current-element |
| @@ -600,30 +599,27 @@ INHERIT-INPUT-METHOD." | |||
| 600 | crm-right-of-element | 599 | crm-right-of-element |
| 601 | crm-beginning-of-element | 600 | crm-beginning-of-element |
| 602 | crm-end-of-element | 601 | crm-end-of-element |
| 603 | map) | 602 | (map (if require-match |
| 604 | (if require-match | 603 | crm-local-must-match-map |
| 605 | ;; use `crm-local-must-match-map' | 604 | crm-local-completion-map))) |
| 606 | (setq map crm-local-must-match-map) | ||
| 607 | ;; use `minibuffer-local-completion-map' | ||
| 608 | (setq map minibuffer-local-completion-map)) | ||
| 609 | (split-string (read-from-minibuffer | 605 | (split-string (read-from-minibuffer |
| 610 | prompt initial-input map | 606 | prompt initial-input map |
| 611 | nil hist def inherit-input-method) | 607 | nil hist def inherit-input-method) |
| 612 | crm-separator))) | 608 | crm-separator))) |
| 613 | 609 | ||
| 614 | ;; testing and debugging | 610 | ;; testing and debugging |
| 615 | ;;; (defun crm-init-test-environ () | 611 | ;; (defun crm-init-test-environ () |
| 616 | ;;; "Set up some variables for testing." | 612 | ;; "Set up some variables for testing." |
| 617 | ;;; (interactive) | 613 | ;; (interactive) |
| 618 | ;;; (setq my-prompt "Prompt: ") | 614 | ;; (setq my-prompt "Prompt: ") |
| 619 | ;;; (setq my-table | 615 | ;; (setq my-table |
| 620 | ;;; '(("hi") ("there") ("man") ("may") ("mouth") ("ma") | 616 | ;; '(("hi") ("there") ("man") ("may") ("mouth") ("ma") |
| 621 | ;;; ("a") ("ab") ("abc") ("abd") ("abf") ("zab") ("acb") | 617 | ;; ("a") ("ab") ("abc") ("abd") ("abf") ("zab") ("acb") |
| 622 | ;;; ("da") ("dab") ("dabc") ("dabd") ("dabf") ("dzab") ("dacb") | 618 | ;; ("da") ("dab") ("dabc") ("dabd") ("dabf") ("dzab") ("dacb") |
| 623 | ;;; ("fda") ("fdab") ("fdabc") ("fdabd") ("fdabf") ("fdzab") ("fdacb") | 619 | ;; ("fda") ("fdab") ("fdabc") ("fdabd") ("fdabf") ("fdzab") ("fdacb") |
| 624 | ;;; ("gda") ("gdab") ("gdabc") ("gdabd") ("gdabf") ("gdzab") ("gdacb") | 620 | ;; ("gda") ("gdab") ("gdabc") ("gdabd") ("gdabf") ("gdzab") ("gdacb") |
| 625 | ;;; )) | 621 | ;; )) |
| 626 | ;;; (setq my-separator ",")) | 622 | ;; (setq my-separator ",")) |
| 627 | 623 | ||
| 628 | ;(completing-read-multiple my-prompt my-table) | 624 | ;(completing-read-multiple my-prompt my-table) |
| 629 | ;(completing-read-multiple my-prompt my-table nil t) | 625 | ;(completing-read-multiple my-prompt my-table nil t) |