comparison lisp/behavior.el @ 5666:daf5accfe973

Use #'test-completion, minibuf.el, instead of implementing same. lisp/ChangeLog addition: 2012-05-14 Aidan Kehoe <kehoea@parhasard.net> Update minibuf.el to use #'test-completion, use the generality of recent completion changes to avoid some unnecessary consing when reading. * behavior.el (read-behavior): * cus-edit.el (custom-face-prompt): * cus-edit.el (widget-face-action): * faces.el (read-face-name): * minibuf.el: * minibuf.el (minibuffer-completion-table): * minibuf.el (exact-minibuffer-completion-p): Removed. #'test-completion is equivalent to this, but more general. * minibuf.el (minibuffer-do-completion-1): Use #'test-completion. * minibuf.el (completing-read): Update the documentation of the arguments used for completion. * minibuf.el (minibuffer-complete-and-exit): Use #'test-completion. * minibuf.el (exit-minibuffer): Use #'test-completion. * minibuf.el (minibuffer-smart-mouse-tracker): Use #'test-completion. * minibuf.el (read-color): No need to construct a completion table separate from the colour list. src/ChangeLog addition: 2012-05-14 Aidan Kehoe <kehoea@parhasard.net> * minibuf.c (Ftest_completion): Correct some documentation here.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 14 May 2012 08:46:05 +0100
parents cc6f0266bc36
children 66d2f63df75f
comparison
equal deleted inserted replaced
5665:8593e614573a 5666:daf5accfe973
343 `behavior-history'.) 343 `behavior-history'.)
344 Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used 344 Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used
345 for history command, and as the value to return if the user enters the 345 for history command, and as the value to return if the user enters the
346 empty string." 346 empty string."
347 (let ((result 347 (let ((result
348 (completing-read 348 (completing-read prompt behavior-hash-table nil must-match
349 prompt 349 initial-contents (or history 'behavior-history)
350 (let (list) 350 default-value)))
351 (maphash #'(lambda (key value) 351 (if (stringp result)
352 (push (cons (symbol-name key) value) list))
353 behavior-hash-table)
354 list)
355 nil must-match initial-contents (or history 'behavior-history)
356 default-value)))
357 (if (and result (stringp result))
358 (intern result) 352 (intern result)
359 result))) 353 result)))
360 354
361 (defun behavior-enabled-p (behavior) 355 (defun behavior-enabled-p (behavior)
362 "Non-nil if BEHAVIOR (a symbol) if currently enabled." 356 "Non-nil if BEHAVIOR (a symbol) if currently enabled."