[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108010: Use proper faces in apropos.
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108010: Use proper faces in apropos.el. |
Date: |
Mon, 23 Apr 2012 23:38:48 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 108010
fixes bug(s): http://debbugs.gnu.org/8396
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-04-23 23:38:48 +0800
message:
Use proper faces in apropos.el.
* lisp/apropos.el (apropos-symbol, apropos-keybinding, apropos-label)
(apropos-property, apropos-function-button)
(apropos-variable-button, apropos-misc-button): New faces.
(apropos-symbol-face, apropos-keybinding-face)
(apropos-label-face, apropos-property-face, apropos-match-face):
Variables removed.
(apropos-library-button, apropos-format-plist, apropos-print)
(apropos-print-doc, apropos-describe-plist): Callers changed.
modified:
etc/NEWS
lisp/ChangeLog
lisp/apropos.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-04-23 12:37:55 +0000
+++ b/etc/NEWS 2012-04-23 15:38:48 +0000
@@ -74,6 +74,15 @@
* Changes in Specialized Modes and Packages in Emacs 24.2
+** Apropos
+
+*** The faces used by Apropos are now directly customizable.
+These faces are named `apropos-symbol', `apropos-keybinding', and so on;
+see the `apropos' Custom group for details.
+
+**** The old options whose values specified faces to use were removed
+(i.e. `apropos-symbol-face', `apropos-keybinding-face', etc.).
+
** Customize
*** `custom-reset-button-menu' now defaults to t.
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-04-23 12:44:54 +0000
+++ b/lisp/ChangeLog 2012-04-23 15:38:48 +0000
@@ -9,6 +9,14 @@
* apropos.el (apropos-read-pattern): Make prompt less cryptic.
Fix word list splitting (Bug#11132).
+ (apropos-symbol, apropos-keybinding, apropos-label)
+ (apropos-property, apropos-function-button)
+ (apropos-variable-button, apropos-misc-button): New faces.
+ (apropos-symbol-face, apropos-keybinding-face)
+ (apropos-label-face, apropos-property-face, apropos-match-face):
+ Variables removed (Bug#8396).
+ (apropos-library-button, apropos-format-plist, apropos-print)
+ (apropos-print-doc, apropos-describe-plist): Callers changed.
2012-04-23 Michael Albinus <address@hidden>
=== modified file 'lisp/apropos.el'
--- a/lisp/apropos.el 2012-04-23 12:44:54 +0000
+++ b/lisp/apropos.el 2012-04-23 15:38:48 +0000
@@ -85,35 +85,48 @@
:group 'apropos
:type 'boolean)
-
-(defcustom apropos-symbol-face 'bold
- "Face for symbol name in Apropos output, or nil for none."
- :group 'apropos
- :type 'face)
-
-(defcustom apropos-keybinding-face 'underline
- "Face for lists of keybinding in Apropos output, or nil for none."
- :group 'apropos
- :type 'face)
-
-(defcustom apropos-label-face '(italic)
- "Face for label (`Command', `Variable' ...) in Apropos output.
-A value of nil means don't use any special font for them, and also
-turns off mouse highlighting."
- :group 'apropos
- :type 'face)
-
-(defcustom apropos-property-face 'bold-italic
+(defface apropos-symbol
+ '((t (:inherit bold)))
+ "Face for the symbol name in Apropos output."
+ :group 'apropos
+ :version "24.2")
+
+(defface apropos-keybinding
+ '((t (:inherit underline)))
+ "Face for lists of keybinding in Apropos output."
+ :group 'apropos
+ :version "24.2")
+
+(defface apropos-property
+ '((t (:inherit font-lock-builtin-face)))
"Face for property name in apropos output, or nil for none."
:group 'apropos
- :type 'face)
+ :version "24.2")
+
+(defface apropos-function-button
+ '((t (:inherit (font-lock-function-name-face button))))
+ "Button face indicating a function, macro, or command in Apropos."
+ :group 'apropos
+ :version "24.2")
+
+(defface apropos-variable-button
+ '((t (:inherit (font-lock-variable-name-face button))))
+ "Button face indicating a variable in Apropos."
+ :group 'apropos
+ :version "24.2")
+
+(defface apropos-misc-button
+ '((t (:inherit (font-lock-constant-face button))))
+ "Button face indicating a miscellaneous object type in Apropos."
+ :group 'apropos
+ :version "24.2")
(defcustom apropos-match-face 'match
"Face for matching text in Apropos documentation/value, or nil for none.
This applies when you look for matches in the documentation or variable value
for the pattern; the part that matches gets displayed in this font."
:group 'apropos
- :type 'face)
+ :version "24.2")
(defcustom apropos-sort-by-scores nil
"Non-nil means sort matches by scores; best match is shown first.
@@ -196,7 +209,7 @@
;;; Button types used by apropos
(define-button-type 'apropos-symbol
- 'face apropos-symbol-face
+ 'face 'apropos-symbol
'help-echo "mouse-2, RET: Display more help on this symbol"
'follow-link t
'action #'apropos-symbol-button-display-help)
@@ -210,7 +223,7 @@
(define-button-type 'apropos-function
'apropos-label "Function"
'apropos-short-label "f"
- 'face '(font-lock-function-name-face button)
+ 'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this function"
'follow-link t
'action (lambda (button)
@@ -219,7 +232,7 @@
(define-button-type 'apropos-macro
'apropos-label "Macro"
'apropos-short-label "m"
- 'face '(font-lock-function-name-face button)
+ 'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this macro"
'follow-link t
'action (lambda (button)
@@ -228,7 +241,7 @@
(define-button-type 'apropos-command
'apropos-label "Command"
'apropos-short-label "c"
- 'face '(font-lock-function-name-face button)
+ 'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this command"
'follow-link t
'action (lambda (button)
@@ -242,7 +255,7 @@
(define-button-type 'apropos-variable
'apropos-label "Variable"
'apropos-short-label "v"
- 'face '(font-lock-variable-name-face button)
+ 'face 'apropos-variable-button
'help-echo "mouse-2, RET: Display more help on this variable"
'follow-link t
'action (lambda (button)
@@ -260,7 +273,7 @@
(define-button-type 'apropos-group
'apropos-label "Group"
'apropos-short-label "g"
- 'face '(font-lock-builtin-face button)
+ 'face 'apropos-misc-button
'help-echo "mouse-2, RET: Display more help on this group"
'follow-link t
'action (lambda (button)
@@ -270,7 +283,7 @@
(define-button-type 'apropos-widget
'apropos-label "Widget"
'apropos-short-label "w"
- 'face '(font-lock-builtin-face button)
+ 'face 'apropos-misc-button
'help-echo "mouse-2, RET: Display more help on this widget"
'follow-link t
'action (lambda (button)
@@ -279,7 +292,7 @@
(define-button-type 'apropos-plist
'apropos-label "Properties"
'apropos-short-label "p"
- 'face '(font-lock-keyword-face button)
+ 'face 'apropos-misc-button
'help-echo "mouse-2, RET: Display more help on this plist"
'follow-link t
'action (lambda (button)
@@ -587,7 +600,7 @@
(let ((name (copy-sequence (symbol-name sym))))
(make-text-button name nil
'type 'apropos-library
- 'face apropos-symbol-face
+ 'face 'apropos-symbol
'apropos-symbol name)
name)))
@@ -837,9 +850,8 @@
(while pl
(setq p (format "%s %S" (car pl) (nth 1 pl)))
(if (or (not compare) (string-match apropos-regexp p))
- (if apropos-property-face
- (put-text-property 0 (length (symbol-name (car pl)))
- 'face apropos-property-face p))
+ (put-text-property 0 (length (symbol-name (car pl)))
+ 'face 'apropos-property p)
(setq p nil))
(if p
(progn
@@ -1031,10 +1043,7 @@
(insert-text-button (symbol-name symbol)
'type 'apropos-symbol
'skip apropos-multi-type
- ;; Can't use default, since user may have
- ;; changed the variable!
- ;; Just say `no' to variables containing faces!
- 'face apropos-symbol-face)
+ 'face 'apropos-symbol)
(if (and (eq apropos-sort-by-scores 'verbose)
(cadr apropos-item))
(insert " (" (number-to-string (cadr apropos-item)) ") "))
@@ -1072,18 +1081,16 @@
(setq key (condition-case ()
(key-description key)
(error)))
- (if apropos-keybinding-face
- (put-text-property 0 (length key)
- 'face apropos-keybinding-face
- key))
+ (put-text-property 0 (length key)
+ 'face 'apropos-keybinding
+ key)
key)
item ", "))
(insert "M-x ... RET")
- (when apropos-keybinding-face
- (put-text-property (- (point) 11) (- (point) 8)
- 'face apropos-keybinding-face)
- (put-text-property (- (point) 3) (point)
- 'face apropos-keybinding-face))))
+ (put-text-property (- (point) 11) (- (point) 8)
+ 'face 'apropos-keybinding)
+ (put-text-property (- (point) 3) (point)
+ 'face 'apropos-keybinding)))
(terpri))
(apropos-print-doc 2
(if (commandp symbol)
@@ -1128,9 +1135,6 @@
(format "<%s>" (button-type-get type 'apropos-short-label))
(button-type-get type 'apropos-label))
'type type
- ;; Can't use the default button face, since user may have changed
the
- ;; variable! Just say `no' to variables containing faces!
- 'face (append button-face apropos-label-face)
'apropos-symbol (car apropos-item))
(insert (if apropos-compact-layout " " ": ")))
@@ -1177,9 +1181,8 @@
(princ "Symbol ")
(prin1 symbol)
(princ "'s plist is\n (")
- (if apropos-symbol-face
- (put-text-property (+ (point-min) 7) (- (point) 14)
- 'face apropos-symbol-face))
+ (put-text-property (+ (point-min) 7) (- (point) 14)
+ 'face 'apropos-symbol)
(insert (apropos-format-plist symbol "\n "))
(princ ")")))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108010: Use proper faces in apropos.el.,
Chong Yidong <=