From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: ignoring autoloads in preloaded files on Windows Date: Sat, 10 Oct 2009 17:17:27 -0400 Message-ID: <78tyy7ymmw.fsf@fencepost.gnu.org> References: <83eipfmuaz.fsf@gnu.org> <0my40kr72.fsf@fencepost.gnu.org> <831vlbln4t.fsf@gnu.org> <83pr8vjsne.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255209472 27805 80.91.229.12 (10 Oct 2009 21:17:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Oct 2009 21:17:52 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 10 23:17:42 2009 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 1MwjJs-0004Mj-Uf for ged-emacs-devel@m.gmane.org; Sat, 10 Oct 2009 23:17:41 +0200 Original-Received: from localhost ([127.0.0.1]:49910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwjJs-0001lF-1X for ged-emacs-devel@m.gmane.org; Sat, 10 Oct 2009 17:17:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwjJm-0001k8-P6 for emacs-devel@gnu.org; Sat, 10 Oct 2009 17:17:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwjJh-0001hl-Sm for emacs-devel@gnu.org; Sat, 10 Oct 2009 17:17:34 -0400 Original-Received: from [199.232.76.173] (port=33919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwjJh-0001hi-LD for emacs-devel@gnu.org; Sat, 10 Oct 2009 17:17:29 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:51839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwjJh-0005jE-Ax for emacs-devel@gnu.org; Sat, 10 Oct 2009 17:17:29 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MwjJf-0006rZ-I3; Sat, 10 Oct 2009 17:17:27 -0400 X-Spook: MP5K-SD Etacs JFK Khaddafi Crowell Aldergrove X-Ran: 0`xaGJX=<\oJ#G$oWlxlk|D/a?jN.OKEqTb-YrE^kXgF|(6K`sBq+yfVW+66FZke'oZEG6 X-Hue: red X-Attribution: GM In-Reply-To: <83pr8vjsne.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 10 Oct 2009 15:16:37 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:116075 Archived-At: Thanks for the feedback. Here is a revised version. *** lisp/makefile.w32-in.~1.99.~ 2009-10-08 23:28:21.000000000 -0700 --- lisp/makefile.w32-in 2009-10-10 14:01:28.000000000 -0700 *************** *** 214,220 **** @echo Directories: . $(WINS_UPDATES) $(emacs) -l autoload \ --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ ! -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_UPDATES) $(lisp)/subdirs.el: $(MAKE) $(MFLAGS) update-subdirs --- 214,220 ---- @echo Directories: . $(WINS_UPDATES) $(emacs) -l autoload \ --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ ! -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES) $(lisp)/subdirs.el: $(MAKE) $(MFLAGS) update-subdirs *** lisp/w32-fns.el.~1.97.~ 2009-09-14 19:30:52.000000000 -0700 --- lisp/w32-fns.el 2009-10-10 14:01:19.000000000 -0700 *************** *** 490,496 **** munge command-line arguments that include file names to a horrible mess that Emacs is unable to cope with." (let ((generated-autoload-file ! (expand-file-name (pop command-line-args-left)))) (batch-update-autoloads))) (defun w32-append-code-lines (orig extra) --- 490,497 ---- munge command-line arguments that include file names to a horrible mess that Emacs is unable to cope with." (let ((generated-autoload-file ! (expand-file-name (pop command-line-args-left))) ! (autoload-make-program (pop command-line-args-left))) (batch-update-autoloads))) (defun w32-append-code-lines (orig extra) *** lib-src/makefile.w32-in 27 Sep 2009 08:27:28 -0000 2.101 --- lib-src/makefile.w32-in 10 Oct 2009 21:13:32 -0000 *************** *** 289,294 **** --- 289,299 ---- $(lispsource)window.elc \ $(lispsource)version.el + # Used by batch-update-autoloads. + echolisp: + @echo $(lisp1) + @echo $(lisp2) + # This is needed the first time we build the tree, since temacs.exe # does not exist yet, and the DOC rule needs it to rebuild DOC whenever # Emacs is rebuilt. *************** *** 348,353 **** --- 353,359 ---- - $(DEL) getopt.h - $(DEL_TREE) $(OBJDIR) - $(DEL) stamp_BLD + - $(DEL) echolisp.tmp distclean: cleanall - $(DEL) TAGS *** lisp/emacs-lisp/autoload.el 7 Oct 2009 16:10:37 -0000 1.149 --- lisp/emacs-lisp/autoload.el 10 Oct 2009 21:14:02 -0000 *************** *** 679,684 **** --- 679,687 ---- (define-obsolete-function-alias 'update-autoloads-from-directories 'update-directory-autoloads "22.1") + (defvar autoload-make-program (or (getenv "MAKE") "make") + "Name of the make program in use during the Emacs build process.") + ;;;###autoload (defun batch-update-autoloads () "Update loaddefs.el autoloads in batch mode. *************** *** 686,694 **** ;; For use during the Emacs build process only. (unless autoload-excludes (let* ((ldir (file-name-directory generated-autoload-file)) ! (mfile (expand-file-name "../src/Makefile" ldir)) lim) (when (file-readable-p mfile) (with-temp-buffer (insert-file-contents mfile) (when (re-search-forward "^lisp= " nil t) --- 689,722 ---- ;; For use during the Emacs build process only. (unless autoload-excludes (let* ((ldir (file-name-directory generated-autoload-file)) ! (default-directory ! (file-name-as-directory ! (expand-file-name (if (eq system-type 'windows-nt) ! "../lib-src" ! "../src") ldir))) ! (mfile "Makefile") ! (tmpfile "echolisp.tmp") lim) (when (file-readable-p mfile) + (if (eq system-type 'windows-nt) + (when (ignore-errors + (if (file-exists-p tmpfile) (delete-file tmpfile)) + (shell-command (format "%s echolisp > %s" + autoload-make-program tmpfile)) + (file-readable-p tmpfile)) + (with-temp-buffer + (insert-file-contents tmpfile) + (while (not (eobp)) + (setq lim (line-end-position)) + (while (re-search-forward "\\([^ ]+\\.el\\)c?\\>" lim t) + (push (expand-file-name (match-string 1)) + autoload-excludes)) + (forward-line 1)))) + ;; Non-Windows platforms do not use the echolisp approach + ;; because the maximum safe command-line length for all + ;; supported platforms is unknown. Also it would seem a + ;; shame to split $lisp into $lisp1 etc just for the sake of + ;; this command (Windows requires it for other reasons). (with-temp-buffer (insert-file-contents mfile) (when (re-search-forward "^lisp= " nil t) *************** *** 696,702 **** (while (re-search-forward "\\${lispsource}\\([^ ]+\\.el\\)c?\\>" lim t) (push (expand-file-name (match-string 1) ldir) ! autoload-excludes))))))) (let ((args command-line-args-left)) (setq command-line-args-left nil) (apply 'update-directory-autoloads args))) --- 724,730 ---- (while (re-search-forward "\\${lispsource}\\([^ ]+\\.el\\)c?\\>" lim t) (push (expand-file-name (match-string 1) ldir) ! autoload-excludes)))))))) (let ((args command-line-args-left)) (setq command-line-args-left nil) (apply 'update-directory-autoloads args)))