From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: mh-e/mh-acros.el advices `require' incorrectly Date: Fri, 13 Jan 2006 16:45:15 -0500 Message-ID: <87hd87g62x.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137190861 30966 80.91.229.2 (13 Jan 2006 22:21:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2006 22:21:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 13 23:20:58 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ExXHv-0002ip-EP for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2006 23:20:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExXK4-0007lZ-9p for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2006 17:23:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ExWli-0004a1-Nn for emacs-devel@gnu.org; Fri, 13 Jan 2006 16:47:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ExWle-0004ZE-Nr for emacs-devel@gnu.org; Fri, 13 Jan 2006 16:47:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExWle-0004ZA-K7 for emacs-devel@gnu.org; Fri, 13 Jan 2006 16:47:30 -0500 Original-Received: from [209.226.175.97] (helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ExWoh-0005RS-Cq for emacs-devel@gnu.org; Fri, 13 Jan 2006 16:50:39 -0500 Original-Received: from alfajor ([67.71.26.73]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060113214515.BJCU5216.tomts40-srv.bellnexxia.net@alfajor>; Fri, 13 Jan 2006 16:45:15 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 97763D736A; Fri, 13 Jan 2006 16:45:15 -0500 (EST) Original-To: Kenichi Handa In-Reply-To: (Kenichi Handa's message of "Fri, 13 Jan 2006 16:49:48 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49031 Archived-At: > *** 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. Stefan --- 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 byte-compile-dest-file)