emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yanking isearch to highlight-regexp


From: Juri Linkov
Subject: Re: Yanking isearch to highlight-regexp
Date: Sun, 29 Jun 2008 23:55:55 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

>> However, I think it is inconvenient when face names are mixed with other
>> input in the default history list `minibuffer-history'.  We could create
>> a new history list `face-name-history' specially for face names entered
>> in the face-reading commands.
>
> That sounds cleaner, indeed.

The following patch creates a new variable `face-name-history' and
adds it to face-reading commands (most important is `read-face-name'
that is used by many other commands).

Index: lisp/faces.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/faces.el,v
retrieving revision 1.416
diff -c -r1.416 faces.el
*** lisp/faces.el       28 Jun 2008 15:53:07 -0000      1.416
--- lisp/faces.el       29 Jun 2008 20:55:34 -0000
***************
*** 31,36 ****
--- 31,42 ----
  (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,129 ****
  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: ")
    (unless (facep face)
      ;; Make frame-local faces (this also makes the global one).
      (dolist (frame (frame-list))
--- 129,136 ----
  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 (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,146 ****
  (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: ")
    (make-face face 'no-init-from-resources))
  
  
--- 147,154 ----
  (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 (list (read-from-minibuffer
!                     "Make empty face: " nil nil t 'face-name-history)))
    (make-face face 'no-init-from-resources))
  
  
***************
*** 940,946 ****
                           string-describing-default))
               (format "%s: " prompt))
             (completion-table-in-turn nonaliasfaces aliasfaces)
!            nil t nil nil
             (if faces (mapconcat 'symbol-name faces ","))))
           ;; Canonicalize the output.
           (output
--- 948,954 ----
                           string-describing-default))
               (format "%s: " prompt))
             (completion-table-in-turn nonaliasfaces aliasfaces)
!            nil t nil 'face-name-history
             (if faces (mapconcat 'symbol-name faces ","))))
           ;; Canonicalize the output.
           (output
***************
*** 1227,1233 ****
  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: "))))
    (let ((all-faces (zerop (length regexp)))
        (frame (selected-frame))
        (max-length 0)
--- 1235,1241 ----
  this regular expression.  When called interactively with a prefix
  arg, prompt for a regular expression."
    (interactive (list (and current-prefix-arg
!                           (read-regexp "List faces matching regexp"))))
    (let ((all-faces (zerop (length regexp)))
        (frame (selected-frame))
        (max-length 0)

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]