help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: using string variable with file name


From: Joost Kremers
Subject: Re: using string variable with file name
Date: 23 Feb 2008 12:00:54 GMT
User-agent: slrn/0.9.8.1 (Linux)

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                                      address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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