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

Questions tagged [quote]

The tag has no usage guidance.

3
votes
0answers
63 views

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 ...
0
votes
1answer
57 views

How do I ensure org-sbe is consistently passed a string when copying tables

I'm trying to transform the data from one table to another however I can't do it with built in functions so I have to use org-sbe to call some elisp: #+tblname: clues | 02a8 | 0050 | 5012 | 2225 |...
1
vote
0answers
25 views

Quoting selected text using email conventions?

Is there any existing elisp function which will quote any selected text using email quoting conventions? For example, suppose the following text appears in a buffer ... This is some text that I want ...
0
votes
1answer
23 views

Void Function Error

The following function is meant to call an arbitrary function at each of the immediate children of an org heading: (defun org-map-shallow-tree (funcarg) "" (save-excursion (org-back-to-...
3
votes
1answer
143 views

Hook with quoted lambda as an argument

I been reading a blog post from Chris Wanstrath from 2010 where he write about coffee-mode. He proposed there this functions hook: (defun coffee-custom () "coffee-mode-hook" ;; Emacs key binding ...
1
vote
1answer
77 views

Produce \' in a string replacement

As you know, functions such as replace-regexp-in-string and replace-match have an argument LITERAL, meaning ... If optional ... arg LITERAL is non-nil, insert NEWTEXT literally. Otherwise treat ‘\’ ...
2
votes
1answer
194 views

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" "...
2
votes
1answer
159 views

Key binding to a sequence of commands

I'm trying to define a key binding that executes a sequence of commands. I add this code to my ~/.emacs file (require 'origami) (defun open-close-node () "Open/Close node origami mode" (...
3
votes
1answer
49 views

Should the sharp quote should be used for the first argument of advice-add?

... when a symbol referencing a function is actually used? Documentation states: Like ‘add-function’ but for the function named SYMBOL. Contrary to ‘add-function’, this will properly handle the ...
8
votes
2answers
307 views

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 ...
10
votes
3answers
300 views

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?
1
vote
1answer
54 views

How to print a quoted sexp using '… (reader syntax) instead of using (quote …)?

The result of (print 'foo) is (quote foo). Is there a similar function whose result is 'foo, which is what people generally write?
0
votes
1answer
37 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)?
0
votes
0answers
31 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). #+...
6
votes
1answer
69 views

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 ...
0
votes
2answers
302 views

how to correctly pass around function as parameters?

I have a working snippet that advices both kill-buffer and kill-this-buffer to not kill the scratch buffer: (defun ninrod/scratch-bodyguard (buffer-assassin &rest arguments) (let ((buffer-...
4
votes
1answer
675 views

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 ...
1
vote
0answers
104 views

Better display of local time in message-insert-formatted-citation-line?

The default behavior in emacs-25 for the following code is for message citation lines to display the time in UTC, even if (current-time-zone) returns a local time zone such as (-18000 "EST"), and even ...
2
votes
1answer
725 views

Error void-variable in mapcar

What is the difference between the two functions func1 and func2? (defun func1 (arg) (if (listp arg) (mapcar (lambda (x) (func1 x)) arg) arg)) (func1 (list 1 2 3)) (defun func2 (arg) (...
1
vote
1answer
67 views

How to use text-properties in a lambda function

I wish to map the text properties onto a list and them insert them on a new buffer. For some reason the following snippet doesn't work. I've used the -map utility from dash.el package for the map. ...
4
votes
1answer
252 views

Fontify org quote blocks with font-locked markup

I have org-fontify-quote-and-verse-blocks set to t and '(org-block ((t (:foreground "#2E8B57")))) to make quote blocks stand out in a particular color. However, this also means that I cannot get ...
1
vote
1answer
328 views

Pass function symbol as argument via function or single quote?

Are 'function-name and (function function-name) completely equivalent, or are there conditions under which I must use the more verbose (function function-name)? (apply 'message ( list "call func via ...
7
votes
3answers
1k views

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.
5
votes
1answer
286 views

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 ...
0
votes
1answer
270 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 ...
3
votes
1answer
123 views

Why is this function not pure

I just spent a significant amount of time debugging an issue that boils down to the following: (defun my-new-alist () `((x . nil))) (setq a (my-new-alist)) (setq b (my-new-alist)) (push 1 (alist-...
1
vote
1answer
39 views

Comparison of quoted symbols fails using equal

I'm trying to compare (quote foo) with 'foo using equal, but the equality is failing. Here is a trace of what is happening with my code. I don't understand why the comparison fails -- does it have ...
12
votes
1answer
377 views

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) ; =&...
8
votes
2answers
120 views

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 ...
7
votes
2answers
669 views

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 ...
2
votes
1answer
204 views

writing proper Czech quotation marks

I am looking for a way to write proper Czech quotation marks, e.g., „…“ ‚…‘ »…« ›…‹, in some text modes. I found typo.el and typopunct.el. But it seems I would have to make some modifications to ...
3
votes
0answers
114 views

Jump sequence for placeholders in yasnippet not working in org-property blocks

I use the yasnippet bundle and it works like charm. When I want to include placeholders in a PROPERTIES section of an org-document it is not working. Here's the snipper: #type: snippet # -- :...
17
votes
1answer
337 views

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-...
1
vote
1answer
89 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 ...
4
votes
1answer
552 views

Order of evaluation of nested macros and backquotes

I read https://github.com/lunaryorn/blog/blob/master/posts/byte-compiling-eval-after-load.md which contains this code: (defmacro stante-after (feature &rest forms) `(,(if (or (not byte-compile-...
1
vote
1answer
89 views

Why does one argument need to be quoted but not the other?

In the following code I have a reproducible example of strange behavior (the macro body is probably not important): (setq annoying-commands ()) (defmacro add-annoying-arrows-advice (cmd alternatives ...
25
votes
2answers
3k 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) (...
28
votes
3answers
3k views

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 "...