From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: emacs trying to load too many files at startup Date: Sun, 20 Nov 2005 18:23:15 -0500 Message-ID: References: <200511191831.jAJIVJTp026147@scanner2.ics.uci.edu> <200511191950.jAJJo0Tp029512@scanner2.ics.uci.edu> <200511192017.jAJKHbTp000578@scanner2.ics.uci.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1132529435 11866 80.91.229.2 (20 Nov 2005 23:30:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 20 Nov 2005 23:30:35 +0000 (UTC) Cc: eliz@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 21 00:30:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EdycF-0000Ta-Ox for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2005 00:29:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EdycF-0003sJ-51 for ged-emacs-devel@m.gmane.org; Sun, 20 Nov 2005 18:28:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EdyWj-0007wg-G8 for emacs-devel@gnu.org; Sun, 20 Nov 2005 18:23:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EdyWi-0007wM-RP for emacs-devel@gnu.org; Sun, 20 Nov 2005 18:23:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EdyWi-0007wF-O9 for emacs-devel@gnu.org; Sun, 20 Nov 2005 18:23:16 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EdyWi-0001hp-Oj for emacs-devel@gnu.org; Sun, 20 Nov 2005 18:23:16 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EdyWh-0001tc-8F; Sun, 20 Nov 2005 18:23:15 -0500 Original-To: Dan Nicolaescu In-reply-to: <200511192017.jAJKHbTp000578@scanner2.ics.uci.edu> (message from Dan Nicolaescu on Sat, 19 Nov 2005 12:17:35 -0800) 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:46378 Archived-At: The reason I designed this code this way ;; Convert preloaded file names to absolute. (setq load-history (mapcar (lambda (elt) (if (and (stringp (car elt)) (not (file-name-absolute-p (car elt)))) (cons (locate-file (car elt) load-path load-suffixes) (cdr elt)) elt)) load-history)) rather than recording the absolute file names right away is because the files usually move between building and execution. (For instance, `make install' moves them.) But there are surely faster ways to do this job. How about this? *** startup.el 19 Nov 2005 18:34:55 -0500 1.389 --- startup.el 20 Nov 2005 13:24:18 -0500 *************** *** 642,656 **** (set-locale-environment nil) ;; Convert preloaded file names to absolute. ! (setq load-history ! (mapcar (lambda (elt) ! (if (and (stringp (car elt)) ! (not (file-name-absolute-p (car elt)))) ! (cons (locate-file (car elt) load-path ! load-suffixes) ! (cdr elt)) ! elt)) ! load-history)) ;; Convert the arguments to Emacs internal representation. (let ((args (cdr command-line-args))) --- 642,663 ---- (set-locale-environment nil) ;; Convert preloaded file names to absolute. ! (let ((lisp-dir ! (file-name-directory ! (locate-file "simple" load-path ! load-suffixes)))) ! ! (setq load-history ! (mapcar (lambda (elt) ! (if (and (stringp (car elt)) ! (not (file-name-absolute-p (car elt)))) ! (cons (concat lisp-dir ! (car elt) ! (if (string-match "[.]el$" (car elt)) ! "" ".elc")) ! (cdr elt)) ! elt)) ! load-history))) ;; Convert the arguments to Emacs internal representation. (let ((args (cdr command-line-args)))