From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65411: 29.1; setopt of xref-after-jump-hook gives warning Date: Mon, 21 Aug 2023 15:01:07 +0300 Message-ID: <83jztovc3g.fsf@gnu.org> References: <83h6otwwsp.fsf@gnu.org> <5B343C6B-DE9E-4BC2-8963-AFE9353E062D@gmail.com> <83edjxwpkj.fsf@gnu.org> <665BB487-07C8-4B9D-8CAA-CE8ECFA6C8E4@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31385"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65411@debbugs.gnu.org To: Howard Melman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 21 14:01:44 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qY3bM-00081p-GZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Aug 2023 14:01:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY3bF-0006VR-Gz; Mon, 21 Aug 2023 08:01:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY3ae-0006DU-Si for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 08:01:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY3ae-00057U-HN for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 08:01:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qY3ag-0008D7-CV for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 08:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2023 12:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65411 X-GNU-PR-Package: emacs Original-Received: via spool by 65411-submit@debbugs.gnu.org id=B65411.169261926031546 (code B ref 65411); Mon, 21 Aug 2023 12:01:02 +0000 Original-Received: (at 65411) by debbugs.gnu.org; 21 Aug 2023 12:01:00 +0000 Original-Received: from localhost ([127.0.0.1]:55733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY3ad-0008Ck-K1 for submit@debbugs.gnu.org; Mon, 21 Aug 2023 08:00:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY3ab-0008CW-QF for 65411@debbugs.gnu.org; Mon, 21 Aug 2023 08:00:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY3aU-00054R-Aq; Mon, 21 Aug 2023 08:00:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/mzh7JeXhUJxdeSGJKsaxWCwxXGqCnY76CSp14EI3Uc=; b=V2XVLb8hThhb oD1Ow7BbBBm501XQhRwm0rpWDMy2kRiSZua4FAIlO7P8ubZ8VSP1IaOzWJ8ElKXLgrgB4UZtjptih 4s3/ZCwU3qcdJVhTVyMYHdd3Bf/nmzbXyBT0lqgGxD1q2x/ZBwMGxaKtli7P7J36dP327wIo69Swl q3qD5KDeB4JQ/Yw7qCWK60qpneJZjiCGeNm5Bchb5BMNQDb4N4yPXK8vyMYj5zUXeL5x9zZfFohui iFm4sTc/yxaazfDv5orqpG6bPqZWdJy4nxCIv7AwA72mWruvn20PSgZ4Q/wb5BcEUzfSdUMOQ4gtJ wtUxoFhuVTnRfKg6uBvuxg==; In-Reply-To: <665BB487-07C8-4B9D-8CAA-CE8ECFA6C8E4@gmail.com> (message from Howard Melman on Sun, 20 Aug 2023 20:21:39 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268083 Archived-At: > From: Howard Melman > Date: Sun, 20 Aug 2023 20:21:39 -0400 > Cc: 65411@debbugs.gnu.org > > >> 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? No, it just verifies that the symbol's function slot is valid. > I get the error when the hook is run (at which time xref is loaded > so I'm still confused about that). declare-function doesn't provider an actual function definition, it just provides a declaration. IOW, you lie to Emacs, and Emacs bites you when it can ;-) > 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? Yes. > 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. setopt is a non-interactive version of defcustom. Like defcustom will not accept a value that contradicts the :type of the option, so will setopt. I don't think there's anything subtle to be documented here.