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: autoloads question Date: Mon, 12 May 2008 10:28:01 -0400 Message-ID: References: <20080512100900.GA8357@orion.lan> <20080512105245.GC8357@orion.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210602502 7774 80.91.229.12 (12 May 2008 14:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2008 14:28:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Emanuele Giaquinta Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 12 16:29:00 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JvZ1J-0007MA-3t for ged-emacs-devel@m.gmane.org; Mon, 12 May 2008 16:28:53 +0200 Original-Received: from localhost ([127.0.0.1]:48949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvZ0a-00064h-Sw for ged-emacs-devel@m.gmane.org; Mon, 12 May 2008 10:28:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvZ0X-00064O-CW for emacs-devel@gnu.org; Mon, 12 May 2008 10:28:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvZ0V-00063z-HG for emacs-devel@gnu.org; Mon, 12 May 2008 10:28:04 -0400 Original-Received: from [199.232.76.173] (port=47089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvZ0V-00063w-DS for emacs-devel@gnu.org; Mon, 12 May 2008 10:28:03 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:59844 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JvZ0U-0007Vi-HL for emacs-devel@gnu.org; Mon, 12 May 2008 10:28:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocDAArxJ0jO+JgrdGdsb2JhbACBU5A7ASeYKw X-IronPort-AV: E=Sophos;i="4.27,473,1204520400"; d="scan'208";a="20410746" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 12 May 2008 10:28:02 -0400 Original-Received: from pastel.home ([206.248.152.43]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id STO12502; Mon, 12 May 2008 10:28:02 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C68267F83; Mon, 12 May 2008 10:28:01 -0400 (EDT) In-Reply-To: <20080512105245.GC8357@orion.lan> (Emanuele Giaquinta's message of "Mon, 12 May 2008 12:52:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:97023 Archived-At: >>>>> "Emanuele" == Emanuele Giaquinta writes: > On Mon, May 12, 2008 at 12:42:09PM +0200, Juanma Barranquero wrote: >> On Mon, May 12, 2008 at 12:09 PM, Emanuele Giaquinta >> wrote: >> >> > -;;;;;; "widget.el" "window.el" "x-dnd.el") (18472 4851 825214)) >> > +;;;;;; "widget.el" "window.el" "x-dnd.el") (18472 4853 658506)) >> > >> > Is it expected? >> >> That is a timestamp. > Ah I see, thanks. > It is a bit boring because it causes an unneeded rebuild of emacs. I use the patch below to avoid the problem, Stefan === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2008-05-08 09:38:53 +0000 +++ lisp/emacs-lisp/autoload.el 2008-05-09 20:50:57 +0000 @@ -567,7 +657,8 @@ (directory-files (expand-file-name dir) t files-re)) dirs))) - (done ()) + (done ()) ;Files processed; to remove duplicates. + (changed nil) ;Non-nil if some change occured. (this-time (current-time)) ;; Files with no autoload cookies or whose autoloads go to other ;; files because of file-local autoload-generated-file settings. @@ -611,6 +702,7 @@ ;; File hasn't changed. nil) (t + (setq changed t) (autoload-remove-section (match-beginning 0)) (if (autoload-generate-file-autoloads file (current-buffer) buffer-file-name) @@ -620,7 +712,8 @@ ;; Elements remaining in FILES have no existing autoload sections yet. (dolist (file files) (if (autoload-generate-file-autoloads file nil buffer-file-name) - (push file no-autoloads))) + (push file no-autoloads) + (setq changed t))) (when no-autoloads ;; Sort them for better readability. @@ -632,7 +725,12 @@ (current-buffer) nil nil no-autoloads this-time) (insert generate-autoload-section-trailer)) - (save-buffer) + ;; Don't modify the file if its content has not been changed, so make + ;; dependencies don't trigger unnecessarily. This fails to update the + ;; time-stamp of the `no-autoloads' section, so it may cause redundant + ;; scans of files in future invocations. I.e. it's a trade-off. + (when changed (save-buffer)) + ;; In case autoload entries were added to other files because of ;; file-local autoload-generated-file settings. (autoload-save-buffers))))