[Top][All Lists]

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

Re: mh-e/mh-acros.el advices `require' incorrectly

From: Stefan Monnier
Subject: Re: mh-e/mh-acros.el advices `require' incorrectly
Date: Fri, 13 Jan 2006 16:45:15 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> *** mh-acros.el       13 Jan 2006 10:27:43 +0900      1.13
> --- mh-acros.el       13 Jan 2006 16:45:04 +0900      
> ***************
> *** 152,161 ****
>   (defadvice require (around mh-prefer-el activate)
>     "Modify `require' to load uncompiled MH-E files."
> !   (or (featurep (ad-get-arg 0))
> !       (and (string-match "^mh-" (symbol-name (ad-get-arg 0)))
> !            (load (format "%s.el" (ad-get-arg 0)) t t))
> !       ad-do-it))
For what it's worth:
We usually try to avoid defadvice within Emacs and I think for
good reasons.  Now, some elisp packages do you use defadvice, but they only
only do it when it's absolutely necessary.  The above advice seem to be just
a minor convenience hack to making recompiling occasionally easier.

I'd rather try and come up with a generic fix for the problem.
I personally use the patch below for now.


--- orig/lisp/emacs-lisp/bytecomp.el
+++ mod/lisp/emacs-lisp/bytecomp.el
@@ -1640,6 +1640,12 @@
   ;; Force logging of the file name for each file compiled.
   (setq byte-compile-last-logged-file nil)
   (let ((byte-compile-current-file filename)
+        ;; Prefer source files over compiled files.  This is so that when
+        ;; several files are changed and recompiled, each new file is
+        ;; properly recompiled with the new macros in the other new files.
+        (load-suffixes (sort (copy-sequence load-suffixes)
+                             (lambda (s1 s2) (and (string-match "\\.elc\\b" s2)
+                                             (string-match "\\.el\\b" s1)))))
        (set-auto-coding-for-load t)
        target-file input-buffer output-buffer

reply via email to

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