emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100693: * lisp/faces.el (read-face-n


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100693: * lisp/faces.el (read-face-name): Rename arg `string-describing-default'
Date: Sat, 03 Jul 2010 01:28:52 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100693
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sat 2010-07-03 01:28:52 +0300
message:
  * lisp/faces.el (read-face-name): Rename arg `string-describing-default'
  to `default'.  Doc fix.  Display the default value in quotes
  in the prompt.  With empty input, return the `default' arg,
  unless the default value is a string (in which case return nil).
  (describe-face): Replace the string `default' arg of `read-face-name'
  with the symbol `default'.
  http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg01109.html
modified:
  lisp/ChangeLog
  lisp/faces.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-07-02 14:09:36 +0000
+++ b/lisp/ChangeLog    2010-07-02 22:28:52 +0000
@@ -1,3 +1,12 @@
+2010-07-02  Juri Linkov  <address@hidden>
+
+       * faces.el (read-face-name): Rename arg `string-describing-default'
+       to `default'.  Doc fix.  Display the default value in quotes
+       in the prompt.  With empty input, return the `default' arg,
+       unless the default value is a string (in which case return nil).
+       (describe-face): Replace the string `default' arg of `read-face-name'
+       with the symbol `default'.
+
 2010-07-02  Chong Yidong  <address@hidden>
 
        * emulation/viper-cmd.el (viper-delete-backward-char)

=== modified file 'lisp/faces.el'
--- a/lisp/faces.el     2010-07-01 00:14:17 +0000
+++ b/lisp/faces.el     2010-07-02 22:28:52 +0000
@@ -915,13 +915,14 @@
 ;;; Interactively modifying faces.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defun read-face-name (prompt &optional string-describing-default multiple)
+(defun read-face-name (prompt &optional default multiple)
   "Read a face, defaulting to the face or faces on the char after point.
 If it has the property `read-face-name', that overrides the `face' property.
 PROMPT should be a string that describes what the caller will do with the face;
 it should not end in a space.
-STRING-DESCRIBING-DEFAULT should describe what default the caller will use if
-the user just types RET; you can omit it.
+The optional argument DEFAULT provides the value to display in the
+minibuffer prompt that is returned if the user just types RET
+unless DEFAULT is a string (in which case nil is returned).
 If MULTIPLE is non-nil, return a list of faces (possibly only one).
 Otherwise, return a single face."
   (let ((faceprop (or (get-char-property (point) 'read-face-name)
@@ -960,10 +961,10 @@
     (let* ((input
            ;; Read the input.
            (completing-read-multiple
-            (if (or faces string-describing-default)
-                (format "%s (default %s): " prompt
+            (if (or faces default)
+                (format "%s (default `%s'): " prompt
                         (if faces (mapconcat 'symbol-name faces ",")
-                          string-describing-default))
+                          default))
               (format "%s: " prompt))
             (completion-table-in-turn nonaliasfaces aliasfaces)
             nil t nil 'face-name-history
@@ -971,7 +972,7 @@
           ;; Canonicalize the output.
           (output
            (cond ((or (equal input "") (equal input '("")))
-                  faces)
+                  (or faces (unless (stringp default) default)))
                  ((stringp input)
                   (mapcar 'intern (split-string input ", *" t)))
                  ((listp input)
@@ -1334,7 +1335,7 @@
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (interactive (list (read-face-name "Describe face" "= `default' face" t)))
+  (interactive (list (read-face-name "Describe face" 'default t)))
   (let* ((attrs '((:family . "Family")
                  (:foundry . "Foundry")
                  (:width . "Width")


reply via email to

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