Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [quote]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

'propertize' function doesn't work with variables [duplicate]

I'm trying to swap background and foreground color. I wrote this code to set the background color of a line: (setq current-line (propertize current-line 'face '(:...
0
votes
2answers
42 views

What is #'eq and how does it differ from 'eq [duplicate]

I've seen a few snippets of code where symbols were prepended by #' instead '. like the following snippet (seq-count #'not (seq-mapn #'eq seq1 seq2)) What is the difference and why couldn't I just ...
0
votes
1answer
21 views

which-function-mode and modified mode line

I modified my mode-line, but now which-function-mode stopped working: nothing is displayed. Code: (setq mode-line-position (list '(:eval (propertize "L%l " 'face nil 'help-echo "Line number")) ...
1
vote
1answer
95 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
25 views

Basic quote regex for font-locking?

I have my own font locking that highlights quotes in comments eg. /* Some comment 'this is quoted' * more 'text in an escaped \` quote'. * Plurals such as Moe's or Joe's should work too. */ ...
1
vote
2answers
40 views

' versus #' what are the differences and when should I choose one over the other? [duplicate]

Both seem to work equally well when mapping a function over a list, for example. (mapcar #'1+ (list 1 2 3)) ;; => (2 3 4) (mapcar '1+ (list 1 2 3)) ;; => (2 3 4)
0
votes
2answers
41 views

Symbol's value as variable is void: ‘yes-or-no-p

I have the following lines in my config file: (fset 'yes-or-no-p 'y-or-n-p) (setq confirm-kill-emacs ‘yes-or-no-p) The latter line is what's throwing the error. I would like to be able to use 'y-or-...
0
votes
1answer
57 views

The difference between (setq shell t) and (shell . t)

Upon configuring babel, encounter such syntax (require 'ob-ipython) (org-babel-do-load-languages 'org-babel-load-languages '((ipython . t) (python . t) (shell . t) ;; other languages.. )...
1
vote
0answers
41 views

why does this function keep updating the same result? [duplicate]

I am trying to do the following exercice: Given a DNA string, compute how many times each nucleotide occurs in the string. DNA is represented by an alphabet of the following symbols: 'A', 'C', ...
3
votes
1answer
160 views

regexp: exclude repeated characters for highlight - hi-lock-mode

I want to search using regexp to capture plain text. I want to capture passages that begin with opening quotation marks and end at the end of the paragraph, and even though the quote continues onto a ...
2
votes
2answers
239 views

Invalid read syntax “#”

I'm having trouble using: (add-hook ’before-save-hook #’gofmt-before-save) This is supposed to format the go code before saving. The error I get is: Debugger entered--Lisp error: (invalid-read-...
0
votes
0answers
16 views

highlight-regexp(s) with looping over an alist [duplicate]

Although these two expressions seems to be equivalent (both works): ;; 1 (highlight-regexp "foo" "hi-green") ;; 2 (highlight-regexp "foo" 'hi-green) Only the first one of the following loops works ...
6
votes
0answers
257 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
175 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 |...
0
votes
1answer
78 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
238 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
120 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 ‘\’ ...
4
votes
2answers
385 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
219 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
61 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 ...
9
votes
2answers
458 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
410 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
77 views

How to tell emacs to separate paragaph by an empty line in quotes

Wit this text: > Play with it a few times you will see my point. The command you need is: > > $ echo hello When I use Ctrl+q at the 1st line, I get this > Play with it a few times you ...
1
vote
1answer
78 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
42 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
33 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
75 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
377 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
1k 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
126 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
1k 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
73 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. ...
3
votes
1answer
320 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
564 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
302 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
546 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
125 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
43 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
452 views

Why does a constant in `let` change with repeated calls? [duplicate]

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
126 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
882 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
278 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
138 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 # -- :...
22
votes
1answer
881 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
117 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
659 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
102 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 ...
30
votes
2answers
4k 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) (...
30
votes
3answers
5k 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 "...