From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: custom-link vs custom-button face Date: Sun, 22 Jan 2006 02:54:07 +0200 Organization: JURTA Message-ID: <87psml4afr.fsf@jurta.org> References: <43BE3EF8.4090406@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137894205 1442 80.91.229.2 (22 Jan 2006 01:43:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2006 01:43:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 22 02:43:24 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F0UGI-0001u6-Nr for ged-emacs-devel@m.gmane.org; Sun, 22 Jan 2006 02:43:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0UIr-0004iI-KP for ged-emacs-devel@m.gmane.org; Sat, 21 Jan 2006 20:46:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F0UGg-0002NN-5n for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F0UGe-0002Lz-KE for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0UGd-0002LP-Sg for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:43:44 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1F0UL7-00058J-4x for emacs-devel@gnu.org; Sat, 21 Jan 2006 20:48:21 -0500 Original-Received: from mail.neti.ee (80-235-32-6-dsl.mus.estpak.ee [80.235.32.6]) by Relayhost1.neti.ee (Postfix) with ESMTP id D58CA16D0; Sun, 22 Jan 2006 03:41:01 +0200 (EET) Original-To: martin rudalics In-Reply-To: <43BE3EF8.4090406@gmx.at> (martin rudalics's message of "Fri, 06 Jan 2006 10:57:12 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49371 Archived-At: > When "See also ..." and "Parent documentation" links don't reference a > manual they are displayed with `custom-button' instead of `custom-link' > face. The tiny patch below should fix that. There are more places where links leading to other customization buffers are displayed as buttons: custom-browse-group-tag, custom-browse-variable-tag, custom-browse-face-tag. The patch below changes their parent widget from `push-button' to `custom-group-link', and adds corresponding `button-face' and `mouse-face' to the widget `custom-group-link'. This makes unnecessary explicit adding of `button-face' and `mouse-face' to every instance of the `custom-group-link' widget. Also there is a special customization widget for info links, so the patch replaces `info-link' with `custom-manual' which makes unnecessary adding of `button-face' and `mouse-face' as well. I also noticed that a new face `custom-link' was recently added to cus-edit.el. Currently it is a copy of `info-xref' and it even retains its docstring and the group name `:group 'info'. This is wrong. I've added a new face `link' to share for `custom-link', `info-xref', and perhaps more faces could inherit from it. Also the face `custom-button-unraised' uses the copy of `info-xref'. But instead of inheriting from the new face `link', I think it's better to use underline to distinguish unraised buttons from links. The following patch also removes square brackets from links even in customization buffers with unraised buttons, because the link face makes square brackets unnecessary for links. Index: lisp/cus-edit.el =================================================================== RCS file: /sources/emacs/emacs/lisp/cus-edit.el,v retrieving revision 1.279 diff -c -r1.279 cus-edit.el *** lisp/cus-edit.el 19 Jan 2006 23:26:04 -0000 1.279 --- lisp/cus-edit.el 22 Jan 2006 00:47:55 -0000 *************** *** 1470,1487 **** (if custom-raised-buttons "`Raised' text indicates" "Square brackets indicate"))) ! (widget-create 'info-link :tag "Custom file" - :button-face 'custom-link - :mouse-face 'highlight "(emacs)Saving Customizations") (widget-insert " for information on how to save in a different file.\n See ") ! (widget-create 'info-link :tag "Help" - :button-face 'custom-link - :mouse-face 'highlight :help-echo "Read the online help." "(emacs)Easy Customization") (widget-insert " for more information.\n\n") --- 1470,1483 ---- (if custom-raised-buttons "`Raised' text indicates" "Square brackets indicate"))) ! (widget-create 'custom-manual :tag "Custom file" "(emacs)Saving Customizations") (widget-insert " for information on how to save in a different file.\n See ") ! (widget-create 'custom-manual :tag "Help" :help-echo "Read the online help." "(emacs)Easy Customization") (widget-insert " for more information.\n\n") *************** *** 1497,1506 **** (if (not custom-buffer-verbose-help) (progn (widget-insert " ") ! (widget-create 'info-link :tag "Help" - :button-face 'custom-link - :mouse-face 'highlight :help-echo "Read the online help." "(emacs)Easy Customization"))) (when (or custom-file user-init-file) --- 1493,1500 ---- (if (not custom-buffer-verbose-help) (progn (widget-insert " ") ! (widget-create 'custom-manual :tag "Help" :help-echo "Read the online help." "(emacs)Easy Customization"))) (when (or custom-file user-init-file) *************** *** 1648,1654 **** (let ((custom-buffer-style 'tree)) (custom-toggle-parent widget))) ! (define-widget 'custom-browse-group-tag 'push-button "Show parent in other window when activated." :tag "Group" :tag-glyph "folder" --- 1642,1648 ---- (let ((custom-buffer-style 'tree)) (custom-toggle-parent widget))) ! (define-widget 'custom-browse-group-tag 'custom-group-link "Show parent in other window when activated." :tag "Group" :tag-glyph "folder" *************** *** 1658,1664 **** (let ((parent (widget-get widget :parent))) (customize-group-other-window (widget-value parent)))) ! (define-widget 'custom-browse-variable-tag 'push-button "Show parent in other window when activated." :tag "Option" :tag-glyph "option" --- 1652,1658 ---- (let ((parent (widget-get widget :parent))) (customize-group-other-window (widget-value parent)))) ! (define-widget 'custom-browse-variable-tag 'custom-group-link "Show parent in other window when activated." :tag "Option" :tag-glyph "option" *************** *** 1668,1674 **** (let ((parent (widget-get widget :parent))) (customize-variable-other-window (widget-value parent)))) ! (define-widget 'custom-browse-face-tag 'push-button "Show parent in other window when activated." :tag "Face" :tag-glyph "face" --- 1662,1668 ---- (let ((parent (widget-get widget :parent))) (customize-variable-other-window (widget-value parent)))) ! (define-widget 'custom-browse-face-tag 'custom-group-link "Show parent in other window when activated." :tag "Face" :tag-glyph "face" *************** *** 2010,2022 **** :group 'custom-faces) (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) --- 2004,2010 ---- :group 'custom-faces) (defface custom-button-unraised ! '((t :inherit underline)) "Face for custom buffer buttons if `custom-raised-buttons' is nil." :version "22.1" :group 'custom-faces) *************** *** 2071,2085 **** (put 'custom-state-face 'face-alias 'custom-state) (defface custom-link ! '((((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 Info links in customization buffers." ! :group 'info) (define-widget 'custom 'default "Customize a user option." --- 2059,2068 ---- (put 'custom-state-face 'face-alias 'custom-state) (defface custom-link ! '((t :inherit link)) ! "Face for links in customization buffers." ! :version "22.1" ! :group 'custom-faces) (define-widget 'custom 'default "Customize a user option." *************** *** 2246,2253 **** (insert " ") (push (widget-create-child-and-convert widget 'custom-group-link - :button-face 'custom-link - :mouse-face 'highlight :tag (custom-unlispify-tag-name symbol) symbol) buttons) --- 2229,2234 ---- *************** *** 3607,3612 **** --- 3588,3595 ---- (define-widget 'custom-group-link 'link "Show parent in other window when activated." + :button-face 'custom-link + :mouse-face 'highlight :help-echo "Create customization buffer for this group." :action 'custom-group-link-action) *************** *** 3805,3812 **** (if (eq custom-buffer-style 'links) (push (widget-create-child-and-convert widget 'custom-group-link - :button-face 'custom-link - :mouse-face 'highlight :tag "Go to Group" symbol) buttons) --- 3789,3794 ---- *************** *** 4459,4467 **** ;; may not be optimal. (when custom-raised-buttons (set (make-local-variable 'widget-push-button-prefix) "") ! (set (make-local-variable 'widget-push-button-suffix) "") ! (set (make-local-variable 'widget-link-prefix) "") ! (set (make-local-variable 'widget-link-suffix) "")) (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t) (run-mode-hooks 'custom-mode-hook)) --- 4451,4459 ---- ;; may not be optimal. (when custom-raised-buttons (set (make-local-variable 'widget-push-button-prefix) "") ! (set (make-local-variable 'widget-push-button-suffix) "")) ! (set (make-local-variable 'widget-link-prefix) "") ! (set (make-local-variable 'widget-link-suffix) "") (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t) (run-mode-hooks 'custom-mode-hook)) Index: lisp/faces.el =================================================================== RCS file: /sources/emacs/emacs/lisp/faces.el,v retrieving revision 1.346 diff -c -r1.346 faces.el *** lisp/faces.el 16 Jan 2006 23:45:34 -0000 1.346 --- lisp/faces.el 22 Jan 2006 00:44:55 -0000 *************** *** 1917,1922 **** --- 1917,1944 ---- :group 'basic-faces :version "22.1") + (defface link + '((((class color) (min-colors 88) (background light)) + :foreground "blue1" :underline t) + (((class color) (background light)) + :foreground "blue" :underline t) + (((class color) (min-colors 88) (background dark)) + :foreground "cyan1" :underline t) + (((class color) (background dark)) + :foreground "cyan" :underline t) + (t :inherit underline)) + "Basic face for unvisited links." + :group 'basic-faces + :version "22.1") + + (defface link-visited + '((default :inherit link) + (((class color) (background light)) :foreground "magenta4") + (((class color) (background dark)) :foreground "violet")) + "Basic face for visited links." + :group 'basic-faces + :version "22.1") + (defface highlight '((((class color) (min-colors 88) (background light)) :background "darkseagreen2") Index: lisp/info.el =================================================================== RCS file: /sources/emacs/emacs/lisp/info.el,v retrieving revision 1.472 diff -c -r1.472 info.el *** lisp/info.el 17 Jan 2006 02:07:44 -0000 1.472 --- lisp/info.el 22 Jan 2006 00:44:57 -0000 *************** *** 129,148 **** (put 'info-menu-5 'face-alias 'info-menu-star) (defface info-xref ! '((((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 Info cross-references." :group 'info) (defface info-xref-visited ! '((default :inherit info-xref) ! (((class color) (background light)) :foreground "magenta4") ! (((class color) (background dark)) :foreground "violet")) "Face for visited Info cross-references." :group 'info) --- 129,140 ---- (put 'info-menu-5 'face-alias 'info-menu-star) (defface info-xref ! '((t :inherit link)) ! "Face for unvisited Info cross-references." :group 'info) (defface info-xref-visited ! '((t :inherit link-visited)) "Face for visited Info cross-references." :group 'info) -- Juri Linkov http://www.jurta.org/emacs/