(wl-completing-read-multiple-2): Ditto.
(wl-completing-read-multiple): Define use above functions.
* wl-summary.el (wl-summary-sort): Removed the workaround for a
bug of `completing-read-multiple' about default value.
* wl-xmas.el (wl-completing-read-multiple): Removed.
* wl-mule.el (wl-completing-read-multiple): Ditto.
* wl-e21.el (wl-completing-read-multiple): Ditto.
+2005-12-11 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl-util.el (wl-completing-read-multiple-1): New internal function.
+ (wl-completing-read-multiple-2): Ditto.
+ (wl-completing-read-multiple): Define use above functions.
+
+ * wl-summary.el (wl-summary-sort): Removed the workaround for a
+ bug of `completing-read-multiple' about default value.
+
+ * wl-xmas.el (wl-completing-read-multiple): Removed.
+
+ * wl-mule.el (wl-completing-read-multiple): Ditto.
+
+ * wl-e21.el (wl-completing-read-multiple): Ditto.
+
2005-12-10 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* wl-util.el (wl-filter-associations): New function.
(let ((event (read-event)))
(cons (and (numberp event) event) event)))
-(defalias 'wl-completing-read-multiple 'completing-read-multiple)
-
(put 'wl-modeline-biff-state-on 'risky-local-variable t)
(put 'wl-modeline-biff-state-off 'risky-local-variable t)
(put 'wl-modeline-plug-state-on 'risky-local-variable t)
(let ((event (read-event)))
(cons (and (numberp event) event) event)))
-(defun wl-completing-read-multiple (prompt
- table
- &optional predicate
- require-match initial-input)
- "Read multiple strings in the minibuffer"
- (split-string (completing-read prompt table predicate require-match
- initial-input) ","))
-
(require 'product)
(product-provide (provide 'wl-mule) (require 'wl-version))
(defun wl-summary-sort (reverse)
"Sort summary lines into the selected order; argument means descending order."
(interactive "P")
- (let ((spec (wl-completing-read-multiple
- (format "%s by (%s): "
- (if reverse "Reverse sort" "Sort")
- (symbol-name wl-summary-default-sort-spec))
- (nconc
- (mapcar (lambda (spec) (list (symbol-name spec)))
- wl-summary-sort-specs)
- (mapcar (lambda (spec) (list (concat "!" (symbol-name spec))))
- wl-summary-sort-specs))
- nil t)))
+ (let ((default-value (symbol-name wl-summary-default-sort-spec)))
(wl-summary-rescan
- (if (equal spec '("")) (symbol-name wl-summary-default-sort-spec) spec)
+ (wl-completing-read-multiple
+ (format "%s by (%s): " (if reverse "Reverse sort" "Sort") default-value)
+ (nconc
+ (mapcar (lambda (spec) (list (symbol-name spec)))
+ wl-summary-sort-specs)
+ (mapcar (lambda (spec) (list (concat "!" (symbol-name spec))))
+ wl-summary-sort-specs))
+ nil t nil nil
+ default-value)
reverse)))
(defun wl-summary-get-available-flags (&optional include-specials)
(setq value (prin1-to-string value)))
(concat (downcase field) ":" value)))))
+
+;; read multiple strings with completion
+(defun wl-completing-read-multiple-1 (prompt
+ table
+ &optional predicate
+ require-match initial-input
+ hist def inherit-input-method)
+ "Read multiple strings in the minibuffer"
+ (split-string
+ (completing-read prompt table predicate nil
+ initial-input hist def inherit-input-method)
+ ","))
+
+(static-when (fboundp 'completing-read-multiple)
+ (eval-when-compile
+ (require 'crm))
+ (defun wl-completing-read-multiple-2 (prompt
+ table
+ &optional predicate
+ require-match initial-input
+ hist def inherit-input-method)
+ "Read multiple strings in the minibuffer"
+ (let ((ret (completing-read-multiple prompt table predicate
+ require-match initial-input
+ hist def inherit-input-method)))
+ (if (and def (equal ret '("")))
+ (split-string def crm-separator)
+ ret))))
+
+(static-cond
+ ((not (fboundp 'completing-read-multiple))
+ (defalias 'wl-completing-read-multiple 'wl-completing-read-multiple-1))
+ ((< emacs-major-version 22)
+ (defun wl-completing-read-multiple (prompt
+ table
+ &optional predicate
+ require-match initial-input
+ hist def inherit-input-method)
+ "Read multiple strings in the minibuffer"
+ (if require-match
+ (wl-completing-read-multiple-1 prompt table predicate
+ nil initial-input
+ hist def inherit-input-method)
+ (wl-completing-read-multiple-2 prompt table predicate
+ nil initial-input
+ hist def inherit-input-method))))
+ (t
+ (defalias 'wl-completing-read-multiple 'wl-completing-read-multiple-2)))
+
+
(require 'product)
(product-provide (provide 'wl-util) (require 'wl-version))
(event-to-character event))
event)))
-(defun wl-completing-read-multiple (prompt
- table
- &optional predicate
- require-match initial-input)
- "Read multiple strings in the minibuffer"
- (split-string (completing-read prompt table predicate require-match
- initial-input) ","))
-
(require 'product)
(product-provide (provide 'wl-xmas) (require 'wl-version))