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 12:10:37 +0000 Message-ID: <_PaeWZsPmOkMG6EHs5Q_pGgCKfPN6KS5G97LT-TdrvMPSwG-KP24LmGkPsei8HjCBOai36qQUA5h-XeSeyQ2OoB49djwEFS5RjWzONWiAG4=@proton.me> References: <6d098cab-1a96-4eb7-a4c3-1a4cf0fb3270@starynkevitch.net> <2fa9f251-0c84-46b5-9a88-b525eb79a413@starynkevitch.net> 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="34300"; mail-complaints-to="usenet@ciao.gmane.io" To: uzibalqa via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 14:11:51 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 1sPLJW-0008dM-W0 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 14:11:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLIu-00062Y-9d; Thu, 04 Jul 2024 08:11:12 -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 1sPLIg-0005zs-Ul for help-gnu-emacs@gnu.org; Thu, 04 Jul 2024 08:11:00 -0400 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPLIY-0006YO-IH for help-gnu-emacs@gnu.org; Thu, 04 Jul 2024 08:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1720095047; x=1720354247; bh=I7GckVneffDcLMMWTz6ywUr4WTPFvLWNLSZwJ9l01eI=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ZkHmcldUzcaery8zWnnBFifZsJxo8/aJhLmRMdCVnc7WuPkE1/heUz1Kh7NG27kXo dBDuYG4OF3bgkaNX8T1EdwuNbA5a7dzh/0baUqf6u+J9fdAKDmaOZMMfwpPtKpHj3/ TZQ8+6z5FRfeKTireVcsCEeLp3oGxPNqGrFT8tkLIBkhjZcFXyEQN6rj8FSPN0TMGp XbEfZGzHJhXoK6X5bnuVWWvSiZtkZzI4g3gdV48xuBfU+m/BSak5vAD9F1NfLVpQ6U brlJTEOSKIYGkP0IxZDhwmd0hGc0+MHdGii4A5SVlzIG4R5omi1fHJdb4oknplyxHa uPRXQZuvJf5nA== In-Reply-To: Feedback-ID: 52887082:user:proton X-Pm-Message-ID: e1ed926eec1f26b144e16d8fdbc15ab0a8da11fd Received-SPF: pass client-ip=185.70.43.19; envelope-from=uzibalqa@proton.me; helo=mail-4319.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 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:147070 Archived-At: On Thursday, July 4th, 2024 at 11:19 AM, uzibalqa wrot= e: > On Thursday, July 4th, 2024 at 11:11 AM, Basile Starynkevitch basile@star= ynkevitch.net wrote: >=20 > > On 7/4/24 13:03, uzibalqa wrote: > >=20 > > > On Thursday, July 4th, 2024 at 3:49 AM, Basile Starynkevitch basile@s= tarynkevitch.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. Wh= at does one do ? > > > >=20 > > > > You should explain more. Are you thinking of Elisp code? GNU emacs = 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 present = 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=98load-= 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 variable = 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-mess= ages=E2=80=99 > > > overrides that). > > > If optional fourth arg NOSUFFIX is non-nil, don=E2=80=99t try adding > > > 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 mod= ule suffix; don=E2=80=99t accept just > > > FILE unless it ends in one of those suffixes or includes a directory = name. > > >=20 > > > If NOSUFFIX is nil, then if a file could not be found, try looking fo= r > > > a different representation of the file by adding non-empty suffixes t= o > > > 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. > > >=20 > > > The suffixes that this function tries out, when NOSUFFIX is nil, are > > > given by the return value of =E2=80=98get-load-suffixes=E2=80=99 and = the values listed > > > in =E2=80=98load-file-rep-suffixes=E2=80=99. If MUST-SUFFIX is non-ni= l, only the > > > return value of =E2=80=98get-load-suffixes=E2=80=99 is used, i.e. the= 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 newest= . > > >=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-histo= ry=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 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.