comparison lisp/cus-edit.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 bbe4146603db
comparison
equal deleted inserted replaced
5665:8593e614573a 5666:daf5accfe973
876 (list (list faces))) 876 (list (list faces)))
877 ((listp faces) 877 ((listp faces)
878 ;; Make a choice only amongst the faces under point: 878 ;; Make a choice only amongst the faces under point:
879 (let ((choice (completing-read 879 (let ((choice (completing-read
880 "Customize face: (default all faces at point) " 880 "Customize face: (default all faces at point) "
881 (mapcar (lambda (face) 881 faces nil t)))
882 (list (symbol-name face) face))
883 faces)
884 nil t)))
885 (if (eql (length choice) 0) 882 (if (eql (length choice) 0)
886 (list faces) 883 (list faces)
887 (list (intern choice))))))))) 884 (list (intern choice)))))))))
888 885
889 (defun customize-face-1 (face custom-buffer-create-fn) 886 (defun customize-face-1 (face custom-buffer-create-fn)
2970 (defvar face-history nil 2967 (defvar face-history nil
2971 "History of entered face names.") 2968 "History of entered face names.")
2972 2969
2973 (defun widget-face-action (widget &optional event) 2970 (defun widget-face-action (widget &optional event)
2974 "Prompt for a face." 2971 "Prompt for a face."
2975 (let ((answer (completing-read "Face: " 2972 (let ((answer (completing-read "Face: " (face-list) nil nil nil
2976 (mapcar (lambda (face) 2973 'face-history)))
2977 (list (symbol-name face)))
2978 (face-list))
2979 nil nil nil
2980 'face-history)))
2981 (unless (eql (length answer) 0) 2974 (unless (eql (length answer) 0)
2982 (widget-value-set widget (intern answer)) 2975 (widget-value-set widget (intern answer))
2983 (widget-apply widget :notify widget event) 2976 (widget-apply widget :notify widget event)
2984 (widget-setup)))) 2977 (widget-setup))))
2985 2978