bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13780: 24.2; Making find-file-hook customizable seems to cause troub


From: Stefan Kangas
Subject: bug#13780: 24.2; Making find-file-hook customizable seems to cause troublle
Date: Tue, 24 Nov 2020 18:18:58 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>> >>> 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.
>> >> 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 <rrt@sc3d.org> 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 <monnier@iro.umontreal.ca> 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…
>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]