GNU bug report logs - #50642
27.2; autoload xref-pulse-momentarily

Previous Next

Package: emacs;

Reported by: Howard Melman <hmelman <at> gmail.com>

Date: Fri, 17 Sep 2021 14:44:02 UTC

Severity: normal

Found in version 27.2

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 50642 in the body.
You can then email your comments to 50642 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#50642; Package emacs. (Fri, 17 Sep 2021 14:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Howard Melman <hmelman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 17 Sep 2021 14:44:02 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: GNU Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 27.2; autoload xref-pulse-momentarily
Date: Fri, 17 Sep 2021 10:43:48 -0400
I'm not sure about this but can xref-pulse-momentarily be
autoloaded?

I'm using consult and it has a consult-after-jump-hook which
recommends xref-pulse-momentarily as something you may want
to use in it. I set it and xref-after-jump-hook to:
'(reposition-window xref-pulse-momentarily).

It works great, but if I use consult before xref I get the error:
run-hooks: Symbol's function definition is void: xref-pulse-momentarily
If I add an autoload call myself it does not error.

I looked but didn't find a more suitable function to use.
It seems like pulse.el should define a function suitable for
use in a hook, but in its absense xref-pulse-momentarily
does seem like the best option (though I couldn't follow its
implementation). 


In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, Carbon Version 158 AppKit 1671.6)
of 2021-03-27 built on Traviss-Mac.local

-- 

Howard




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50642; Package emacs. (Sat, 18 Sep 2021 00:15:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Howard Melman <hmelman <at> gmail.com>, 50642 <at> debbugs.gnu.org
Subject: Re: bug#50642: 27.2; autoload xref-pulse-momentarily
Date: Sat, 18 Sep 2021 03:14:06 +0300
On 17.09.2021 17:43, Howard Melman wrote:
> I'm not sure about this but can xref-pulse-momentarily be
> autoloaded?
> 
> I'm using consult and it has a consult-after-jump-hook which
> recommends xref-pulse-momentarily as something you may want
> to use in it. I set it and xref-after-jump-hook to:
> '(reposition-window xref-pulse-momentarily).
> 
> It works great, but if I use consult before xref I get the error:
> run-hooks: Symbol's function definition is void: xref-pulse-momentarily
> If I add an autoload call myself it does not error.
> 
> I looked but didn't find a more suitable function to use.
> It seems like pulse.el should define a function suitable for
> use in a hook, but in its absense xref-pulse-momentarily
> does seem like the best option (though I couldn't follow its
> implementation).

Well, um. I don't really mind but xref-pulse-momentarily was designed to 
pulse after a jump to an xref location. That's why it refers to 
xref--current-item in its implementation.

It does fall back to pulsing the whole line, so I suppose it can be 
useful in other cases too.

But maybe Counsel wants to provide its own version of this function? It 
can call xref-pulse-momentarily after xref navigations, but maybe do 
some more useful fallbacks for other commands? I'm not sure which other 
kinds of jumps consult-after-jump-hook also handles.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50642; Package emacs. (Sat, 18 Sep 2021 01:49:02 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 50642 <at> debbugs.gnu.org
Subject: Re: bug#50642: 27.2; autoload xref-pulse-momentarily
Date: Fri, 17 Sep 2021 21:48:47 -0400
On Sep 17, 2021, at 8:14 PM, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> 
> Well, um. I don't really mind but xref-pulse-momentarily was designed to pulse after a jump to an xref location. That's why it refers to xref--current-item in its implementation.
> 
> It does fall back to pulsing the whole line, so I suppose it can be useful in other cases too.
> 
> But maybe Counsel wants to provide its own version of this function? It can call xref-pulse-momentarily after xref navigations, but maybe do some more useful fallbacks for other commands? I'm not sure which other kinds of jumps consult-after-jump-hook also handles.

I'm not the consult author, but given that it doesn't actually use a pulse function, it just suggests one possible one, I doubt it will.

It looked to me in some cases consult wasn't pulsing the whole line but rather just a symbol, but perhaps I'm mistaken (I can't seem to get it to do so now).  It uses this hook in various grep/imenu/outline/etc. navigation commands.

I do still think it would be nice for pulse.el to define a function suitable for use in a jump-like hook that take no arguments and pulses the current line or maybe symbol.  The former is trival, but if pulse-momentary-highlight-one-line allowed it's POINT argument to be optional, emacs could provide it for everyone.  It seems like in Emacs 27 all the callers of it just pass (point) anyway.

Or maybe pulse-line-hook-function is supposed to be this?  In which case it should be autoloaded and pulse-command-advice-flag should be a defcustom and have a docstring?

Howard



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50642; Package emacs. (Sat, 18 Sep 2021 14:15:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Howard Melman <hmelman <at> gmail.com>
Cc: 50642 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#50642: 27.2; autoload xref-pulse-momentarily
Date: Sat, 18 Sep 2021 16:14:04 +0200
Howard Melman <hmelman <at> gmail.com> writes:

>> Well, um. I don't really mind but xref-pulse-momentarily was
>> designed to pulse after a jump to an xref location. That's why it
>> refers to xref--current-item in its implementation.

Yeah, that's the wrong function to use here, so the Consult
documentation should be altered.

> I do still think it would be nice for pulse.el to define a function
> suitable for use in a jump-like hook that take no arguments and pulses
> the current line or maybe symbol.  The former is trival, but if
> pulse-momentary-highlight-one-line allowed it's POINT argument to be
> optional, emacs could provide it for everyone.  It seems like in Emacs
> 27 all the callers of it just pass (point) anyway.

I've now made POINT optional in Emacs 28.

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




bug marked as fixed in version 28.1, send any further explanations to 50642 <at> debbugs.gnu.org and Howard Melman <hmelman <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 18 Sep 2021 14:15:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 2 years and 185 days ago.

Previous Next


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