From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Changes in lisp/Makefile.in to skip preloaded files Date: Tue, 06 Oct 2009 11:25:53 +0200 Message-ID: <8363asoov2.fsf@gnu.org> References: <837hv9neza.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1254821299 11650 80.91.229.12 (6 Oct 2009 09:28:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2009 09:28:19 +0000 (UTC) To: rgm@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 06 11:28:11 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 1Mv6L4-0000pd-4r for ged-emacs-devel@m.gmane.org; Tue, 06 Oct 2009 11:28:10 +0200 Original-Received: from localhost ([127.0.0.1]:53460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mv6L3-0005Yx-H3 for ged-emacs-devel@m.gmane.org; Tue, 06 Oct 2009 05:28:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mv6Ku-0005Xo-62 for emacs-devel@gnu.org; Tue, 06 Oct 2009 05:28:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mv6Ks-0005XQ-2H for emacs-devel@gnu.org; Tue, 06 Oct 2009 05:27:58 -0400 Original-Received: from [199.232.76.173] (port=54030 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mv6Kr-0005XN-SF for emacs-devel@gnu.org; Tue, 06 Oct 2009 05:27:57 -0400 Original-Received: from mtaout5.012.net.il ([84.95.2.13]:36369) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mv6Kp-0006db-Bf; Tue, 06 Oct 2009 05:27:55 -0400 Original-Received: from conversion-daemon.i_mtaout5.012.net.il by i_mtaout5.012.net.il (HyperSendmail v2004.12) id <0KR300G00611WI00@i_mtaout5.012.net.il>; Tue, 06 Oct 2009 11:27:54 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.224.43]) by i_mtaout5.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KR3002NF6AHBIE0@i_mtaout5.012.net.il>; Tue, 06 Oct 2009 11:27:54 +0200 (IST) In-reply-to: <837hv9neza.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:115917 Archived-At: > Date: Tue, 06 Oct 2009 09:44:41 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > -autoloads: $(LOADDEFS) doit > > +# The Makefile dependency is to make any missing-file error more explicit. > > +autoloads: $(LOADDEFS) ../src/Makefile doit > > chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \ > > $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \ > > $(lisp)/dired.el $(lisp)/ibuffer.el > > wd=$(lisp); $(setwins_almost); \ > > echo Directories: $$wins; \ > > - $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins > > + preload=`sed -n -e '/^lisp=/ s/$${lispsource}//g p' ../src/Makefile | \ > > + sed 's/^lisp= //'`; \ > > + $(emacs) -l autoload --eval "(setq generated-autoload-file \"$(lisp)/loaddefs.el\" autoload-excludes \"$${preload}\")" -f batch-update-autoloads $$wins > > src/Makefile gets recreated every time you run the configure script, > so this change will now cause autoloads to appear out of date after > every configure. Is that what you really want? Should autoloads > depend on src/Makefile.in instead? > > Similar with the preload= thing: why not run Sed on src/Makefile.in? > src/Makefile could be botched by some snafu; why both the lisp > directory on that behalf as well? I think I see the reason for the latter: it's because src/Makefile.in spells out $lisp spanned over many lines, whereas src/Makefile has them all in the same line, which simplifies the job of th Sed script to some extent. Anyway, I cannot say that I like this solution. In particular, it cannot be ported to w32, because the list of preloaded files is too long and overflows the max size of command lines on some Windows systems (lib-src/makefile.w32-in breaks it into 3 lists for that very reason). I can think about 2 alternatives which are better (IMO): . Add to src/Makefile.in a new target `echolisp' which will simply run "@echo $(lisp)". Then initialize autoload-excludes with something like (shell-command-to-string "make -C ../src echolisp"). (This will probably need some tweaking on w32, because of the same limitation of command-line size, but that's much easier done than with the current approach.) . Modify loadup.el to map `load' over a list of files, instead of having multiple `(load FOO)' lines. That is, replace each line now saying "(load FOO)" with "(add-to-list 'load-list FOO)"; then map `load' on the result when the list is complete. With this approach, `load-list' will have the list of preloaded files ready for use by autoload.el. WDYT? P.S. I generally find any Make or shell/Sed trickery misplaced in Emacs Makefiles, since we have the full power of Emacs at our fingertips. Portability is one obvious advantage, but more importantly, it sounds right, in the context of building Emacs, to use Emacs itself wherever we can. Otherwise, we appear as not believing in the tool we are developing. Don't you agree?