all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
To: help-gnu-emacs@gnu.org
Subject: Re: using string variable with file name
Date: Sun, 24 Feb 2008 10:45:58 +1100	[thread overview]
Message-ID: <87skzjqls9.fsf@rimspace.net> (raw)
In-Reply-To: fpp1fk$5b8$1@news.net.uni-c.dk

saneman <asdfsdf@asd.com> 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





      parent reply	other threads:[~2008-02-23 23:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 11:53 using string variable with file name saneman
2008-02-23 12:00 ` Joost Kremers
2008-02-23 12:16   ` saneman
2008-02-23 12:44     ` Johan Bockgård
2008-02-23 13:03     ` Joost Kremers
2008-02-23 16:49     ` Thierry Volpiatto
2008-02-23 23:45 ` Daniel Pittman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87skzjqls9.fsf@rimspace.net \
    --to=daniel@rimspace.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.