Linked Questions

0
votes
1answer
912 views

Can I eval a value in quote? [duplicate]

I have a variable say some-var, its value is a string. I want to use its value in a quote expression. '(some-var "some string") The function who is using the above expression reports error because ...
4
votes
2answers
733 views

Creating an association list with element evaluation [duplicate]

So as far as I understand it you create association lists that look like '((rose . red) (violet . violet) (chrysanthemum . who-knows)) My question is, what do you do if you want rose, violet, etc.,...
0
votes
1answer
505 views

Construct a list from a variable [duplicate]

'(1 2 3) gives me a list of three elements, but (setq A "apple") '(A) gives me (A). My question is how can I get the list '("apple") by referring variable A?
2
votes
1answer
256 views

How to write a list literal with conditional items? [duplicate]

Given a list literal '(1 2 3) is it possible to conditionally include parts of the list? eg: '(1 2 3 (when thing-is-true '(10 11 12))) 4 5 6) Which would result in '(1 2 3 4 5 6) or '(1 2 3 ...
1
vote
1answer
136 views

Variable not parsed inside other variable definition [duplicate]

I want to store the credentials for posting to my blog secret. Therefore I load them using EasyPG and put them in the variables blog-username and blog-password. When I show the content of those vars ...
2
votes
1answer
174 views

Concat in Org Easy Templates [duplicate]

I have a variety of org easy templates. I have a new file template which includes a #+DATE header that I'd like to populate with the current date [at the time the template is called]. The ...
0
votes
1answer
80 views

elisp - simplify a stranger data structure [duplicate]

I wish to define a variable to replace the hardcode string below: (setq org-publish-project-alist '( ("blog" :components ("org-blog-docs" "org-blog-static")) ("org-blog-docs" ...
1
vote
1answer
120 views

Why does :command argument of make-process not work when string passed as a variable? [duplicate]

This works fine: (make-process :name "my-proc2" :buffer " *my-proc2*" :command '("sh" "-c" "echo \"hi\"\nsleep 10\necho \"there\"") :connection-type 'pipe :...
1
vote
1answer
117 views

How to allow a sexp within a quoted list to be evaluated? [duplicate]

(setq a 2) (setq l '(a b c)) (car l) Got a when evaluating this, and why its value not 2 ?
1
vote
1answer
102 views

Use a variable's value in setq [duplicate]

In emacs.el I am using the following construct to set up an org-remember template: (setq org-remember-templates '(("Todo" ?t "* TODO %^{Brief Description} %^g\n%?\nAdded: %U" "~/GTD/newgtd.org" "...
0
votes
0answers
90 views

alist error when value created using (concat string1 string2) [duplicate]

I'm really confused with what's happening here. In my config for backups I've the line (setq backup-directory-alist '(("" . "~/.emacs.d/backup/per-save"))) and I've a defined a variable in my init....
1
vote
1answer
68 views

What is missing to show the desktop-dirname in the frame title? [duplicate]

I tried to get the value of desktop-dirname into the title of a frame: (setq frame-title-format '("%b Desktop: " (car (last (split-string desktop-dirname "/" t))))) The (...
0
votes
1answer
43 views

cons a symbol with a variable and return as a symbol [duplicate]

How can I make fun2 return as the same as fun1? (defun fun1 () '((hello . "test"))) ; <= returns ((hello . "test")) (defun fun2 (str) '((hello . str))) ; <= this is wrong! should return ((...
0
votes
1answer
43 views

Force function evaluation when setting variable value? [duplicate]

I have these functions defined in my early-init.el. I'm trying to change the location of where my backups are saved and keep getting a Wrong type argument stringp (djm/emacs-cache "backups/"). early-...
0
votes
1answer
43 views

Function arguments in quoted lists [duplicate]

First example: (defun first (a) '(a 1)) (first 2) => (a 1) Second example: (defun second (b) (+ b 1)) (second 1) => 2 How can I get (2 1) with (first 2)?

15 30 50 per page