From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Elisp - Store path only once Date: Sat, 9 Jan 2021 13:34:12 -0800 (PST) Message-ID: References: <87a6tie5yv.fsf@omarpolo.com> 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="24692"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Omar Polo , wael-zwaiter@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 22:35:22 2021 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 1kyLtJ-0006IE-OB for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 22:35:21 +0100 Original-Received: from localhost ([::1]:34050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyLtI-0001ae-Os for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 16:35:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyLsO-0001NI-OD for help-gnu-emacs@gnu.org; Sat, 09 Jan 2021 16:34:26 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:38374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyLsK-0003cz-F3 for help-gnu-emacs@gnu.org; Sat, 09 Jan 2021 16:34:24 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 109LU1lp145867; Sat, 9 Jan 2021 21:34:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=ntb0ONhFP2aXDPQFxpBGGPRGnmL9G/m3+eydeGIFuYw=; b=rmz7+RhuimUiBfl0VZSuvGPHDkq8iNHrlsqL8Cp0OmOvHKuaw52vLIgagvmbf201mtbq fTfruzWob3OVukS3A2vwzpu6sAB7DiCFAy0vhATAmml0xdcR/NN2CZRKPrTnvJt2/19I MaBl7L4jNhg0pYGrpc4FcXFYHKxHrReqRVzcl70EDIPk6AtgVgj+NWFKrDKBdv4OVkCs AgMuPrlkntHWGIQz6gMr/afmdY3AqSMu8My3coNlGskYLPZY5ET2Jhv+suPoL8mQ8Xlb dVL6BvukwC0pb9pii4T5Xyotok4L2a3nTdrIYK1qQt+78WlfAdwFgDLGTE1+yoi/61t/ Jw== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 35y3wqs7t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 09 Jan 2021 21:34:16 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 109LVYt0158103; Sat, 9 Jan 2021 21:34:16 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 35y1ktnnte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 09 Jan 2021 21:34:16 +0000 Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 109LYDEN015710; Sat, 9 Jan 2021 21:34:15 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5095.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9859 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=804 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101090143 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9859 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=813 mlxscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 malwarescore=0 suspectscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101090143 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-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.23 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" Xref: news.gmane.io gmane.emacs.help:127150 Archived-At: > >(load 'g-eshell) > >(load 'g-utils) > > (require 'something) There are (at least) 3 functions you can use to load a list file: `require'= , `load-library', and `load'. 1. `require' loads the library (*.elc or *.el) only once, i.e., only if it hasn't yet been loaded. 2. `load-library' and `load' (also `load-file') load the library (*.elc or *.el) unconditionally, i.e., each time. 3. `load-library' looks for a library name in your `load-path'. `load' and `load-file expect a file name, not a library name, but `load' does search directories in `load-path', and `load' does try adding suffixes .elc and .el. This is explained better than I've done here in the Emacs manual, node `Lis= p Libraries' (ask Emacs). https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.ht= ml