unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Strange eval-after-load
@ 2006-05-26  2:22 Richard Stallman
  2006-05-26  7:59 ` Eli Zaretskii
  2006-07-02 13:33 ` Hi, I'm back! + " Alan Mackenzie
  0 siblings, 2 replies; 47+ messages in thread
From: Richard Stallman @ 2006-05-26  2:22 UTC (permalink / raw)


I was distressed to read that there are 70 calls to eval-after-load in
the Emacs sources.  That is very bad.  After the release, we should eliminate all of these,
just as we should eliminate all use of defadvice.

Starting immediately, please do NOT install calls to eval-after-load
in Emacs without asking for my specific approval.


In some cases, a file specifies eval-after-load for itself!  For
instance, msb.el ends with

    (provide 'msb)
    (eval-after-load "msb" '(run-hooks 'msb-after-load-hook 'msb-after-load-hooks))

What is it trying to do?
Why not just call run-hooks directly,
testing (featurep 'msb) before calling provide?

And look at these crocks in net/tramp.el

(unless (featurep 'xemacs)
  (eval-after-load "tramp"
    '(progn
       (require 'tramp-ftp)
       (add-hook 'tramp-unload-hook
		 '(lambda ()
		    (when (featurep 'tramp-ftp)
		      (unload-feature 'tramp-ftp 'force)))))))
(when (and tramp-unified-filenames (featurep 'xemacs))
  (eval-after-load "tramp"
    '(progn
       (require 'tramp-efs)
       (add-hook 'tramp-unload-hook
		 '(lambda ()
		    (when (featurep 'tramp-efs)
		      (unload-feature 'tramp-efs 'force)))))))

Why not do them the straightforward way, at the end?


However, confusing as these are, they are not as bad as using
`eval-after-load' in the "usual" way, for another file.  That is bad
for maintenance just as use of advice is bad for maintenance.

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2006-07-07 11:46 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26  2:22 Strange eval-after-load Richard Stallman
2006-05-26  7:59 ` Eli Zaretskii
2006-05-26 14:20   ` Luc Teirlinck
2006-05-26 19:32     ` Eli Zaretskii
2006-05-27  3:36   ` Richard Stallman
2006-07-02 13:33 ` Hi, I'm back! + " Alan Mackenzie
2006-07-02 17:28   ` Thien-Thi Nguyen
2006-07-02 19:18     ` Alan Mackenzie
2006-07-03 15:05       ` Richard Stallman
2006-07-03 17:16         ` Alan Mackenzie
2006-07-03 16:28           ` Michael Albinus
2006-07-03 17:06           ` John Paul Wallington
2006-07-03 21:54             ` Alan Mackenzie
2006-07-03 21:48               ` Johan Bockgård
2006-07-04 12:54           ` Richard Stallman
2006-07-04 15:02             ` Alan Mackenzie
2006-07-04 20:52               ` Richard Stallman
2006-07-04 21:41                 ` Bob Rogers
2006-07-05 16:38                   ` Stuart D. Herring
2006-07-05 17:01                   ` Richard Stallman
2006-07-02 22:30   ` Hi, I'm back! + " Richard Stallman
2006-07-03 10:57     ` Alan Mackenzie
2006-07-03 10:21       ` David Kastrup
2006-07-03 13:50         ` Alan Mackenzie
2006-07-03 23:21           ` Richard Stallman
2006-07-04  8:02             ` Alan Mackenzie
2006-07-04  7:15               ` David Kastrup
2006-07-04 10:04                 ` Alan Mackenzie
2006-07-04  9:23                   ` David Kastrup
2006-07-04 10:00                     ` Nick Roberts
2006-07-04 13:08                       ` Johan Bockgård
2006-07-04 14:17               ` Thien-Thi Nguyen
2006-07-04 17:30               ` Richard Stallman
2006-07-04 21:08                 ` Alan Mackenzie
2006-07-04 21:48                   ` Nick Roberts
2006-07-05  3:20                   ` Eli Zaretskii
2006-07-05  8:57                     ` Alan Mackenzie
2006-07-05  9:09                       ` David Kastrup
2006-07-05 22:28                         ` Alan Mackenzie
2006-07-06  6:49                           ` David Kastrup
2006-07-07  4:14                           ` Richard Stallman
2006-07-07 11:46                             ` Alan Mackenzie
2006-07-05 17:02                     ` Richard Stallman
2006-07-05 14:51                   ` Richard Stallman
2006-07-05 18:01                     ` Alan Mackenzie
2006-07-03 23:21       ` Richard Stallman
2006-07-03 23:21       ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).