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: Thu, 17 Nov 2022 00:30:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Alessandro Bertulli wrote:

>> 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 ...
>
> Good ideas! Might be worth reasoning about it, thanks.

I realized you can simply use `remove-hook' to remove your
addition to it :)

Clear the whole thing:

  (setq conf-space-mode-hook nil)

Make your addition do nothing: (useful)

  (setq conf-space-mode-hook-f #'ignore)

Remove your addition: (useful to do after you do it)

  (remove-hook 'conf-space-mode-hook #'conf-space-mode-hook-f)

Your addition can look like this for, for example, the
`conf-space-mode-hook'

  (defun conf-space-mode-hook-f ()
    ;; do stuff
    )

Then add it, this won't remove any stuff that's already there
or will appear in the future: (pretty safe)

  (add-hook 'conf-space-mode-hook #'conf-space-mode-hook-f)

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




reply via email to

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