From: uzibalqa <uzibalqa@proton.me>
To: uzibalqa via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Add code from other files
Date: Thu, 04 Jul 2024 12:10:37 +0000 [thread overview]
Message-ID: <_PaeWZsPmOkMG6EHs5Q_pGgCKfPN6KS5G97LT-TdrvMPSwG-KP24LmGkPsei8HjCBOai36qQUA5h-XeSeyQ2OoB49djwEFS5RjWzONWiAG4=@proton.me> (raw)
In-Reply-To: <SxRPEQkups5RAB4wfD8msM9ggAwSxaOuYjUV59-Pxcn5TgvbJgDPPqP1zLvhdl6zG3K-7t_YaVzemmmdxMwUh3avOOXJALTilqiHvtdbVnU=@proton.me>
On Thursday, July 4th, 2024 at 11:19 AM, uzibalqa <uzibalqa@proton.me> wrote:
> On Thursday, July 4th, 2024 at 11:11 AM, Basile Starynkevitch basile@starynkevitch.net wrote:
>
> > On 7/4/24 13:03, uzibalqa wrote:
> >
> > > On Thursday, July 4th, 2024 at 3:49 AM, Basile Starynkevitch basile@starynkevitch.net wrote:
> > >
> > > > On 7/4/24 01:44, uzibalqa wrote:
> > > >
> > > > > I have a file and want to add the code from other files to it. What does one do ?
> > > >
> > > > You should explain more. Are you thinking of Elisp code? GNU emacs can
> > > > be used to edit non-code files (eg LaTeX documents)
> > > >
> > > > --
> > > > Basile STARYNKEVITCH basile@starynkevitch.net
> > > > I have an elisp file and want to include the functionality present in another .el file.
> >
> > Can't you use the load primitive function of Elisp
> >
> > > load is a primitive-function in ‘C source code’.
> > >
> > > (load FILE &optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX)
> > >
> > > Execute a file of Lisp code named FILE.
> > > First try FILE with ‘.elc’ appended, then try with ‘.el’, then try
> > > with a system-dependent suffix of dynamic modules (see ‘load-suffixes’),
> > > then try FILE unmodified (the exact suffixes in the exact order are
> > > determined by ‘load-suffixes’). Environment variable references in
> > > FILE are replaced with their values by calling ‘substitute-in-file-name’.
> > > This function searches the directories in ‘load-path’.
> > >
> > > If optional second arg NOERROR is non-nil,
> > > report no error if FILE doesn’t exist.
> > > Print messages at start and end of loading unless
> > > optional third arg NOMESSAGE is non-nil (but ‘force-load-messages’
> > > overrides that).
> > > If optional fourth arg NOSUFFIX is non-nil, don’t try adding
> > > suffixes to the specified name FILE.
> > > If optional fifth arg MUST-SUFFIX is non-nil, insist on
> > > the suffix ‘.elc’ or ‘.el’ or the module suffix; don’t accept just
> > > FILE unless it ends in one of those suffixes or includes a directory name.
> > >
> > > If NOSUFFIX is nil, then if a file could not be found, try looking for
> > > a different representation of the file by adding non-empty suffixes to
> > > its name, before trying another file. Emacs uses this feature to find
> > > compressed versions of files when Auto Compression mode is enabled.
> > > If NOSUFFIX is non-nil, disable this feature.
> > >
> > > The suffixes that this function tries out, when NOSUFFIX is nil, are
> > > given by the return value of ‘get-load-suffixes’ and the values listed
> > > in ‘load-file-rep-suffixes’. If MUST-SUFFIX is non-nil, only the
> > > return value of ‘get-load-suffixes’ is used, i.e. the file name is
> > > required to have a non-empty suffix.
> > >
> > > When searching suffixes, this function normally stops at the first
> > > one that exists. If the option ‘load-prefer-newer’ is non-nil,
> > > however, it tries all suffixes, and uses whichever file is the newest.
> > >
> > > Loading a file records its definitions, and its ‘provide’ and
> > > ‘require’ calls, in an element of ‘load-history’ whose
> > > car is the file name loaded. See ‘load-history’.
> > >
> > > While the file is in the process of being loaded, the variable
> > > ‘load-in-progress’ is non-nil and the variable ‘load-file-name’
> > > is bound to the file’s name.
> > >
> > > Return t if the file exists and loads successfully.
> > >
> > > Probably introduced at or before Emacs version 1.1.
What are the 'provide' and 'require' calls and should I use them ?
When is it appropriate to use 'load'. A useful feature of load is
that prints messages at start and end of loading.
next prev parent reply other threads:[~2024-07-04 12:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 23:44 Add code from other files uzibalqa
[not found] ` <6d098cab-1a96-4eb7-a4c3-1a4cf0fb3270@starynkevitch.net>
[not found] ` <V97NPYqXKDP9XylZkSZkh_dbBhS_SXc-ezIV4g8yCaobeMBzi1PSGBdP_G-h1WeRu0XUm-K_jVE9BefEr63O8ceF3tJ3hxj-38oe3fagwTU=@proton.me>
[not found] ` <2fa9f251-0c84-46b5-9a88-b525eb79a413@starynkevitch.net>
[not found] ` <SxRPEQkups5RAB4wfD8msM9ggAwSxaOuYjUV59-Pxcn5TgvbJgDPPqP1zLvhdl6zG3K-7t_YaVzemmmdxMwUh3avOOXJALTilqiHvtdbVnU=@proton.me>
2024-07-04 12:10 ` uzibalqa [this message]
2024-07-04 17:16 ` uzibalqa
2024-07-04 17:32 ` uzibalqa
2024-07-04 19:57 ` Emanuel Berg
2024-07-04 21:28 ` uzibalqa
2024-07-04 21:50 ` Emanuel Berg
2024-07-04 21:32 ` [External] : " Drew Adams
2024-07-04 22:07 ` uzibalqa
2024-07-04 23:20 ` uzibalqa
2024-07-05 0:12 ` Emanuel Berg
2024-07-05 19:59 ` uzibalqa
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='_PaeWZsPmOkMG6EHs5Q_pGgCKfPN6KS5G97LT-TdrvMPSwG-KP24LmGkPsei8HjCBOai36qQUA5h-XeSeyQ2OoB49djwEFS5RjWzONWiAG4=@proton.me' \
--to=uzibalqa@proton.me \
--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).