From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: using string variable with file name Date: 23 Feb 2008 12:00:54 GMT Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1203770467 29653 80.91.229.12 (23 Feb 2008 12:41:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2008 12:41:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 23 13:41:32 2008 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 1JSth5-0007SC-5m for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Feb 2008 13:41:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JStgZ-0002uF-NS for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Feb 2008 07:40:59 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-X-Trace: individual.net eANZDk4rj4n2g3HR69l1NgozFrT6Gu3pbkhOXp/bAdWrKVcMyz Cancel-Lock: sha1:71XDFHlT8As499RqSxcCuqMXRg8= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/0.9.8.1 (Linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:156419 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:51788 Archived-At: saneman wrote: > In my .emacs file I have made: > > ;; Directories > (setq mylisp "~/work/mylisp/") > > ;; Line numbers > (load-file mylisp cons "setnu.el") > (global-set-key "\C-cl" 'setnu-mode) > > But this gives an error. How do I "cons" the variable mylisp with a > filename? (cons mylisp "setnu.el") however, that gives you a cons, which (i think) is not what you want. in order to concatenate strings, you need concat: (concat mylisp "setnu.el") but even that is probably not the best way to do what you want. it's probably better to add "~/work/mylisp" to your load path: (setq load-path (cons "~/work/mylisp" load-path)) then you can load the file without explicitly naming its path: (load-file "setnu.el") -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)