unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Howard Melman <hmelman@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65411@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	[thread overview]
Message-ID: <5B343C6B-DE9E-4BC2-8963-AFE9353E062D@gmail.com> (raw)
In-Reply-To: <83h6otwwsp.fsf@gnu.org>

On Aug 20, 2023, at 11:36 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Howard Melman <hmelman@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





  reply	other threads:[~2023-08-20 16:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 15:03 bug#65411: 29.1; setopt of xref-after-jump-hook gives warning Howard Melman
2023-08-20 15:36 ` Eli Zaretskii
2023-08-20 16:12   ` Howard Melman [this message]
2023-08-20 18:12     ` Eli Zaretskii
2023-08-21  0:21       ` Howard Melman
2023-08-21 12:01         ` Eli Zaretskii
2023-08-21 13:19           ` Howard Melman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B343C6B-DE9E-4BC2-8963-AFE9353E062D@gmail.com \
    --to=hmelman@gmail.com \
    --cc=65411@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).