leim-list.el and registering input methods

View: New views
8 Messages — Rating Filter:   Alert me  

leim-list.el and registering input methods

by Dan Nicolaescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Is there a reason that input methods are not registered in the dumped image?
Instead they are registered at run time, even in batch mode:

$ strace -o out.strace /usr/bin/emacs-23.1 -Q -batch -f kill-emacs
$ grep leim-list.el out.strace
stat64("/usr/share/emacs/23.1/site-lisp/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/site-lisp/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/site-lisp/site-start.d/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/url/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/textmodes/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/progmodes/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/play/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/org/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/nxml/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/net/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/mh-e/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/mail/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/language/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/international/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/gnus/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/eshell/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/erc/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/emulation/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/emacs-lisp/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/calendar/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/calc/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/lisp/obsolete/leim-list.el", 0xbfee0dc8) = -1 ENOENT (No such file or directory)
stat64("/usr/share/emacs/23.1/leim/leim-list.el", {st_mode=S_IFREG|0644, st_size=26950, ...}) = 0
open("/usr/share/emacs/23.1/leim/leim-list.el", O_RDONLY|O_LARGEFILE) = 3
read(3, ";;; leim-list.el -- list of LEIM "..., 511) = 511
stat64("/usr/share/emacs/23.1/leim/leim-list.el", {st_mode=S_IFREG|0644, st_size=26950, ...}) = 0
open("/usr/share/emacs/23.1/leim/leim-list.el", O_RDONLY|O_LARGEFILE) = 3
stat64("/usr/share/emacs/23.1/leim/leim-list.el", {st_mode=S_IFREG|0644, st_size=26950, ...}) = 0
open("/usr/share/emacs/23.1/leim/leim-list.el", O_RDONLY|O_LARGEFILE) = 3
read(3, ";;; leim-list.el -- list of LEIM "..., 26950) = 26950
readlink("/usr/share/emacs/23.1/leim/leim-list.el", 0x85489d0, 100) = -1 EINVAL (Invalid argument)

Wouldn't it be better if all these things where done before dumping?





Re: leim-list.el and registering input methods

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Is there a reason that input methods are not registered in the dumped image?

Probably a remnant from the days where leim was distributed separately
from Emacs.  It would be good to move it to dump time.  But please be
careful to still make it possible to have additional input-methods
recognized at startup (not sure how it's supposed to work currently, so
maybe there's nothing special to do for that).


        Stefan



Re: leim-list.el and registering input methods

by Dan Nicolaescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Monnier <monnier@...> writes:

  > > Is there a reason that input methods are not registered in the dumped image?
  >
  > Probably a remnant from the days where leim was distributed separately
  > from Emacs.  It would be good to move it to dump time.  

Good.
I'll open a bug for this, I don't know enough about how this stuff works
to do it myself.

  > But please be
  > careful to still make it possible to have additional input-methods
  > recognized at startup (not sure how it's supposed to work currently, so
  > maybe there's nothing special to do for that).

Currently there's a search for leim-list.el in load-path (see the strace
log in my original message).
Shouldn't this search be more restricted, like what we do for
site-start.el and default.el?



Re: leim-list.el and registering input methods

by Kenichi Handa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In article <200910210708.n9L78Qkg004553@...>, Dan Nicolaescu <dann@...> writes:

> Is there a reason that input methods are not registered in the dumped image?
> Instead they are registered at run time, even in batch mode:

For those having their own input methods.  They can have
their own leim-list.el in somewhere in the load-path.

But, I think there's no reason to search these directories:

/usr/share/emacs/23.1/lisp/url/
/usr/share/emacs/23.1/lisp/textmodes/
/usr/share/emacs/23.1/lisp/progmodes/
/usr/share/emacs/23.1/lisp/play/
/usr/share/emacs/23.1/lisp/org/
/usr/share/emacs/23.1/lisp/nxml/
/usr/share/emacs/23.1/lisp/net/
/usr/share/emacs/23.1/lisp/mh-e/
/usr/share/emacs/23.1/lisp/mail/
/usr/share/emacs/23.1/lisp/language/
/usr/share/emacs/23.1/lisp/international/
/usr/share/emacs/23.1/lisp/gnus/
/usr/share/emacs/23.1/lisp/eshell/
/usr/share/emacs/23.1/lisp/erc/
/usr/share/emacs/23.1/lisp/emulation/
/usr/share/emacs/23.1/lisp/emacs-lisp/
/usr/share/emacs/23.1/lisp/calendar/
/usr/share/emacs/23.1/lisp/calc/
/usr/share/emacs/23.1/lisp/obsolete/

So...

> Currently there's a search for leim-list.el in load-path (see the strace
> log in my original message).
> Shouldn't this search be more restricted, like what we do for
> site-start.el and default.el?

I agree.  But, we must also search the directories added to
load-path by users.

---
Kenichi Handa
handa@...




Re: leim-list.el and registering input methods

by Dan Nicolaescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Monnier <monnier@...> writes:

  > > Is there a reason that input methods are not registered in the dumped image?
  >
  > Probably a remnant from the days where leim was distributed separately
  > from Emacs.  It would be good to move it to dump time.  But please be
  > careful to still make it possible to have additional input-methods
  > recognized at startup (not sure how it's supposed to work currently, so
  > maybe there's nothing special to do for that).

Here's one way to do this: check in the current emacs/leim/leim-list.el
to emacs/lisp/builtin-leim-list.el (or a better name?), and change the
emacs/leim/Makefile.in to build a file with a different name.

Whenever emacs/leim/* changes, then emacs/leim/builtin-leim-list.el
needs to be updated (like we do with ldefs-boot.el).

OK to check in something like this?




Re: leim-list.el and registering input methods

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Here's one way to do this: check in the current emacs/leim/leim-list.el
> to emacs/lisp/builtin-leim-list.el (or a better name?),

Of course not: it's a generated file and there's no reason to keep it
in the CVS.  But renaming it is perfectly fine, yes.


        Stefan



Re: leim-list.el and registering input methods

by Dan Nicolaescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Monnier <monnier@...> writes:

  > > Here's one way to do this: check in the current emacs/leim/leim-list.el
  > > to emacs/lisp/builtin-leim-list.el (or a better name?),
  >
  > Of course not: it's a generated file and there's no reason to keep it
  > in the CVS.  But renaming it is perfectly fine, yes.

The reason to check it in is that there's a bootstrap problem with it:
it gets created after dumping emacs, and we want to put the file in the
dumped image.



Re: leim-list.el and registering input methods

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> > Here's one way to do this: check in the current emacs/leim/leim-list.el
>> > to emacs/lisp/builtin-leim-list.el (or a better name?),
>> Of course not: it's a generated file and there's no reason to keep it
>> in the CVS.  But renaming it is perfectly fine, yes.
> The reason to check it in is that there's a bootstrap problem with it:
> it gets created after dumping emacs, and we want to put the file in the
> dumped image.

Then we should change the build order so it can be built by
src/bootstrap-emacs.


        Stefan