diff options
author | Juri Linkov <juri@jurta.org> | 2008-06-30 19:35:59 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2008-06-30 19:35:59 +0000 |
commit | c1d6bd77d77a40efce2dbf09f375005ab296c908 (patch) | |
tree | fa15aef82bf1f37525979c32e99cce50dddf2177 /lisp | |
parent | d3048bb05c48ed6337608205f65e9c3773d927a9 (diff) | |
download | emacs-c1d6bd77d77a40efce2dbf09f375005ab296c908.tar.gz |
(face-name-history): New variable.
(make-face, make-empty-face): Replace interactive spec "S"
with `read-from-minibuffer' where `read' arg is t and
`hist' arg is `face-name-history'.
(read-face-name): Set `hist' arg of `completing-read-multiple'
to `face-name-history'.
(list-faces-display): Use `read-regexp' instead of `read-string'
to read regexp.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/faces.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 60ec91019b2..02daaa82f85 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -31,6 +31,12 @@ (declare-function xw-defined-colors "term/x-win" (&optional frame)) (defvar help-xref-stack-item) + +(defvar face-name-history nil + "History list for some commands that read face names. +Maximum length of the history list is determined by the value +of `history-length', which see.") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Font selection. @@ -123,7 +129,8 @@ NO-INIT-FROM-RESOURCES non-nil means don't initialize frame-local variants of FACE from X resources. (X resources recognized are found in the global variable `face-x-resources'.) If FACE is already known as a face, leave it unmodified. Value is FACE." - (interactive "SMake face: ") + (interactive (list (read-from-minibuffer + "Make face: " nil nil t 'face-name-history))) (unless (facep face) ;; Make frame-local faces (this also makes the global one). (dolist (frame (frame-list)) @@ -140,7 +147,8 @@ as a face, leave it unmodified. Value is FACE." (defun make-empty-face (face) "Define a new, empty face with name FACE. If the face already exists, it is left unmodified. Value is FACE." - (interactive "SMake empty face: ") + (interactive (list (read-from-minibuffer + "Make empty face: " nil nil t 'face-name-history))) (make-face face 'no-init-from-resources)) @@ -940,7 +948,7 @@ Otherwise, return a single face." string-describing-default)) (format "%s: " prompt)) (completion-table-in-turn nonaliasfaces aliasfaces) - nil t nil nil + nil t nil 'face-name-history (if faces (mapconcat 'symbol-name faces ",")))) ;; Canonicalize the output. (output @@ -1227,7 +1235,7 @@ If REGEXP is non-nil, list only those faces with names matching this regular expression. When called interactively with a prefix arg, prompt for a regular expression." (interactive (list (and current-prefix-arg - (read-string "List faces matching regexp: ")))) + (read-regexp "List faces matching regexp")))) (let ((all-faces (zerop (length regexp))) (frame (selected-frame)) (max-length 0) |