GNU bug report logs - #21563
24.5; discourage load-hook variables

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <winkler <at> gnu.org>

Date: Fri, 25 Sep 2015 19:01:01 UTC

Severity: wishlist

Found in version 24.5

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21563 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 21563 <at> debbugs.gnu.org
Subject: Re: bug#21563: 24.5; discourage load-hook variables
Date: Wed, 15 Jan 2020 20:32:12 +0100
"Roland Winkler" <winkler <at> gnu.org> writes:

> Somewhere in my emacs init file I was setting the variable
> dired-load-hook.  (I guess I wrote this code years ago when I did
> not know much about emacs.)  Yet suddenly this did not work for me
> anymore, as I had rearranged my init file so that dired got loaded
> before I was setting dired-load-hook.  I suggest to discourage the
> usage of any such load-hook variables: I believe eval-after-load is
> considered to be the cleaner alternative: it does not give rise to
> the type of problems I ran into.  Also it does not require user
> variables for each package.
>
> (Apropos gives me the variables align-load-hook, cal-menu-load-hook,
> calendar-load-hook, dired-load-hook, ediff-load-hook, and
> table-load-hook.  There might be more.)

This suggests that all such variables should be considered obsolete,
since eval-after-load is cleaner.  I think I agree, but I have only
ever used eval-after-load so I might be missing something.

I would suggest to declare the above variables obsolete and point
users to eval-after-load instead.  Does anyone disagree with that?

Best regards,
Stefan Kangas




This bug report was last modified 4 years and 271 days ago.

Previous Next


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