Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

2
votes
1answer
37 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
0answers
36 views

Set value in a plist to return value of a function [duplicate]

I am trying to accomplish something similar to the following in a section of my emacs config... (defun my-func (str) (concat "new" str)) (setq my-plist '((:foo "bar") (:baz (my-func "...
0
votes
1answer
31 views

org-capture evaluate each time without currying

Recently my org-mode config broke. And i started using ` and , to get it to work again. But now i have the issue that a function call (dl/capture-report-date-file) gets evaluated once and curries the ...
0
votes
1answer
27 views

cons a symbol with a variable and return as a symbol

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 ((...
1
vote
1answer
51 views

Unconsumed commas in double-backquoted lists

I'm writing a macro which calls a helper function. I need to return a list like this: `(s -- (cons 'commentary s)) I have tried many combinations, but I can't seem to get what I need without an ...
1
vote
1answer
35 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
0answers
29 views

elisp - construct a quasi-alist from variable [duplicate]

To construct a quasi-alist, case 1 is using hardcode string; case 2 is using a variable filename to replace the hadcode string. but case 2 doesn't work as expected (should the same as case 1). #+...
0
votes
1answer
52 views

prin1 abbreviates form with “…” despite expression-print-level?

I have the following function to produce a form that can be "printed" to a ~/.gnus file to configure gnus to use a certain stmp and imap server for an account: (defun gnus-imap-smtp-form (email smtp-...
0
votes
1answer
64 views

Problems with setting the default font

I'm trying to set the default font for my Emacs based on a variable (so I can use a different font on a different machine): (setq fontspec (concat ck-font-name "-" (number-to-string ck-font-size))) (...
0
votes
1answer
48 views

How to use ,var-name (defvar) syntax in org-publish-project-alist? Init file is in form of org-mode

I have following function as part of my emacs configuration.org settings for publishing org to html. (defvar website-html-preamble "<nav> <ul class="nav nav-tabs"> <li role="...
4
votes
2answers
145 views

Elisp backquote comma eval puts a space in between

Here's an example: (defmacro test (arg) `(message foo-,arg)) (defmacro test-with-space (arg) `(message foo- ,arg)) (macroexpand-1 '(test-with-space bar)) (macroexpand-1 '(test bar)) Both eval ...
2
votes
1answer
138 views

Backward quote, what does it mean in elisp?

I was referring the source code of switch-to-buffer in elisp source code, window.el.gz. I am seeing some backward single quotes like, ` I know single quote is used to refer to symbols but what does ...
5
votes
1answer
252 views

Is there any difference between \` and backquote?

I was surprised to find that if I use M-x ielm, I get a literal backquote: ELISP> (read "`foo") `foo However, if I use M-: (read "`foo") then *Messages* and the minibuffer show (\` foo). Are ...
0
votes
1answer
181 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 ...
1
vote
1answer
64 views

Are there implicit evaluation rules for backquoted structures?

I was constructing a macro that nested another macro and I ran into something that confused me. If the backquoted macro was the last form in the defmacro it evaluated as expected. If added an ...
4
votes
2answers
760 views

defun vs defmacro and backquote vs list

While looking to exclude the uses of the list function through the backquote substitutes in defmacros, my attempt failed when combined with the let and `let* recipe, together with the gensym ...
10
votes
2answers
2k views

What is the point of quote with single argument and comma? (quote ,arg)

(quote x) makes x not be evaluated, but adding a , in front of x within quote makes it evaluated. What is then the point of using quote with a single argument with a comma in front of it, like so: (...
25
votes
2answers
2k views

How to evaluate the variables before adding them to a list?

The below obviously doesn't work and hence this question. How do I correct the below code so that the value of somelist becomes '(("abc" . 123)) ? (setq x "abc") (setq y 123) (setq somelist nil) (...