Questions tagged [backquote]
42 questions
5
votes
1 answer
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 backward single quote do?
Source code is here. When…

Saravana
- 2,071
- 13
- 32
4
votes
1 answer
“`(a \, b)” is equivalent to “`(a . ,b)”
I found this when playing at *ielm*:
ELISP> `(emacs-version \, emacs-version)
(emacs-version . "28.2")
ELISP> `(emacs-version . ,emacs-version)
(emacs-version . "28.2")
ELISP>
I have never heard of this usage of \,, is it a feature or bug?
OP…

shynur
- 5,253
- 1
- 4
- 25
3
votes
1 answer
Interpolating inside a nested backquote expression
Consider this macro helper function that returns a backquote expression:
(defun make-headers ()
`(:headers `(("Authorization" . ,(get-auth)))))
This returns the list (:headers `(("Authorization" . ,(get-auth)))), suitable for interpolating into a…

Sean
- 939
- 4
- 13
2
votes
1 answer
Backquote List & Evaluate Vector or conversely
C-h f backquote:
The whole structure acts as if it were quoted except for certain places where expressions are evaluated and inserted or spliced in.
Vectors work just like lists.
What does the 'spliced in' mean?
;; I expect for (1 2 3)
`(1 ,@[2]…

shynur
- 5,253
- 1
- 4
- 25
1
vote
1 answer
Cons interpolation
I want to be able to write a cons with some of the cells being placeholders for later evaluation. I know I can use backquote constructs, but it tries to evaluate the cons immediately.
To clarify, provided I have a variable my-value, I could…

Kamyab
- 41
- 5
1
vote
0 answers
Include an element in a backquoted list only if it is non-nil
This is the "am I missing something obvious?" kind of question.
I would like to use backquotes in some way to make a value appear in a list only if it's not nil. So, for instance, given x, get '(1 2 3) if x is 2 and '(1 3) if x is nil. The…

Augusto
- 436
- 3
- 8
0
votes
0 answers
alist error when value created using (concat string1 string2)
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.el like so:
(defvar user-home-directory (concat…

Chakravarthy Raghunandan
- 3,192
- 2
- 19
- 43