GNU bug report logs - #20664
25.0.50; Customize: Link option or face name to the source definition

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 26 May 2015 20:42:02 UTC

Severity: wishlist

Tags: fixed

Found in version 25.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20664 in the body.
You can then email your comments to 20664 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Tue, 26 May 2015 20:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 May 2015 20:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Customize: Link option or face name to the source definition
Date: Tue, 26 May 2015 13:41:03 -0700 (PDT)
Feature request.  In Customize, for options and faces.  Put a link on
the option/face name, so that following the link takes you to the source
code (defcustom or defface).

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 13:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Oleh Krehel <ohwoeowho <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50;
 Customize: Link option or face name to the source definition
Date: Wed, 27 May 2015 15:19:52 +0200
[Message part 1 (text/plain, inline)]
Drew Adams <drew.adams <at> oracle.com> writes:

> Feature request.  In Customize, for options and faces.  Put a link on
> the option/face name, so that following the link takes you to the source
> code (defcustom or defface).

Please check the patch. 

[0001-Allow-to-follow-to-face-definition-in-Customize.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
With this patch, "RET" works as expected, while "<mouse-1>" is giving an
error for a reason I don't understand.  In order to make it work for the
mouse, I have to do something contorted instead of a plain
`make-button':

(define-key (overlay-get
             (make-button opoint (point)
                          'follow-link t
                          'action (lambda (&rest _x) (find-face-definition symbol)))
             'keymap) [down-mouse-1]
  (lambda ()
    (interactive)
    (let ((button (button-at (point))))
      (when button
        (button-activate button)
        t))))

Maybe someone can suggest a better way.

Oleh

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 14:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>
Cc: 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Wed, 27 May 2015 16:09:38 +0200
> With this patch, "RET" works as expected, while "<mouse-1>" is giving an
> error for a reason I don't understand.

Bug#20398?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 14:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Oleh Krehel <ohwoeowho <at> gmail.com>
Cc: 20664 <at> debbugs.gnu.org
Subject: RE: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Wed, 27 May 2015 07:15:16 -0700 (PDT)
> Please check the patch.

I get this: 

widget-button-click: Wrong type argument: consp, #<overlay from 259 to 279 in *Customize Face: Show Paren Mismatch*>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 14:36:03 GMT) Full text and rfc822 format available.

Message #17 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Oleh Krehel <ohwoeowho <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 20664 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#20664: 25.0.50;
 Customize: Link option or face name to the source definition
Date: Wed, 27 May 2015 16:28:33 +0200
martin rudalics <rudalics <at> gmx.at> writes:

>> With this patch, "RET" works as expected, while "<mouse-1>" is giving an
>> error for a reason I don't understand.
>
> Bug#20398?

No, this is likely caused by the fact that `Custom-mode' binds
"<down-mouse-1>" to the incompatible (with buttons) `widget-button-click'.

And even with 'follow-link t, "<down-mouse-1>" supersedes "<mouse-1>",
which is actually bound to `push-button'.

I think if `Custom-mode' didn't bind "<down-mouse-1>", it would
translate to "<mouse-1>" and properly call `push-button'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 14:38:02 GMT) Full text and rfc822 format available.

Message #20 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Oleh Krehel <ohwoeowho <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50;
 Customize: Link option or face name to the source definition
Date: Wed, 27 May 2015 16:30:46 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

>> Please check the patch.
>
> I get this: 
>
> widget-button-click: Wrong type argument: consp, #<overlay from 259 to 279 in *Customize Face: Show Paren Mismatch*>

Yes, I get the same thing when clicking "<mouse-1>". It works fine for
"RET" and "<mouse-2>" though. With the additional code from above, it
also should work for "<mouse-1>", but I wonder if there's a better way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 15:00:05 GMT) Full text and rfc822 format available.

Message #23 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Oleh Krehel <ohwoeowho <at> gmail.com>, martin rudalics <rudalics <at> gmx.at>
Cc: 20664 <at> debbugs.gnu.org
Subject: RE: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Wed, 27 May 2015 07:59:03 -0700 (PDT)
> >> With this patch, "RET" works as expected, while "<mouse-1>" is
> >> giving an error for a reason I don't understand.
> > Bug#20398?
> 
> No, this is likely caused by the fact that `Custom-mode' binds
> "<down-mouse-1>" to the incompatible (with buttons) `widget-button-click'.
> And even with 'follow-link t, "<down-mouse-1>" supersedes "<mouse-1>",
> which is actually bound to `push-button'.
> 
> I think if `Custom-mode' didn't bind "<down-mouse-1>", it would
> translate to "<mouse-1>" and properly call `push-button'.

FWIW: With `emacs -Q', setting `mouse-1-click-follows-link' = nil,
`mouse-2' gives the same error message, plus an additional error saying
that `symbol' is an bound variable.

widget-button-click: Wrong type argument: consp, #<overlay from 259 to 272 in *Customize Face: Dired Header*>
Symbol's value as variable is void: symbol




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 15:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Oleh Krehel <ohwoeowho <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50;
 Customize: Link option or face name to the source definition
Date: Wed, 27 May 2015 17:16:01 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> FWIW: With `emacs -Q', setting `mouse-1-click-follows-link' = nil,
> `mouse-2' gives the same error message, plus an additional error saying
> that `symbol' is an bound variable.
>
> widget-button-click: Wrong type argument: consp, #<overlay from 259 to 272 in *Customize Face: Dired Header*>
> Symbol's value as variable is void: symbol

Strange, cus-edit.el does have lexical-binding, it should work.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Wed, 27 May 2015 15:29:04 GMT) Full text and rfc822 format available.

Message #29 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Oleh Krehel <ohwoeowho <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 20664 <at> debbugs.gnu.org
Subject: RE: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Wed, 27 May 2015 08:28:31 -0700 (PDT)
> > FWIW: With `emacs -Q', setting `mouse-1-click-follows-link' = nil,
> > `mouse-2' gives the same error message, plus an additional error
> > saying that `symbol' is an bound variable.
> >
> > widget-button-click: Wrong type argument: consp, #<overlay from
> > 259 to 272 in *Customize Face: Dired Header*>
> > Symbol's value as variable is void: symbol
> 
> Strange, cus-edit.el does have lexical-binding, it should work.

My bad.  Sorry for the noise.

Adding a -*- lexical-binding:t -*- declaration to the patch-test
file I used makes it work - the link is followed OK, and there is
no void-var error.  (But I do still get the wrong-type-arg error.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Thu, 17 Sep 2020 18:48:02 GMT) Full text and rfc822 format available.

Message #32 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Oleh Krehel <ohwoeowho <at> gmail.com>
Cc: 20664 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Thu, 17 Sep 2020 20:46:54 +0200
Oleh Krehel <ohwoeowho <at> gmail.com> writes:

> * lisp/cus-edit.el (custom-face-value-create): Make the face name into
>   a button that calls `find-face-definition'.

[...]

> +        (setq opoint (point))
> +        ;; Face name (tag).
> +        (insert " " tag)
> +        (make-button opoint (point)
> +                     'follow-link t
> +                     'action (lambda (&rest _x) (find-face-definition symbol))))

Makes sense to me.  I tweaked it a bit before applying, though -- used
insert-text-button for convenience.

> With this patch, "RET" works as expected, while "<mouse-1>" is giving an
> error for a reason I don't understand.  In order to make it work for the
> mouse, I have to do something contorted instead of a plain
> `make-button':

I think that's just a bug in Customize -- I think I've now fixed that,
but it involved some refactoring, so hopefully I didn't break anything.
But a standard Customize buffer seems to have the same number of things
that work before/after the rework, so I'm hopeful.  :-)

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 17 Sep 2020 18:48:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 20664 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 17 Sep 2020 18:48:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Thu, 17 Sep 2020 20:17:02 GMT) Full text and rfc822 format available.

Message #39 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>,
 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Thu, 17 Sep 2020 17:16:09 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Oleh Krehel <ohwoeowho <at> gmail.com> writes:
>
>> * lisp/cus-edit.el (custom-face-value-create): Make the face name into
>>   a button that calls `find-face-definition'.
>
> [...]
>
>> +        (setq opoint (point))
>> +        ;; Face name (tag).
>> +        (insert " " tag)
>> +        (make-button opoint (point)
>> +                     'follow-link t
>> + 'action (lambda (&rest _x) (find-face-definition symbol))))
>
> Makes sense to me.  I tweaked it a bit before applying, though -- used
> insert-text-button for convenience.
>

Why a button.el button, and not a link widget? Using a button.el button
makes it look like TAB is inconsistent, because it skips the button, so
you can't get to the button by just pressing TAB.

And given there are links to which you can get to by pressing TAB, not
being able to reach this one makes it feel like something is wrong.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Thu, 17 Sep 2020 20:34:02 GMT) Full text and rfc822 format available.

Message #42 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Mauro Aranda <maurooaranda <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, 20664 <at> debbugs.gnu.org
Subject: RE: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Thu, 17 Sep 2020 20:30:59 +0000 (UTC)
>> Makes sense to me.  I tweaked it a bit before applying, though -- used
>> insert-text-button for convenience.
>
> Why a button.el button, and not a link widget? Using a
> button.el button makes it look like TAB is inconsistent,
> because it skips the button, so you can't get to the
> button by just pressing TAB.
>
> And given there are links to which you can get to by
> pressing TAB, not being able to reach this one makes
> it feel like something is wrong.

[Caveat: I haven't tried the updated code.]

Yes, it's important that the fix fit well with Customize,
both from a UI/user point of view and from a coding
point of view.

Please also do make sure that `mouse-1-click-follows-link'
is effective, i.e., that it has its expected effect when
either nil or non-nil.  (I have it set to nil, BTW.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Thu, 17 Sep 2020 21:43:02 GMT) Full text and rfc822 format available.

Message #45 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>,
 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Thu, 17 Sep 2020 18:41:53 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think that's just a bug in Customize -- I think I've now fixed that,
> but it involved some refactoring, so hopefully I didn't break anything.
> But a standard Customize buffer seems to have the same number of things
> that work before/after the rework, so I'm hopeful.  :-)

After the change in wid-edit.el, clicking in the Value Menu button
doesn't display a menu.

I attach a patch to fix it.
[Message part 2 (text/html, inline)]
[0001-Fix-recent-change-in-wid-edit.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Thu, 17 Sep 2020 21:47:01 GMT) Full text and rfc822 format available.

Message #48 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>,
 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Thu, 17 Sep 2020 23:46:45 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> After the change in wid-edit.el, clicking in the Value Menu button
> doesn't display a menu.
>
> I attach a patch to fix it.

Thanks; applied to the trunk.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Fri, 18 Sep 2020 11:30:02 GMT) Full text and rfc822 format available.

Message #51 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>,
 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Fri, 18 Sep 2020 13:28:58 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Why a button.el button, and not a link widget? Using a button.el button
> makes it look like TAB is inconsistent, because it skips the button, so
> you can't get to the button by just pressing TAB.

I just hate the widget code...  soooo much!

But I've now rewritten it to use a widget.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20664; Package emacs. (Fri, 18 Sep 2020 11:40:01 GMT) Full text and rfc822 format available.

Message #54 received at 20664 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>,
 20664 <at> debbugs.gnu.org
Subject: Re: bug#20664: 25.0.50; Customize: Link option or face name to the
 source definition
Date: Fri, 18 Sep 2020 08:39:22 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> Why a button.el button, and not a link widget? Using a button.el button
>> makes it look like TAB is inconsistent, because it skips the button, so
>> you can't get to the button by just pressing TAB.
>
> I just hate the widget code...  soooo much!
>
> But I've now rewritten it to use a widget.

Thanks!
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Oct 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.