aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-06-30 19:35:59 +0000
committerJuri Linkov2008-06-30 19:35:59 +0000
commit2aef0850e72139f56c925971ef539dceec6646be (patch)
tree2fab59da5b84fe3fba3673ccc89fa01bd1929370
parentbe4927704b150b9a10cc14ccd09db059e265dc1b (diff)
downloademacs-2aef0850e72139f56c925971ef539dceec6646be.tar.gz
emacs-2aef0850e72139f56c925971ef539dceec6646be.zip
(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.
-rw-r--r--lisp/faces.el16
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 @@
31(declare-function xw-defined-colors "term/x-win" (&optional frame)) 31(declare-function xw-defined-colors "term/x-win" (&optional frame))
32 32
33(defvar help-xref-stack-item) 33(defvar help-xref-stack-item)
34
35(defvar face-name-history nil
36 "History list for some commands that read face names.
37Maximum length of the history list is determined by the value
38of `history-length', which see.")
39
34 40
35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36;;; Font selection. 42;;; Font selection.
@@ -123,7 +129,8 @@ NO-INIT-FROM-RESOURCES non-nil means don't initialize frame-local
123variants of FACE from X resources. (X resources recognized are found 129variants of FACE from X resources. (X resources recognized are found
124in the global variable `face-x-resources'.) If FACE is already known 130in the global variable `face-x-resources'.) If FACE is already known
125as a face, leave it unmodified. Value is FACE." 131as a face, leave it unmodified. Value is FACE."
126 (interactive "SMake face: ") 132 (interactive (list (read-from-minibuffer
133 "Make face: " nil nil t 'face-name-history)))
127 (unless (facep face) 134 (unless (facep face)
128 ;; Make frame-local faces (this also makes the global one). 135 ;; Make frame-local faces (this also makes the global one).
129 (dolist (frame (frame-list)) 136 (dolist (frame (frame-list))
@@ -140,7 +147,8 @@ as a face, leave it unmodified. Value is FACE."
140(defun make-empty-face (face) 147(defun make-empty-face (face)
141 "Define a new, empty face with name FACE. 148 "Define a new, empty face with name FACE.
142If the face already exists, it is left unmodified. Value is FACE." 149If the face already exists, it is left unmodified. Value is FACE."
143 (interactive "SMake empty face: ") 150 (interactive (list (read-from-minibuffer
151 "Make empty face: " nil nil t 'face-name-history)))
144 (make-face face 'no-init-from-resources)) 152 (make-face face 'no-init-from-resources))
145 153
146 154
@@ -940,7 +948,7 @@ Otherwise, return a single face."
940 string-describing-default)) 948 string-describing-default))
941 (format "%s: " prompt)) 949 (format "%s: " prompt))
942 (completion-table-in-turn nonaliasfaces aliasfaces) 950 (completion-table-in-turn nonaliasfaces aliasfaces)
943 nil t nil nil 951 nil t nil 'face-name-history
944 (if faces (mapconcat 'symbol-name faces ",")))) 952 (if faces (mapconcat 'symbol-name faces ","))))
945 ;; Canonicalize the output. 953 ;; Canonicalize the output.
946 (output 954 (output
@@ -1227,7 +1235,7 @@ If REGEXP is non-nil, list only those faces with names matching
1227this regular expression. When called interactively with a prefix 1235this regular expression. When called interactively with a prefix
1228arg, prompt for a regular expression." 1236arg, prompt for a regular expression."
1229 (interactive (list (and current-prefix-arg 1237 (interactive (list (and current-prefix-arg
1230 (read-string "List faces matching regexp: ")))) 1238 (read-regexp "List faces matching regexp"))))
1231 (let ((all-faces (zerop (length regexp))) 1239 (let ((all-faces (zerop (length regexp)))
1232 (frame (selected-frame)) 1240 (frame (selected-frame))
1233 (max-length 0) 1241 (max-length 0)