help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: require (was: Re: Hooks in minor modes)


From: Jean Louis
Subject: Re: require (was: Re: Hooks in minor modes)
Date: Sat, 1 May 2021 12:23:20 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Emanuel Berg via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> [2021-05-01 09:11]> script = Elisp source file? If so 
that's the same
> situation here.
> 
> > loading or requiring should take place regardless of current
> > directory
> 
> Ironically that is what is achieved here. Put A and B in the
> the directory and from then on that directory can be anywhere,
> A can still require B with "."

Sorry, I wish I could understand.

If I put script A and script B in the directory ~/tmp and push "."
into load-path, and then during the day move to directory ~/lib I will
not be able to invoke in ~/lib any script neither in M-: eval that
will make the function (load "A") nor (load "B") work. This is because
I have changed current directory.

If I have some bunch of development scripts in
~/Programming/emacs-lisp, then I will put that directory and new
scripts there, so I will be able to load them any time from there,
regardless of the current directory.

> And BTW how do _you_ think it should be done? I should put
> stuff a particular place, then hard-code that? Then add an
> installer that does it so it is exactly like that? And if the
> user doesn't like it - well, tough for HIM, huh, because there
> is nothing he can do about it, like put it somewhere else?
> Because, the hard-coded load paths would then be broken and
> the whole software, also.

I do not use so much "load", rather require.

How it should be done? I think you know it.

Make a package, install it.

In packages I use `require' and not `load', I think every package
directory is added to load-path automatically. So I do not need to
think about load-path at all


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




reply via email to

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