# HG changeset patch # User Chong Yidong # Date 1147233651 0 # Node ID 4ff0c9f3ea31b5112f0b55e143a2aca798f8dc77 # Parent e1a064810f6f31cd9c3f14cf11a46b282ce7a8c9 * emacs-lisp/crm.el (completing-read-multiple): Properly handle return value of read-from-minibuffer for empty input. diff -r e1a064810f6f -r 4ff0c9f3ea31 lisp/ChangeLog --- a/lisp/ChangeLog Wed May 10 03:32:06 2006 +0000 +++ b/lisp/ChangeLog Wed May 10 04:00:51 2006 +0000 @@ -1,3 +1,8 @@ +2006-05-09 Chong Yidong + + * emacs-lisp/crm.el (completing-read-multiple): Properly handle + return value of read-from-minibuffer for empty input. + 2006-05-09 Miles Bader * comint.el (comint-insert-input): Remove redundant calls to setq diff -r e1a064810f6f -r 4ff0c9f3ea31 lisp/emacs-lisp/crm.el --- a/lisp/emacs-lisp/crm.el Wed May 10 03:32:06 2006 +0000 +++ b/lisp/emacs-lisp/crm.el Wed May 10 04:00:51 2006 +0000 @@ -592,25 +592,28 @@ 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 ()