() Eli Zaretskii <e...@gnu.org>
() Sat, 17 Nov 2012 13:02:47 +0200
Sorry, I just couldn't imagine that someone will not know about
buffer-file-name and current-buffer.
To be fair, guessing those requires knowing something about how ‘load’
works. Emacs is buffer-centric so it ‘load’s by first populating a
buffer then ‘read’ing from it. Guile, as a counter-example, implements
‘load’ by ‘read’ing from a "port". Other systems might mmap(2) or talk
to a daemon or whatever.
I see that (info "(emacs) Lisp Libraries")
To "load" an Emacs Lisp file, type `M-x load-file'. This command reads
a file name using the minibuffer, and executes the contents of that
file as Emacs Lisp code. It is not necessary to visit the file first;
this command reads the file directly from disk, not from an existing
In (info "(elisp) How Programs Do Loading")
there is a bit more:
Whatever the name under which the file is eventually found, and the
directory where Emacs found it, Emacs sets the value of the variable
`load-file-name' to that file's name.
When loading a source file (not compiled), `load' performs
character set translation just as Emacs would do when visiting the
file. *Note Coding Systems::.
but again, how ‘load’ actually does its job is never detailed. To my
ears, this is a just omission, and thus OP's question has some merit.
Thien-Thi Nguyen ..................................... GPG key: 4C807502
. NB: ttn at glug dot org is not me .
. (and has not been since 2007 or so) .
. ACCEPT NO SUBSTITUTES .
........... please send technical questions to mailing lists ...........