From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: RE: [External] : Re: Locating file via load-path Date: Thu, 08 Aug 2024 21:59:25 +0000 Message-ID: References: <868qx6n9ug.fsf@gnu.org> 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="13843"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 09 00:00:26 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 1scBBI-0003P2-JY for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Aug 2024 00:00:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scBAX-0005I4-8I; Thu, 08 Aug 2024 17:59:37 -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 1scBAV-0005Bn-JQ for help-gnu-emacs@gnu.org; Thu, 08 Aug 2024 17:59:36 -0400 Original-Received: from mail-43166.protonmail.ch ([185.70.43.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scBAT-0004tm-R5; Thu, 08 Aug 2024 17:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1723154370; x=1723413570; bh=sSrebS+RnxbklL1MyLLfZHDuVh1jDx95gM1Q1GH3egM=; 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=Q2W7hT188rv3KeqpQY/21fMPRVrn5bJH6Z6YmMUH56QpPGbfPdn/l71dEh/LdNBaj O1aesGa8zuVaBYC12CBcRVOM61EChzzeTOn0LhfIYXwjhPnefzFKGrb2oJTAUPzYqF vpVwiW8i3CLsyVwMIDVvSNJgccYYKN8S3sDigwb/jNulTtoY7zYoRQ+Bb59UhgfT7w 2SMs1p0RMv3UhsACV7A9h958K6EoGz37xSOV3ZbBf/5ZQYh9p3J+e4SDd7ElSxTKvt pt2fAvJenDeZfiQxQnh+PCfuB1WRekys4XIrp5thqXyHPHdIKEBr0boojqhr1xDMJS QtCIHas3AFQLA== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 99c8404328f458ec4bf030a4483b3aae5274cd57 Received-SPF: pass client-ip=185.70.43.166; envelope-from=heimeborgia@protonmail.com; helo=mail-43166.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, FREEMAIL_FROM=0.001, 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:147559 Archived-At: On Friday, August 9th, 2024 at 9:25 AM, Drew Adams = wrote: > > On Friday, August 9th, 2024 at 7:51 AM, Drew Adams wrote: > >=20 > > > > a test is made, so it is added if required > > > >=20 > > > > (if (locate-file "tema.el" load-path) > > > > (require 'tema) > > >=20 > > > (require 'tema nil t) > > > loads it if available, and returns nil otherwise. > > >=20 > > > > (progn > > > > (add-to-list 'load-path tema-path) > > > > (require 'tema))) > > >=20 > > > You might as well just add it to `load-path' > > > unconditionally, unless it's already there: > > >=20 > > > (cl-pushnew tema load-path) >=20 >=20 > (I meant tema-path, not tema.) >=20 > > That would be a good thing. > >=20 > > (add-to-list 'load-path tema-path) should add tema-path only if it isn'= t > > there yet. Why cl-pushnew ? >=20 >=20 > Either is OK. The doc of `add-to-list' says: you are usually better off u= sing` push' or `cl-pushnew'. It doesn't say why, and neither does the Elisp= manual. Some people get confused over the args to` add-to-list', > in particular, that it's a function, so it evaluates its > args, so if you want to provide a variable literally > then you need to quote it. Are you referring to quoting LIST-VAR ? add-to-list expects the first=20 argument to be the symbol of a list variable, not the list itself.