emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs trying to load too many files at startup


From: Richard M. Stallman
Subject: Re: emacs trying to load too many files at startup
Date: Sun, 20 Nov 2005 18:23:15 -0500

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)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]