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 20:21:39 -0400

> On Aug 20, 2023, at 2:12 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Howard Melman <hmelman <at> gmail.com>
>> Date: Sun, 20 Aug 2023 12:12:13 -0400
>> Cc: 65411 <at> debbugs.gnu.org
>> 
>> 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?
> 
> Because until xref is loaded, Emacs doesn't know that
> 'xref-pulse-momentarily' is a symbol of function, whereas the
> defcustom's type is 'hook', which stands for "a list of functions".

Well, that must be correct because doing this also worked fine:

  (declare-function xref-pulse-momentarily "xref" ())
  (setopt xref-after-jump-hook '(reposition-window xref-pulse-momentarily))

So I guess setopt defers the type check? I get the error when the
hook is run (at which time xref is loaded so I'm still confused about
that).

I'm familiar with reading the lisp code but the innards of custom and
the c code are a bit beyond me.  Is it the custom-check-value property
in setopt--set?

If I'm supposed to resolve this warning on my own, then a comment
in setopt--set or something in setopt's docstring (or the manual)
mentioning the asynchrony would help.

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.