unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: help-gnu-emacs@gnu.org
Subject: Re: require (was: Re: Hooks in minor modes)
Date: Sat, 1 May 2021 12:23:20 +0300	[thread overview]
Message-ID: <YI0eCN2qvqTygHbO@protected.localdomain> (raw)
In-Reply-To: <877dkjdlxm.fsf@zoho.eu>

* 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	other threads:[~2021-05-01  9:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 23:33 Hooks in minor modes steve-humphreys
2021-04-29 23:43 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30  3:31 ` Stefan Monnier
2021-04-30  4:12   ` steve-humphreys
2021-04-30  4:33     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30  4:43       ` require (was: Re: Hooks in minor modes) Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30  5:03         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30  5:44           ` Jean Louis
2021-04-30 21:53             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 23:16               ` Jean Louis
2021-05-01  0:26                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01  5:49                   ` Jean Louis
2021-05-01  6:09                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01  9:23                       ` Jean Louis [this message]
2021-05-04  2:29                         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-04  5:40                           ` Yuri Khan
2021-05-04  6:02                             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 17:27           ` FW: [External] : " Drew Adams
2021-04-30 22:17             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01  0:49               ` FW: " Drew Adams
2021-05-01  0:53                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30  5:17     ` Hooks in minor modes Stefan Monnier
2021-04-30  5:32       ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YI0eCN2qvqTygHbO@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).