From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: Add code from other files Date: Thu, 04 Jul 2024 17:16:20 +0000 Message-ID: References: <6d098cab-1a96-4eb7-a4c3-1a4cf0fb3270@starynkevitch.net> <2fa9f251-0c84-46b5-9a88-b525eb79a413@starynkevitch.net> <_PaeWZsPmOkMG6EHs5Q_pGgCKfPN6KS5G97LT-TdrvMPSwG-KP24LmGkPsei8HjCBOai36qQUA5h-XeSeyQ2OoB49djwEFS5RjWzONWiAG4=@proton.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27524"; mail-complaints-to="usenet@ciao.gmane.io" Cc: uzibalqa via Users list for the GNU Emacs text editor To: uzibalqa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 19:17:12 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sPQ52-0006y1-1S for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 19:17:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPQ4O-0005te-3X; Thu, 04 Jul 2024 13:16:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPQ4L-0005s2-TX for help-gnu-emacs@gnu.org; Thu, 04 Jul 2024 13:16:29 -0400 Original-Received: from mail-43167.protonmail.ch ([185.70.43.167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPQ4H-0003xQ-Pi for help-gnu-emacs@gnu.org; Thu, 04 Jul 2024 13:16:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1720113382; x=1720372582; bh=Z8UBA4bNzsOeLXOatqE3WAHQwlHZ1p7o9ZDKOcasFVM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=UR3LtHdQFkuugBNINpTbbLaRK9GNIP9s0SUq0PSg4cUeQAdTARZhnFxCtivF0hADi O+VwLg98XMX2kImZwoHcvU2PEikAAOP4pOvIF0nnax5uX8je+uXvgB3fcQdNz0hyk3 C9dj+g0FdsVrBAQL/E7OywMv1dm4SbTAOqW+D71kEOI8WMAK9dfQsjGuWI46Dc+pMA M1gI9UDYg87y50JyqxVoZpDqxJChucliqDMVYd38WQz60LN6QDGQYd4akhPqhqKSfP vCk0fh5Y7meoUbCtAAeHnTU7jiOgOrbYNtI1g28SCHcQK89TFmfBFSuRplNaU+lL73 +KFN3qTn2n4Dg== In-Reply-To: <_PaeWZsPmOkMG6EHs5Q_pGgCKfPN6KS5G97LT-TdrvMPSwG-KP24LmGkPsei8HjCBOai36qQUA5h-XeSeyQ2OoB49djwEFS5RjWzONWiAG4=@proton.me> Feedback-ID: 52887082:user:proton X-Pm-Message-ID: 48550591b5972ad7f53a6633563c34fa31ee1d2c Received-SPF: pass client-ip=185.70.43.167; envelope-from=uzibalqa@proton.me; helo=mail-43167.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147071 Archived-At: On Thursday, July 4th, 2024 at 12:10 PM, uzibalqa wrot= e: > On Thursday, July 4th, 2024 at 11:19 AM, uzibalqa uzibalqa@proton.me wrot= e: >=20 > > On Thursday, July 4th, 2024 at 11:11 AM, Basile Starynkevitch basile@st= arynkevitch.net wrote: > >=20 > > > On 7/4/24 13:03, uzibalqa wrote: > > >=20 > > > > On Thursday, July 4th, 2024 at 3:49 AM, Basile Starynkevitch basile= @starynkevitch.net wrote: > > > >=20 > > > > > On 7/4/24 01:44, uzibalqa wrote: > > > > >=20 > > > > > > I have a file and want to add the code from other files to it. = What does one do ? > > > > >=20 > > > > > You should explain more. Are you thinking of Elisp code? GNU emac= s can > > > > > be used to edit non-code files (eg LaTeX documents) > > > > >=20 > > > > > -- > > > > > Basile STARYNKEVITCH basile@starynkevitch.net > > > > > I have an elisp file and want to include the functionality presen= t in another .el file. > > >=20 > > > Can't you use the load primitive function of Elisp > > >=20 > > > > load is a primitive-function in =E2=80=98C source code=E2=80=99. > > > >=20 > > > > (load FILE &optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX) > > > >=20 > > > > Execute a file of Lisp code named FILE. > > > > First try FILE with =E2=80=98.elc=E2=80=99 appended, then try with = =E2=80=98.el=E2=80=99, then try > > > > with a system-dependent suffix of dynamic modules (see =E2=80=98loa= d-suffixes=E2=80=99), > > > > then try FILE unmodified (the exact suffixes in the exact order are > > > > determined by =E2=80=98load-suffixes=E2=80=99). Environment variabl= e references in > > > > FILE are replaced with their values by calling =E2=80=98substitute-= in-file-name=E2=80=99. > > > > This function searches the directories in =E2=80=98load-path= =E2=80=99. > > > >=20 > > > > If optional second arg NOERROR is non-nil, > > > > report no error if FILE doesn=E2=80=99t exist. > > > > Print messages at start and end of loading unless > > > > optional third arg NOMESSAGE is non-nil (but =E2=80=98force-load-me= ssages=E2=80=99 > > > > overrides that). > > > > If optional fourth arg NOSUFFIX is non-nil, don=E2=80=99t try addin= g > > > > suffixes to the specified name FILE. > > > > If optional fifth arg MUST-SUFFIX is non-nil, insist on > > > > the suffix =E2=80=98.elc=E2=80=99 or =E2=80=98.el=E2=80=99 or the m= odule suffix; don=E2=80=99t accept just > > > > FILE unless it ends in one of those suffixes or includes a director= y name. > > > >=20 > > > > 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 fi= nd > > > > compressed versions of files when Auto Compression mode is enabled. > > > > If NOSUFFIX is non-nil, disable this feature. > > > >=20 > > > > The suffixes that this function tries out, when NOSUFFIX is nil, ar= e > > > > given by the return value of =E2=80=98get-load-suffixes=E2=80=99 an= d the values listed > > > > in =E2=80=98load-file-rep-suffixes=E2=80=99. If MUST-SUFFIX is non-= nil, only the > > > > return value of =E2=80=98get-load-suffixes=E2=80=99 is used, i.e. t= he file name is > > > > required to have a non-empty suffix. > > > >=20 > > > > When searching suffixes, this function normally stops at the first > > > > one that exists. If the option =E2=80=98load-prefer-newer=E2=80= =99 is non-nil, > > > > however, it tries all suffixes, and uses whichever file is the newe= st. > > > >=20 > > > > Loading a file records its definitions, and its =E2=80=98provide= =E2=80=99 and > > > > =E2=80=98require=E2=80=99 calls, in an element of =E2=80=98load-his= tory=E2=80=99 whose > > > > car is the file name loaded. See =E2=80=98load-history=E2=80=99. > > > >=20 > > > > While the file is in the process of being loaded, the variable > > > > =E2=80=98load-in-progress=E2=80=99 is non-nil and the variable = =E2=80=98load-file-name=E2=80=99 > > > > is bound to the file=E2=80=99s name. > > > >=20 > > > > Return t if the file exists and loads successfully. > > > >=20 > > > > Probably introduced at or before Emacs version 1.1. >=20 >=20 >=20 > 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. I have a main file and three auxiliary files. I can use `load` for the aux= iliary=20 files and use `provide` for the main file. Would this be the correct appro= ach ?