all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it
@ 2020-10-22 21:07 Drew Adams
  2020-10-27 10:32 ` Lars Ingebrigtsen
  2020-10-27 15:32 ` Mauro Aranda
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2020-10-22 21:07 UTC (permalink / raw)
  To: 44154

In Customize Face, if attribute Inherit is checked then be able to click
the name of an inherited face, to customize it, or at least to see its
attributes/definition.  

That is, have a link on it, which invokes either `customize-face' or
`describe-face' for it.

Without this, you can't directly see what the effective attributes are
for the inheriting face.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.18362
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it
  2020-10-22 21:07 bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it Drew Adams
@ 2020-10-27 10:32 ` Lars Ingebrigtsen
  2020-10-27 15:32 ` Mauro Aranda
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 10:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: 44154

Drew Adams <drew.adams@oracle.com> writes:

> In Customize Face, if attribute Inherit is checked then be able to click
> the name of an inherited face, to customize it, or at least to see its
> attributes/definition.  
>
> That is, have a link on it, which invokes either `customize-face' or
> `describe-face' for it.

Makes sense.  I've now added this to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it
  2020-10-22 21:07 bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it Drew Adams
  2020-10-27 10:32 ` Lars Ingebrigtsen
@ 2020-10-27 15:32 ` Mauro Aranda
  2020-10-27 17:35   ` bug#44154: (no subject) Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Mauro Aranda @ 2020-10-27 15:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44154


[-- Attachment #1.1: Type: text/plain, Size: 967 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Drew Adams <drew.adams@oracle.com> writes:
>
>> In Customize Face, if attribute Inherit is checked then be able to click
>> the name of an inherited face, to customize it, or at least to see its
>> attributes/definition.
>>
>> That is, have a link on it, which invokes either `customize-face' or
>> `describe-face' for it.
>
> Makes sense.  I've now added this to Emacs 28.

> +(defun cus--face-link (widget _format)
> +  (let ((face (intern (widget-get widget :value))))
> +    (widget-create-child-and-convert
> +     widget 'face-link
> +     :button-face 'link
> +     :tag "link"
> +     :action (lambda (&rest _x)
> +               (customize-face face)))))
> +

I think this could become confusing if one edits the value of the
inherited face, because the link always points to the widget's value at
creation time.

I suggest making the link always point to the widget's current value,
like in the attached patch.

[-- Attachment #1.2: Type: text/html, Size: 1303 bytes --]

[-- Attachment #2: 0001-Small-fix-to-the-new-link-for-inherited-faces-in-Cus.patch --]
[-- Type: text/x-patch, Size: 1250 bytes --]

From 29a38679b6b135b16ddb71128f1da5fcf3f40518 Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Tue, 27 Oct 2020 12:24:27 -0300
Subject: [PATCH] Small fix to the new link for inherited faces in Customize

* lisp/cus-edit.el (cus--face-link): Link to the current value of the
widget, rather than to the widget's value upon creation.  (Bug#44154)
---
 lisp/cus-edit.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index ed0117e067..769a69a50f 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3740,13 +3740,12 @@ custom-face-value-create
 	  (custom-face-state-set widget))))))
 
 (defun cus--face-link (widget _format)
-  (let ((face (intern (widget-get widget :value))))
-    (widget-create-child-and-convert
-     widget 'face-link
-     :button-face 'link
-     :tag "link"
-     :action (lambda (&rest _x)
-               (customize-face face)))))
+  (widget-create-child-and-convert
+   widget 'face-link
+   :button-face 'link
+   :tag "link"
+   :action (lambda (&rest _x)
+             (customize-face (widget-value widget)))))
 
 (defvar custom-face-menu nil
   "If non-nil, an alist of actions for the `custom-face' widget.
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#44154: (no subject)
  2020-10-27 15:32 ` Mauro Aranda
@ 2020-10-27 17:35   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 17:35 UTC (permalink / raw)
  To: Mauro Aranda; +Cc: 44154

Mauro Aranda <maurooaranda@gmail.com> writes:

> I think this could become confusing if one edits the value of the
> inherited face, because the link always points to the widget's value at
> creation time.
>
> I suggest making the link always point to the widget's current value,
> like in the attached patch.

Ah, right.  Thanks; applied to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-27 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22 21:07 bug#44154: 26.3; Customize Face buffer: be able to click an inherited face, to customize it Drew Adams
2020-10-27 10:32 ` Lars Ingebrigtsen
2020-10-27 15:32 ` Mauro Aranda
2020-10-27 17:35   ` bug#44154: (no subject) Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.