GNU bug report logs - #65411
29.1; setopt of xref-after-jump-hook gives warning

Previous Next

Package: emacs;

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

Date: Sun, 20 Aug 2023 15:05:02 UTC

Severity: normal

Found in version 29.1

Full log


View this message in rfc822 format

From: Howard Melman <hmelman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 65411 <at> debbugs.gnu.org
Subject: bug#65411: 29.1; setopt of xref-after-jump-hook gives warning
Date: Sun, 20 Aug 2023 12:12:13 -0400
On Aug 20, 2023, at 11:36 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Howard Melman <hmelman <at> gmail.com>
>> Date: Sun, 20 Aug 2023 11:03:50 -0400
>> 
>> 
>> In Emacs 29.1 should I be able to do this:
>> 
>>    (setopt xref-after-jump-hook '(reposition-window xref-pulse-momentarily))
>> 
>> When I do in my init and then use xref-find-definition I get this warning:
>> 
>>    ⛔ Warning (emacs): Value `((reposition-window xref-pulse-momentarily))' for `xref-after-jump-hook' does not match type hook
> 
> xref-pulse-momentarily is not an autoloaded function, and xref.el is
> not preloaded.  You need to load xref.el, and then the above will
> work; it does for me.

Thanks very much. Indeed, doing this works fine for me:

(with-eval-after-load 'xref
  (setopt xref-after-jump-hook '(reposition-window xref-pulse-momentarily)))

Also I found doing (just) this works fine:

(setq xref-after-jump-hook '(reposition-window xref-pulse-momentarily))

So why does it fail using setopt?  AFAIU the xref-pulse-momentarily in the value
is just a symbol and I don't see the warning until I call xref-find-definition which
loads xref. And it works using setq without loading xref.

The warning shows double parentheses which I also don't understand how 
that happened (I see it does some widget conversion).  If there's some extra
restriction on using setopt to set hooks (which are user options), could it be 
explained in the manual or docstring?

Howard




This bug report was last modified 1 year and 299 days ago.

Previous Next


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