From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Mattes Newsgroups: gmane.emacs.help Subject: Re: two ways of adding a path to the list variable load-path. equivalent? Date: Wed, 20 May 2009 08:48:36 +0000 (UTC) Message-ID: References: <23620963.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1242809388 3687 80.91.229.12 (20 May 2009 08:49:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 May 2009 08:49:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 20 10:49:41 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M6hUa-0008Af-Vl for geh-help-gnu-emacs@m.gmane.org; Wed, 20 May 2009 10:49:41 +0200 Original-Received: from localhost ([127.0.0.1]:46630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6hUa-0000ZX-FP for geh-help-gnu-emacs@m.gmane.org; Wed, 20 May 2009 04:49:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6hU6-0000ZK-KP for help-gnu-emacs@gnu.org; Wed, 20 May 2009 04:49:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6hU1-0000Xg-FU for help-gnu-emacs@gnu.org; Wed, 20 May 2009 04:49:09 -0400 Original-Received: from [199.232.76.173] (port=38439 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6hU1-0000Xd-Aw for help-gnu-emacs@gnu.org; Wed, 20 May 2009 04:49:05 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:58089 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6hU0-0001rp-Tq for help-gnu-emacs@gnu.org; Wed, 20 May 2009 04:49:05 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M6hTu-0000tN-Sp for help-gnu-emacs@gnu.org; Wed, 20 May 2009 08:48:58 +0000 Original-Received: from i3ed6d684.versanet.de ([62.214.214.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 May 2009 08:48:58 +0000 Original-Received: from rm by i3ed6d684.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 May 2009 08:48:58 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 15 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i3ed6d684.versanet.de User-Agent: Pan/0.132 (Waxed in Black) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64582 Archived-At: On Tue, 19 May 2009 10:33:09 -0700, Nobuko Three wrote: > 1. > (setq load-path (cons "~/elisp/" load-path)) > > 2. > (add-to-list 'load-path "~/elisp/") > > Are there any situation where one would prefer one over another? The setq way will always add a new value to the list while add-to-list will only add a value iff it's not already present in the list. Usually one wants to have have a path only once in the load-path. HTH Ralf Mattes