summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-05-10 04:00:51 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-05-10 04:00:51 +0000
commitca75c9a2687432e0bbf2c75eb05256554657a4ff (patch)
tree56da6dafc8cd43b42fec66d23fae8c12db3e10d2 /lisp/emacs-lisp
parentd3ee989e859e0a610527c18113edc1c51d77a429 (diff)
downloademacs-ca75c9a2687432e0bbf2c75eb05256554657a4ff.tar.gz
emacs-ca75c9a2687432e0bbf2c75eb05256554657a4ff.tar.bz2
emacs-ca75c9a2687432e0bbf2c75eb05256554657a4ff.zip
* emacs-lisp/crm.el (completing-read-multiple): Properly handle
return value of read-from-minibuffer for empty input.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/crm.el41
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 5a9787b5ca8..11d4d7fb2ba 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -592,25 +592,28 @@ The return value of this function is a list of the read strings.
See the documentation for `completing-read' for details on the arguments:
PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, and
INHERIT-INPUT-METHOD."
- (let ((minibuffer-completion-table (function crm-collection-fn))
- (minibuffer-completion-predicate predicate)
- ;; see completing_read in src/minibuf.c
- (minibuffer-completion-confirm
- (unless (eq require-match t) require-match))
- (crm-completion-table table)
- crm-last-exact-completion
- crm-current-element
- crm-left-of-element
- crm-right-of-element
- crm-beginning-of-element
- crm-end-of-element
- (map (if require-match
- crm-local-must-match-map
- crm-local-completion-map)))
- (split-string (read-from-minibuffer
- prompt initial-input map
- nil hist def inherit-input-method)
- crm-separator)))
+ (let* ((minibuffer-completion-table (function crm-collection-fn))
+ (minibuffer-completion-predicate predicate)
+ ;; see completing_read in src/minibuf.c
+ (minibuffer-completion-confirm
+ (unless (eq require-match t) require-match))
+ (crm-completion-table table)
+ crm-last-exact-completion
+ crm-current-element
+ crm-left-of-element
+ crm-right-of-element
+ crm-beginning-of-element
+ crm-end-of-element
+ (map (if require-match
+ crm-local-must-match-map
+ crm-local-completion-map))
+ ;; If the user enters empty input, read-from-minibuffer returns
+ ;; the empty string, not DEF.
+ (input (read-from-minibuffer
+ prompt initial-input map
+ nil hist def inherit-input-method)))
+ (and def (string-equal input "") (setq input def))
+ (split-string input crm-separator)))
;; testing and debugging
;; (defun crm-init-test-environ ()