Questions tagged [quote]
85 questions
45
votes
3 answers
How to know when or when not to use the single quote before variable names?
I have the below:
(setq some-variable "less")
I am confused why I have to use the single quote with boundp but not with bound-and-true-p.
Example 1:
(when (boundp 'some-variable)
(message "some-variable is %s"…

Kaushal Modi
- 25,203
- 3
- 74
- 179
41
votes
2 answers
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)
(add-to-list 'somelist '(x . y))

Kaushal Modi
- 25,203
- 3
- 74
- 179
34
votes
1 answer
What is the difference between ' and #' in front of a symbol?
I'm a little new to Emacs.
When looking at some of the configurations, I found there are two types command in "add-hook".
(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)
and
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
This has confused me for a…

X.Arthur
- 443
- 4
- 9
20
votes
2 answers
When should sharp quotes be used?
I see sharp quotes being used in other people's eLisp code, and I use them myself, but I'm not completely clear on when they are appropriate and when not.
Could anyone clarify on exactly when it's appropriate to use sharp quotes and when ordinary…

izkon
- 1,798
- 10
- 23
13
votes
1 answer
Why does a constant in `let` change with repeated calls?
Say we have such a foo function:
(defun foo (e)
(let ((lst '(a b c)))
(delq e lst)))
Then we use it in following way (sequentially evaluating one by one):
(foo 'c) ; => (a b)
(foo 'b) ; => (a)
(foo 'a) ; => nil
(foo 'b) ; => (a)
What…

cutejumper
- 787
- 5
- 12
10
votes
3 answers
How to jump to matching (double or single) quote of a quoted string?
When cursor on one quote symbol, how to jump to the pairing quote?

AhLeung
- 1,083
- 5
- 14
9
votes
1 answer
When to use quote for lists? Modifying quoted lists in Elisp
The Common Lisp Hyper Spec says:
The consequences are undefined if literal objects (including quoted objects) are destructively modified.
This is further motivated at the Constant Modification Issue that lead to the corresponding clarification in…

Tobias
- 32,569
- 1
- 34
- 75
9
votes
4 answers
Don't pair quotes in electric-pair-mode
How can I get electric-pair-mode to not pair quotation marks (single or double)? I still want it to pair everything else (brackets, braces, etc.), just not quotes.

Ben
- 587
- 4
- 11
9
votes
2 answers
Proper reinitialization of a list? What is happening under the hood?
I'm teaching myself some more elisp and have encountered the following problem:
If I want to reset a list variable it won't get updated after the first evaluation. Here is some example code:
(defun initilize ()
(setq example '(3)))
(defun modify…

clemera
- 3,401
- 13
- 40
9
votes
2 answers
tell org to treat block quotes as a special environment?
In org-mode I use block quotes.
#+BEGIN_QUOTE
Foo.
#+END_QUOTE
However, when I do org-edit-special inside a block quote, I get No special environment to edit here. How can I direct org-mode to treat block quotes (and verse quotes etc) as special…

incandescentman
- 4,111
- 16
- 53
7
votes
2 answers
Cannot use concat within org-capture template
I am trying to use concat from within an org-capture template. But I keep getting an "Invalid template" error, so something's not right. Here is my code:
(setq org-capture-templates
'(("j" "Journal" entry (file+datetree "~/org/journal.org")
…

Adam
- 1,857
- 11
- 32
6
votes
1 answer
Can I tell prin1-to-string to use reader-macros?
I'm writing a lispy documentation engine with elisp and to make things easier, I'm trying to modify the following behavior
(prin1-to-string '(cons 'a 'b))
;; => "(cons (quote a) (quote b))"
to be
(prin1-to-string '(cons 'a 'b))
;; => "(cons 'a…

Sean Allred
- 6,861
- 16
- 85
6
votes
2 answers
how to style block quotes in org-mode LaTeX export?
I am trying to change the style of block quote formatting in org-mode export to PDF via LaTeX.
Using this answer, I defined a new LaTeX environment called fancyquotes. I am successfully able to create block quotes with this styling by creating a…

incandescentman
- 4,111
- 16
- 53
6
votes
1 answer
Does a list contain this symbol?
I'm confused by the interpretation of ' in the context of lists of symbols.
The problem is that I'd like to check whether a buffer is in one a list of modes, and I'll use the scratch buffer as my example.
(with-current-buffer "*scratch*" major-mode)…

Squidly
- 1,499
- 14
- 17
5
votes
0 answers
Warning: quoted with ' rather than with #'
After switching from Emacs 25 to Emacs 28 I started to get this warning message during the loading of my custom settings
.emacs.d/init.el: Warning: (lambda nil \.\.\.) quoted with ' rather than with #'
I upgraded all installed packages and…

PinkCollins
- 151
- 8