GNU bug report logs - #46407
27.1; Hooks with permanent-local-hook are not cleared of lambdas

Previous Next

Package: emacs;

Reported by: jakanakaevangeli <jakanakaevangeli <at> chiru.no>

Date: Tue, 9 Feb 2021 20:01:01 UTC

Severity: normal

Tags: patch

Found in version 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: jakanakaevangeli <jakanakaevangeli <at> chiru.no>
To: 46407 <at> debbugs.gnu.org
Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas
Date: Tue, 09 Feb 2021 22:38:49 +0100
Also one more thing:

    (defvar some-hook nil)
    (add-hook 'some-hook #'some-fun nil t)
    (put 'some-fun 'permanent-local-hook t)

If we mark a function as permanent-local-hook only after adding it to a
hook, the hook symbol will not have its permanent-local property set to
'permanent-local-hook, so some-fun will not be kept on removal of local
variables.

This can be a real non-theoretical problem when adding an autoloaded
function to a hook.




This bug report was last modified 3 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.