summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-11-01 06:23:08 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-11-01 06:23:08 +0000
commitcd0cf71c4f41023a8d9c20b3a26e44b980992b5a (patch)
treeb763cfec551254e2228335be4e218ed7a9a19109 /lisp/cus-edit.el
parentc40bb1ba81a5df164f0b9b61e3480c55808717b7 (diff)
parent895725e10c0fb68ed21abb48183cc8843bcaadf3 (diff)
downloademacs-cd0cf71c4f41023a8d9c20b3a26e44b980992b5a.tar.gz
emacs-cd0cf71c4f41023a8d9c20b3a26e44b980992b5a.tar.bz2
emacs-cd0cf71c4f41023a8d9c20b3a26e44b980992b5a.zip
Merged from miles@gnu.org--gnu-2005 (patch 142-148, 615-628)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-616 Add lisp/mh-e/.arch-inventory * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-617 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-618 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-619 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-620 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-621 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-622 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-623 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-624 Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-625 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-626 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-627 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-628 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-142 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-143 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-144 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-145 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-146 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-147 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-148 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-435
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el57
1 files changed, 50 insertions, 7 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 696fd66543a..40e26834c83 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1377,13 +1377,27 @@ This button will have a menu with all three reset operations."
(interactive)
(quit-window custom-buffer-done-kill))
+(defvar custom-button nil
+ "Face used for buttons in customization buffers.")
+
+(defvar custom-button-pressed nil
+ "Face used for pressed buttons in customization buffers.")
+
(defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box)
'(("unspecified" . unspecified))))
"If non-nil, indicate active buttons in a `raised-button' style.
Otherwise use brackets."
:type 'boolean
:version "21.1"
- :group 'custom-buffer)
+ :group 'custom-buffer
+ :set (lambda (variable value)
+ (custom-set-default variable value)
+ (setq custom-button
+ (if value 'custom-button 'custom-button-unraised))
+ (setq custom-button-pressed
+ (if value
+ 'custom-button-pressed
+ 'custom-button-pressed-unraised))))
(defun custom-buffer-create-internal (options &optional description)
(custom-mode)
@@ -1896,24 +1910,52 @@ and `face'."
:background "lightgrey" :foreground "black"))
(t
nil))
- "Face used for buttons in customization buffers."
+ "Face for custom buffer buttons if `custom-raised-buttons' is non-nil."
:version "21.1"
:group 'custom-faces)
;; backward-compatibility alias
(put 'custom-button-face 'face-alias 'custom-button)
+(defface custom-button-unraised
+ '((((min-colors 88)
+ (class color) (background light)) :foreground "blue1" :underline t)
+ (((class color) (background light)) :foreground "blue" :underline t)
+ (((min-colors 88)
+ (class color) (background dark)) :foreground "cyan1" :underline t)
+ (((class color) (background dark)) :foreground "cyan" :underline t)
+ (t :underline t))
+ "Face for custom buffer buttons if `custom-raised-buttons' is nil."
+ :version "22.1"
+ :group 'custom-faces)
+
+(setq custom-button
+ (if custom-raised-buttons 'custom-button 'custom-button-unraised))
+
(defface custom-button-pressed
'((((type x w32 mac) (class color))
(:box (:line-width 2 :style pressed-button)
:background "lightgrey" :foreground "black"))
(t
(:inverse-video t)))
- "Face used for buttons in customization buffers."
+ "Face for pressed custom buttons if `custom-raised-buttons' is non-nil."
:version "21.1"
:group 'custom-faces)
;; backward-compatibility alias
(put 'custom-button-pressed-face 'face-alias 'custom-button-pressed)
+(defface custom-button-pressed-unraised
+ '((default :inherit custom-button-unraised)
+ (((class color) (background light)) :foreground "magenta4")
+ (((class color) (background dark)) :foreground "violet"))
+ "Face for pressed custom buttons if `custom-raised-buttons' is nil."
+ :version "22.1"
+ :group 'custom-faces)
+
+(setq custom-button-pressed
+ (if custom-raised-buttons
+ 'custom-button-pressed
+ 'custom-button-pressed-unraised))
+
(defface custom-documentation nil
"Face used for documentation strings in customization buffers."
:group 'custom-faces)
@@ -4311,10 +4353,11 @@ if that value is non-nil."
(make-local-variable 'widget-documentation-face)
(setq widget-documentation-face 'custom-documentation)
(make-local-variable 'widget-button-face)
- (setq widget-button-face 'custom-button)
- (set (make-local-variable 'widget-button-pressed-face) 'custom-button-pressed)
- (set (make-local-variable 'widget-mouse-face)
- 'custom-button-pressed) ; buttons `depress' when moused
+ (setq widget-button-face custom-button)
+ (set (make-local-variable 'widget-button-pressed-face) custom-button-pressed)
+ (if custom-raised-buttons
+ (set (make-local-variable 'widget-mouse-face) custom-button))
+
;; When possible, use relief for buttons, not bracketing. This test
;; may not be optimal.
(when custom-raised-buttons