[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Variable in a dotted list
From: |
Drew Adams |
Subject: |
RE: Variable in a dotted list |
Date: |
Sat, 13 Mar 2010 07:18:08 -0800 |
> > How can I create a dotted list with the value of a variable
> as cdr?
> > The documentation is
> > -- Variable: backup-directory-alist
> > This variable's value is an alist of filename patterns
> > and backup directory names. Each element looks like
> > (REGEXP . DIRECTORY)
> > and the value of DIRECTORY is a concat-enation of
> > user-emacs-directory and a "name." It works to use
> > (setq backup-directory-alist '(("." . "~/.emacs.d/Name")))
> > but it's a bit too inflexible IMO...
>
> (setq b-d-a `((,user-emacs-directory ,@some-name))) or
> (setq b-d-a `((,user-emacs-directory . ,some-name))) or
> (setq b-d-a (list (cons user-emacs-directory some-name)))
>
> But I'm probably misunderstanding the question.
>
> You said you wanted to create a dotted list with a variable's
> value as cdr, but
> your example doesn't show that. The cdr you use is
> "~/.emacs.d/Name", which you
> don't give as the value of a variable. The only variables
> mentioned are
> `backup-directory-alist' and `user-emacs-directory' (which is
> used for the car).
I guess should have said this instead:
(setq b-d-a `(("." ,@(concat user-emacs-directory "Name")))) or
(setq b-d-a `(("." . ,(concat user-emacs-directory "Name")))) or
(setq b-d-a (list (cons "." (concat user-emacs-directory "Name"))))