emacs-devel
[Top][All Lists]
Advanced

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

Strange eval-after-load


From: Richard Stallman
Subject: Strange eval-after-load
Date: Thu, 25 May 2006 22:22:57 -0400

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.




reply via email to

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