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#69391: 30.0.50; `enable-command' doesn't permanently enable `help-fns-edit-variable' Date: Mon, 26 Feb 2024 16:11:24 +0200 Message-ID: <86wmqruxgz.fsf@gnu.org> References: <875xycsala.fsf@martinmarshall.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69391@debbugs.gnu.org To: Martin Marshall , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 26 15:26:04 2024 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 1rebve-00060x-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Feb 2024 15:26:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rebvH-00067S-4S; Mon, 26 Feb 2024 09:25:39 -0500 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 1rebvF-00066z-PS for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 09:25:37 -0500 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 1rebvF-0004v2-H7 for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 09:25:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rebve-0007fJ-Q1 for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 09:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Feb 2024 14:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69391 X-GNU-PR-Package: emacs Original-Received: via spool by 69391-submit@debbugs.gnu.org id=B69391.170895751829326 (code B ref 69391); Mon, 26 Feb 2024 14:26:02 +0000 Original-Received: (at 69391) by debbugs.gnu.org; 26 Feb 2024 14:25:18 +0000 Original-Received: from localhost ([127.0.0.1]:39284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rebuu-0007cp-Jd for submit@debbugs.gnu.org; Mon, 26 Feb 2024 09:25:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reblm-00073R-9o for 69391@debbugs.gnu.org; Mon, 26 Feb 2024 09:15:51 -0500 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 1rebhY-00024O-Ap; Mon, 26 Feb 2024 09:11:28 -0500 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=OsCA4ipg5LDPll0Gz2uPQYChh8auhkUcUWDrBsDdTxg=; b=G4TySwqcZ6A6 HcxtsgbDW1+uS/j/EmbqWZZ5RzqPu6mL6vGPi1xzxfziL9d2UR6F6fV1FcXc8jNqUsERtuFg7OoKS j3i87OajGLeRn134SWc1DkYw9RYlRCUgmsDodC48p5BFcOFK0ozK3ZFkXBOYtCD0PMUr7PKo9JHRZ eKbfwoLDR2CBgPc3l84hNcO9nfvit/OLPphpXayEJeGZ8KCdGs1qs72L6H8LugFwikqrI7BU75nOz pY66xJQNTWqvsi2XOo14mcBhq4Q11VPLPA3gPuKLLAgK6vt0//Pg6raL/kIb6GrVef7h/REYMo0Gc CLkR+uy1j2KQnMVCpkkDqg==; In-Reply-To: <875xycsala.fsf@martinmarshall.com> (message from Martin Marshall on Sun, 25 Feb 2024 12:44:01 -0500) 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:280668 Archived-At: > From: Martin Marshall > Date: Sun, 25 Feb 2024 12:44:01 -0500 > > Description: > > When initially calling `help-fns-edit-variable', the disabled command > pop-up appears. There's a prompt to enable the command, and pressing > "y" does so for the current session. Thereafter, a second message > appears in the minibuffer advising to press "y" again to enable the > command in future sessions. However, this does not have the described > effect. > > Pressing "y" adds "(put 'help-fns-edit-variable 'disabled nil)" to the > end of `user-init-file'. However, after restarting Emacs, attempting to > invoke the command again brings up the same "disabled command" pop-up. > > Recreating: > > 1. Create directory for testing, > cd; mkdir emacs-test-disabled-cmds; cd emacs-test-disabled-cmds > 2. "touch init.el" > 3. "emacs --init-directory . &" > 4. "C-x b *scratch* RET" > 5. "(setopt help-enable-variable-value-editing t) C-x C-e" > 6. "C-h v electric-pair-mode RET" > 7. "C-x o" then move cursor to the `nil' value shown > 8. Press "e" to edit the variable value, a disabled-command pop-up > appears. > 9. Press "y" to "enable the command". > 10. Press "y" again to enable it "for future editing sessions also". > 11. Press "C-c C-c" to exit the variable-editing buffer. > 12. Go back to the *Help* buffer and try to edit the variable again, > there is no pop-up, because the command has been enabled for this > session. > 13. Press "C-x C-c" to exit Emacs. > 14. "cat init.el" confirms that the init file does contain > "(put 'help-fns-edit-variable 'disabled nil)" > 15. But when you repeat steps 3 through 8, you find that the disabled > command pop-up still appears. > > Probable diagnosis: > > It looks like most of Emacs's disabled commands are either set disabled > in libraries that load before the init-file, or they are disabled via > autoload cookies, like this one: > > ;;;###autoload (put 'dired-find-alternate-file 'disabled t) > > But that's not the case for `help-fns-edit-variable' (and a few others, > which I located using ripgrep). So when "help-fns.el" loads, it > re-disables the command that was supposed to have been enabled by the > call to `put' that Emacs added to the init file. Thanks for the analysis. Stefan, is there a better way than convert the form we have in help-fns.el: (put 'help-fns-edit-variable 'disabled t) into an autoload comment, like we do, e.g., with dired-find-alternate-file?