[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using string variable with file name

From: Daniel Pittman
Subject: Re: using string variable with file name
Date: Sun, 24 Feb 2008 10:45:58 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux)

saneman <address@hidden> 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

> ;; 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]