* bug#910: leim-list.el is looked up in too many places at startup
@ 2008-09-07 11:25 Dan Nicolaescu
2008-09-10 2:04 ` Glenn Morris
0 siblings, 1 reply; 7+ messages in thread
From: Dan Nicolaescu @ 2008-09-07 11:25 UTC (permalink / raw)
To: bug-gnu-emacs
strace emacs -Q
shows that leim-list.el is looked up in 32 locations at startup. We
only have it in a single place.
Is this a leftover from the time when leim was distributed separately
from emacs?
It would be good if this redundant work would be avoided.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
2008-09-07 11:25 bug#910: leim-list.el is looked up in too many places at startup Dan Nicolaescu
@ 2008-09-10 2:04 ` Glenn Morris
2008-09-10 2:19 ` Dan Nicolaescu
2008-09-10 8:11 ` Andreas Schwab
0 siblings, 2 replies; 7+ messages in thread
From: Glenn Morris @ 2008-09-10 2:04 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: 910
Dan Nicolaescu wrote:
> strace emacs -Q
>
> shows that leim-list.el is looked up in 32 locations at startup. We
> only have it in a single place. Is this a leftover from the time
> when leim was distributed separately from emacs?
>
> It would be good if this redundant work would be avoided.
It does seem superfluous. This works for me:
*** startup.el 23 Aug 2008 16:59:19 -0000 1.503
--- startup.el 10 Sep 2008 02:03:52 -0000
***************
*** 478,496 ****
;; Look in each dir in load-path for a subdirs.el file.
;; If we find one, load it, which will add the appropriate subdirs
;; of that dir into load-path,
- ;; Look for a leim-list.el file too. Loading it will register
- ;; available input methods.
(let ((tail load-path) dir)
(while tail
(setq dir (car tail))
(let ((default-directory dir))
(load (expand-file-name "subdirs.el") t t t))
- (let ((default-directory dir))
- (load (expand-file-name "leim-list.el") t t t))
;; We don't use a dolist loop and we put this "setq-cdr" command at
;; the end, because the subdirs.el files may add elements to the end
;; of load-path and we want to take it into account.
(setq tail (cdr tail))))
;; If the PWD environment variable isn't accurate, delete it.
(let ((pwd (getenv "PWD")))
(and (stringp pwd)
--- 478,501 ----
;; Look in each dir in load-path for a subdirs.el file.
;; If we find one, load it, which will add the appropriate subdirs
;; of that dir into load-path,
(let ((tail load-path) dir)
(while tail
(setq dir (car tail))
(let ((default-directory dir))
(load (expand-file-name "subdirs.el") t t t))
;; We don't use a dolist loop and we put this "setq-cdr" command at
;; the end, because the subdirs.el files may add elements to the end
;; of load-path and we want to take it into account.
(setq tail (cdr tail))))
+ ;; Look for a leim-list.el file. Loading it will register
+ ;; available input methods.
+ (let ((leim (expand-file-name "../leim/leim-list.el" data-directory)))
+ (condition-case nil
+ (load leim nil t t)
+ (error
+ (display-warning 'initialization
+ (format "Unable to load LEIM file `%s'" leim)
+ :error))))
;; If the PWD environment variable isn't accurate, delete it.
(let ((pwd (getenv "PWD")))
(and (stringp pwd)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
2008-09-10 2:04 ` Glenn Morris
@ 2008-09-10 2:19 ` Dan Nicolaescu
2008-09-10 4:33 ` Glenn Morris
2008-09-10 8:11 ` Andreas Schwab
1 sibling, 1 reply; 7+ messages in thread
From: Dan Nicolaescu @ 2008-09-10 2:19 UTC (permalink / raw)
To: Glenn Morris; +Cc: 910
Glenn Morris <rgm@gnu.org> writes:
> Dan Nicolaescu wrote:
>
> > strace emacs -Q
> >
> > shows that leim-list.el is looked up in 32 locations at startup. We
> > only have it in a single place. Is this a leftover from the time
> > when leim was distributed separately from emacs?
> >
> > It would be good if this redundant work would be avoided.
>
>
> It does seem superfluous. This works for me:
Thanks!
> *** startup.el 23 Aug 2008 16:59:19 -0000 1.503
> --- startup.el 10 Sep 2008 02:03:52 -0000
> ***************
> *** 478,496 ****
> ;; Look in each dir in load-path for a subdirs.el file.
> ;; If we find one, load it, which will add the appropriate subdirs
> ;; of that dir into load-path,
> - ;; Look for a leim-list.el file too. Loading it will register
> - ;; available input methods.
> (let ((tail load-path) dir)
> (while tail
> (setq dir (car tail))
> (let ((default-directory dir))
> (load (expand-file-name "subdirs.el") t t t))
> - (let ((default-directory dir))
> - (load (expand-file-name "leim-list.el") t t t))
> ;; We don't use a dolist loop and we put this "setq-cdr" command at
> ;; the end, because the subdirs.el files may add elements to the end
> ;; of load-path and we want to take it into account.
> (setq tail (cdr tail))))
> ;; If the PWD environment variable isn't accurate, delete it.
> (let ((pwd (getenv "PWD")))
> (and (stringp pwd)
> --- 478,501 ----
> ;; Look in each dir in load-path for a subdirs.el file.
> ;; If we find one, load it, which will add the appropriate subdirs
> ;; of that dir into load-path,
> (let ((tail load-path) dir)
> (while tail
> (setq dir (car tail))
> (let ((default-directory dir))
> (load (expand-file-name "subdirs.el") t t t))
> ;; We don't use a dolist loop and we put this "setq-cdr" command at
> ;; the end, because the subdirs.el files may add elements to the end
> ;; of load-path and we want to take it into account.
> (setq tail (cdr tail))))
> + ;; Look for a leim-list.el file. Loading it will register
> + ;; available input methods.
> + (let ((leim (expand-file-name "../leim/leim-list.el" data-directory)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This won't work when building in a separate directory:
leim-list.el is generated in the build tree, not the
source tree (unlike what happens for .elc files...)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
2008-09-10 2:19 ` Dan Nicolaescu
@ 2008-09-10 4:33 ` Glenn Morris
2008-09-10 6:50 ` Glenn Morris
0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2008-09-10 4:33 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: 910
Dan Nicolaescu wrote:
> > + (let ((leim (expand-file-name "../leim/leim-list.el" data-directory)))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This won't work when building in a separate directory:
> leim-list.el is generated in the build tree, not the
> source tree (unlike what happens for .elc files...)
Looks like I can just use doc-directory instead of data-directory
here, and all will be well.
The only question is, if people are supposed to be able to have
multiple leim-list files, or to be able to add their own. I guess not?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
2008-09-10 4:33 ` Glenn Morris
@ 2008-09-10 6:50 ` Glenn Morris
0 siblings, 0 replies; 7+ messages in thread
From: Glenn Morris @ 2008-09-10 6:50 UTC (permalink / raw)
To: 910; +Cc: Dan Nicolaescu
The original was also binding default-directory for some reason, so
here is a revised patch in case that matters.
Without having thought about it much, if leim-list is always loaded,
why isn't it dumped?
*** startup.el 23 Aug 2008 16:59:19 -0000 1.503
--- startup.el 10 Sep 2008 06:49:37 -0000
***************
*** 478,496 ****
;; Look in each dir in load-path for a subdirs.el file.
;; If we find one, load it, which will add the appropriate subdirs
;; of that dir into load-path,
- ;; Look for a leim-list.el file too. Loading it will register
- ;; available input methods.
(let ((tail load-path) dir)
(while tail
(setq dir (car tail))
(let ((default-directory dir))
(load (expand-file-name "subdirs.el") t t t))
- (let ((default-directory dir))
- (load (expand-file-name "leim-list.el") t t t))
;; We don't use a dolist loop and we put this "setq-cdr" command at
;; the end, because the subdirs.el files may add elements to the end
;; of load-path and we want to take it into account.
(setq tail (cdr tail))))
;; If the PWD environment variable isn't accurate, delete it.
(let ((pwd (getenv "PWD")))
(and (stringp pwd)
--- 478,505 ----
;; Look in each dir in load-path for a subdirs.el file.
;; If we find one, load it, which will add the appropriate subdirs
;; of that dir into load-path,
(let ((tail load-path) dir)
(while tail
(setq dir (car tail))
(let ((default-directory dir))
(load (expand-file-name "subdirs.el") t t t))
;; We don't use a dolist loop and we put this "setq-cdr" command at
;; the end, because the subdirs.el files may add elements to the end
;; of load-path and we want to take it into account.
(setq tail (cdr tail))))
+ ;; Load leim-list.el to register available input methods.
+ ;; Bug#910. We used to look for it in each directory in load-path.
+ ;; This is no longer necessary since leim is distributed with Emacs.
+ ;; doc-directory is used rather than data-directory for
+ ;; non-source-directory builds running uninstalled.
+ (let* ((leim (expand-file-name "../leim/leim-list.el" doc-directory))
+ (default-directory (file-name-directory leim)))
+ (condition-case nil
+ (load leim nil t t)
+ (error
+ (display-warning 'initialization
+ (format "Unable to load LEIM file `%s'" leim)
+ :error))))
;; If the PWD environment variable isn't accurate, delete it.
(let ((pwd (getenv "PWD")))
(and (stringp pwd)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
2008-09-10 2:04 ` Glenn Morris
2008-09-10 2:19 ` Dan Nicolaescu
@ 2008-09-10 8:11 ` Andreas Schwab
1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2008-09-10 8:11 UTC (permalink / raw)
To: Glenn Morris; +Cc: 910, Dan Nicolaescu
Glenn Morris <rgm@gnu.org> writes:
> Dan Nicolaescu wrote:
>
>> strace emacs -Q
>>
>> shows that leim-list.el is looked up in 32 locations at startup. We
>> only have it in a single place. Is this a leftover from the time
>> when leim was distributed separately from emacs?
>>
>> It would be good if this redundant work would be avoided.
>
>
> It does seem superfluous.
Extensions can and do add their own leim-list.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#910: leim-list.el is looked up in too many places at startup
@ 2009-10-23 5:37 Dan Nicolaescu
0 siblings, 0 replies; 7+ messages in thread
From: Dan Nicolaescu @ 2009-10-23 5:37 UTC (permalink / raw)
To: 910
tags 910 - wontfix
quit
See http://permalink.gmane.org/gmane.emacs.devel/116301
for Handa-san's opinion on how this should be handled.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-10-23 5:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-07 11:25 bug#910: leim-list.el is looked up in too many places at startup Dan Nicolaescu
2008-09-10 2:04 ` Glenn Morris
2008-09-10 2:19 ` Dan Nicolaescu
2008-09-10 4:33 ` Glenn Morris
2008-09-10 6:50 ` Glenn Morris
2008-09-10 8:11 ` Andreas Schwab
-- strict thread matches above, loose matches on Subject: below --
2009-10-23 5:37 Dan Nicolaescu
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.