From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#13780: 24.2; Making find-file-hook customizable seems to cause troublle Date: Tue, 24 Nov 2020 18:18:58 -0800 Message-ID: References: <87k3q1gpba.fsf@sc3d.org> <83sg9ycrgp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 13780@debbugs.gnu.org, monnier@iro.umontreal.ca, rrt@sc3d.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 25 03:20:12 2020 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 1khkPk-00026F-DR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 03:20:12 +0100 Original-Received: from localhost ([::1]:42718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khkPj-0001gI-Gj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 21:20:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khkPa-0001fz-9Y for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 21:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khkPa-0002KT-1e for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 21:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1khkPZ-0006Mz-Qk for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 21:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Nov 2020 02:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13780 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 13780-submit@debbugs.gnu.org id=B13780.160627074624418 (code B ref 13780); Wed, 25 Nov 2020 02:20:01 +0000 Original-Received: (at 13780) by debbugs.gnu.org; 25 Nov 2020 02:19:06 +0000 Original-Received: from localhost ([127.0.0.1]:33722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khkOg-0006Ll-7R for submit@debbugs.gnu.org; Tue, 24 Nov 2020 21:19:06 -0500 Original-Received: from mail-ej1-f51.google.com ([209.85.218.51]:37513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khkOe-0006LH-IP for 13780@debbugs.gnu.org; Tue, 24 Nov 2020 21:19:05 -0500 Original-Received: by mail-ej1-f51.google.com with SMTP id z5so822066ejp.4 for <13780@debbugs.gnu.org>; Tue, 24 Nov 2020 18:19:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc :content-transfer-encoding; bh=MUvozmruPMt/igELpiR4PLL59ZDuihYkrYYpjSznWDQ=; b=D7dI0+RODMwrpVswMiz42vzz/cmNvS3EW/QaQL8FjrVhSe2vE0KodIuuFMqMynIAZi Y/1c2KSvoYgMprgA18mWYU7VdW6E9HifQIda+xU+3l1KCVD29mW23C0x4EIDvSzU8nTm /9UhKURyBfWQ7JMawIVSNeevBo3yhYMq6iB8XmSBlftFQEW6es3iGOPIvoaRPVKIo7yq 6HwaP3BSt8Q+1x9KaEqGY8t/P3jJTUTB/XqXv9YnG871t7tjYUVwQvncngy2xVdyTDD/ hM0a877uKs72vqbn9gHVfrvQr0BUfuAPXkYmSlE9DrPYkXRTxQ2lxCRw3eovsuqgEiai 98rQ== X-Gm-Message-State: AOAM530uRY4mvnNaya2s6rTpajON54J9++rQsrN0htWvUC80Tl9lu6Kx J8L+Luk6Oy6aX9n0FbAdE1OZ32b1oNgENGrMbV0= X-Google-Smtp-Source: ABdhPJzLtJIeZRdqbCktugotrAHMCk83uPzz4M4t2QlewNdbn9nScRwoGb8fQLms3zrC22BQctkrPnZ17xPjWUDUcgA= X-Received: by 2002:a17:906:eb50:: with SMTP id mc16mr799652ejb.420.1606270738692; Tue, 24 Nov 2020 18:18:58 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 24 Nov 2020 18:18:58 -0800 In-Reply-To: <83sg9ycrgp.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 28 Oct 2020 17:15:02 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:194146 Archived-At: Eli Zaretskii writes: >> Stefan Monnier writes: >> >> >>> So until Custom ...blabla... I think it's better to use defcustom fo= r >> >>> hooks very sparingly, i.e. only for those hook we can reasonably >> >>> expect will only be modified by the user's customization. >> >> So do you think the existing customization ability for find-file-hook >> >> should be removed? Or at least some kind of warning attached? >> > >> > Yes, >> >> So how about the attached? > > That's a backward-incompatible change, isn't it? Now a user who types > "M-x set-variable RET" will not be able to set this variable, it can > only be set via "M-:". Do we have a serious enough reason for that? It will be a backward-incompatible change, yes. The reasons are the ones given in the discussion of this bug. I think they make sense, FWIW: Reuben Thomas writes: > I just spent a while trying to work out why a third-party mode I had > just installed was not automatically added to my find-file-hook, even > though the mode's file calls add-hook when it is loaded, and I took care > to ensure the mode was autoloaded. I discovered that the problem was > that the mode was loaded by my customization file, custom.el, but later, > the same file overwrote find-file-hook, because I had customized > find-file-hook. > > I found that the reason for the customization was to get flymake-mode > automatically activated; I've filed a separate issue about this > (#13779). After removing the customization, my find-file-hook was set up > correctly (except for flymake-mode). > > The real problem here is that find-file-hook is clearly meant to be > customizable (there is even a check box for auto-indent in its > customization dialog), yet customizing it seems to cause a race > condition where depending in what order files are autoloaded, hooks may > fail to be added properly to find-file-hook. Stefan Monnier writes: >>> So until Custom is fixed to actually properly handle customisation of >>> hooks (e.g. by storing "add functions foo, bar, and baz" rather than >>> "ignore current value and just set it to (foo bar baz)"). >> This sentence seems to be missing its main clause=E2=80=A6 > > That's not just an appearance. Its main clause is: > > So until Custom ...blabla... I think it's better to use defcustom for > hooks very sparingly, i.e. only for those hook we can reasonably > expect will only be modified by the user's customization.