From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: using string variable with file name Date: Sun, 24 Feb 2008 10:45:58 +1100 Organization: Cybersource: Australia's Leading Linux and Open Source Solutions Company Message-ID: <87skzjqls9.fsf@rimspace.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203810766 6804 80.91.229.12 (23 Feb 2008 23:52:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2008 23:52:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 24 00:53:11 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 1JT4Ao-0001TF-5W for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Feb 2008 00:52:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT4AI-0007Rr-KI for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Feb 2008 18:52:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT49z-0007RZ-V2 for help-gnu-emacs@gnu.org; Sat, 23 Feb 2008 18:52:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT49z-0007RN-55 for help-gnu-emacs@gnu.org; Sat, 23 Feb 2008 18:52:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT49z-0007RK-2E for help-gnu-emacs@gnu.org; Sat, 23 Feb 2008 18:52:03 -0500 Original-Received: from main.gmane.org ([80.91.229.2] 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 1JT49y-0003i6-M3 for help-gnu-emacs@gnu.org; Sat, 23 Feb 2008 18:52:02 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JT49n-0001OV-Fy for help-gnu-emacs@gnu.org; Sat, 23 Feb 2008 23:51:51 +0000 Original-Received: from ppp59-167-189-244.static.internode.on.net ([59.167.189.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Feb 2008 23:51:51 +0000 Original-Received: from daniel by ppp59-167-189-244.static.internode.on.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Feb 2008 23:51:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp59-167-189-244.static.internode.on.net User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:bBsa7tQ3odOmTdsbVC61IlONLtk= X-detected-kernel: by monty-python.gnu.org: 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:51803 Archived-At: saneman writes: > In my .emacs file I have made: > > ;; Directories > (setq mylisp "~/work/mylisp/") This is the wrong approach. See the help for the `load-path' variable instead. > ;; Line numbers > (load-file mylisp cons "setnu.el") This is utterly incorrect syntax, unrelated to Lisp. You would do well to invest time in the Emacs Lisp tutorial, or any other Lisp tutorial, until you understand the basic syntax of the language. > (global-set-key "\C-cl" 'setnu-mode) > > But this gives an error. How do I "cons" the variable mylisp with a filename? You use the `cons' function; if you succeed you will then have another error to deal with because what you *want* to do is create a single string from both parts -- not a cons cell, which will not work as an argument to `load-file'. The correct function is `concat', rather than `cons', but that will also fail until you actually use the correct syntax for the language. HTH. HAND. Daniel