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

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

Re: PGTK+ warning


From: Emanuel Berg
Subject: Re: PGTK+ warning
Date: Tue, 15 Nov 2022 19:22:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Alessandro Bertulli wrote:

>> ;; (setq text-mode-hook nil)
>>
>> (defun text-mode-hook-f ()
>>   (abbrev-mode)
>>   (define-key text-mode-map "\C-c\C-c" #'compile) )
>>   
>> (add-hook 'text-mode-hook #'text-mode-hook-f)
>
> Correct, but that doesn't account for functions possibly
> added by other packages. Anyway, now you make me think that
> this should never happen, so my concern is probably futile.
> Thanks for the suggestion!
>
> Moreover, correct me, but uncommenting also the first line
> makes the init file idempotent, right?

Interesting question ...

It removes whatever stuff might be there from the start, so
look what is there first.

But even so it should be avoided because people might put
stuff in their hooks in future versions.

So that should perhaps be changed into something that removes
the mode-hook-f function from the hook, or just sets it (the
function) to `ignore' (#'ignore) perhaps ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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