Re: How to evaluate forms from a given file?

[email protected]
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
On 2026-03-10, at 10:24, [email protected] wrote:

> [email protected] writes:
>
>>
>> I need to execute Elisp from some file with `emacsclient --eval'.
>> Should I say `emacsclient --eval "(load-file ...)"',  `emacsclient
>> --eval "(load ...)"' or something else?
>>
>
> (info "(elisp) How Programs Do Loading")
>
>  -- Command: load-file filename
>      This command loads the file FILENAME.  If FILENAME is a relative
>      file name, then the current default directory is assumed.  This
>      command does not use ‘load-path’, and does not append suffixes.
>      However, it does look for compressed versions (if Auto Compression
>      Mode is enabled).  Use this command if you wish to specify
>      precisely the file name to load.
>
> So, you will decide whether to use ‘load’ versus ‘load-file’
> depending on how well you know the file’s name and where it
> is located.  (‘load’ also provides additional parameters for
> other conditions.)
>
> Roughly:
> load-file -> load this specific file in this location
> load -> load a file after finding where it is and which
>         form is available

Thanks.  I've seen this part of the manual (obviously), but it left me
unsure about which one should I use, or whether there is a third one,
a lower-level function used by both of these.

Thanks anyway,

-- 
Marcin Borkowski
https://mbork.pl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.