Questions tagged [quote]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
12 views

String-match: symbols variable void

I am trying to write a small function where I extract two sub-strings from a cite-key, e.g. cite:rammstein2017paris. (defun citekey-get-author-and-year () "Get the _author_ and _YEAR_ ...
0
votes
0answers
31 views

What's the difference between ' (quote) and ` (grave accent) [duplicate]

I've seen both used to quote symbols and list. What's the difference between them? When should I use one or the other?
0
votes
1answer
42 views

Invalid function in font-lock-fontify-keywords-region [duplicate]

Why do I get the error: font-lock-fontify-keywords-region: Invalid function: (concat "\\\\" (regexp-opt (quote ("cs" "hepth" "hepph" "heplat" "...
0
votes
1answer
13 views

Disable quote replacement in sgml-mode

In sgml-mode, when I type quotes ", they are automatically replaced by ". The culprit is the function sgml-name-self. Perhaps it is called automatically on characters in the variable sgml-...
0
votes
1answer
35 views

string-join list with function as list member

I want to string-join a list of strings, one of which is returned by a function call. Like this: (defun foobar () "foobar") (string-join '("foo" (foobar) "bar") "|&...
0
votes
1answer
29 views

Why has my .custom file changed between `(quote` syntax and the `'` syntax and how to convert between the two?

I use the same .custom file on different machines syncronised via a git repo. I just noticed that suddenly the .custom file from one machine uses the (quote syntax while in the past the ' syntax was ...
4
votes
1answer
74 views

How to force filename completion in shell buffers to use quotes instead of backslashes

I have a directory with the file a file name with spaces and in Emacs I have a bash in a shell buffer. Rhen I type ls a<TAB> and shell mode completes to a\ file\ name\ with\ space However I ...
1
vote
0answers
37 views

Why did I get the U+2019 right single quotation mark not plain ASCII single quote in C mode?

In Emacs under C mode, why did the single quote key give me a U+2019 right single quotation mark, not a plain ASCII single quote? (That was corrected by a bot https://stackoverflow.com/posts/64104679/...
1
vote
2answers
82 views

Unquoting a variable name (to implement variable pointers)

I know that if I have a variable with a function name, I can call it using funcall, like this (setq func-ref 'my-func) (funcall func-ref) I am wondering if there's a similar functionality for ...
1
vote
1answer
41 views

Wrong type argument: symbolp, 10

I would like create function that ask me how length I want the Pomodoro but it say wrong type argument. (defun changePomoLength () (interactive) (set-variable org-pomodoro-length (read-string "...
3
votes
2answers
88 views

Is it possible to selectively disable syntax highlighting rules?

The context : GNU Emacs 26.1 working on Debian 10.3 currently editing YAML files (Ansible code) Here's how my code looks like : As you can see, the syntax highlighting is puzzled by the odd number ...
3
votes
0answers
46 views

Add a source reference to org blocks

During research, I often cite a passage from some website, a local document or org file. For context and later use, I always add the source reference after the block: * Public transport ** Bus Buses ...
2
votes
1answer
144 views

eval and quotes

I am trying to execute the code here, which I copy below (defun buffer-local-set-key (key func) (interactive "KSet key on this buffer: \naCommand: ") (let ((name (format "%s-magic" (...
0
votes
2answers
99 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
156 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
117 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
39 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
59 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
75 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
62 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', ...
4
votes
1answer
189 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
788 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 ...
9
votes
1answer
728 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
306 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
182 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
429 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 ...
1
vote
1answer
257 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 ‘\’ ...
5
votes
2answers
736 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
292 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
78 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 ...
12
votes
2answers
1k 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
599 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
83 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
111 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
43 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
38 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). #+...
7
votes
1answer
81 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
437 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-...
5
votes
2answers
2k 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
147 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 ...
4
votes
1answer
2k views

Error void-variable on function name

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
80 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
401 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
900 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
2k 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.
6
votes
1answer
324 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
954 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
141 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-...