emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs.exe --load FILE and current directory on w32


From: Lennart Borgman
Subject: Re: emacs.exe --load FILE and current directory on w32
Date: Sun, 05 Jun 2005 10:06:37 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Eli Zaretskii wrote:

I get the same behavior on GNU/Linux, both with the current CVS and

with Emacs 21.3.

I think Emacs always behaved like that.  The manual is simplifying a
bit: you will see in startup.el that we try to find the file in the
_default_ directory; if we visited a file before processing -l, that
is no longer the current directory, but rather the directory of the
visited file.  I'm not sure this subtlety needs to be documented,
except, perhaps in a footnote.

Info says:

`-l FILE'
`--load=FILE'
    Load a Lisp library named FILE with the function `load'.  *Note
    Lisp Libraries::.  If FILE is not an absolute file name, the
    library can be found either in the current directory, or in the
    Emacs library search path as specified with `EMACSLOADPATH' (*note
    General Variables::).

I think "current directory" in this context must mean the current directory for the program starting Emacs.

I would say that the preffered way to work would be just that. The current behaviour is unexpected and confusing. load-library does not search Emacs current directory. Then why should the --load startup argument do that?

However what is preferred to do in this situation is another thing. Maybe just change it to something like:

    FILE is not an absolute file name, the library can be found either in
    Emacs current directory, or in the Emacs library search path as
    specified with `EMACSLOADPATH' (*note General Variables::).

    Note: Emacs current directory might be different from the current
    directory in the context where Emacs is invoked. This will be the
    case when for example a file to visit is found before --load on
    the command line.

But I think it is rather ugly and I do not know if it is correct. Must the file to visit be before --load? This subtle difficulties could be avoided if the behaviour was changed.




reply via email to

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