Questions tagged [quote]

86 questions
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,519
  • 14
  • 18
3
votes
1 answer

Call random function from list

I have a list of interactive functions and want to call a random one of them. In the end I expect to have a function that randomly changes the capitalization of the word at point (without moving the point). I tried my best but did not get it to…
Kaligule
  • 339
  • 3
  • 10
1
vote
1 answer

How to allow a sexp within a quoted list to be evaluated?

(setq a 2) (setq l '(a b c)) (car l) Got a when evaluating this, and why its value not 2 ?
FaiChou
  • 113
  • 2
1
vote
0 answers

why does this function keep updating the same result?

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', 'G', and 'T'. Here is a simple unit test to better…
little-dude
  • 177
  • 6
0
votes
1 answer

Creating custom minor mode with keybindings

I've written my first custom elisp function for dealing with the output from grep. (defun open-at-grep () (interactive) (let ((thisline (buffer-substring-no-properties (line-beginning-position) (line-end-position)))) (find-file (nth 0…
Elliot
  • 103
  • 2
0
votes
1 answer

Why is this function name causing “Invalid function” when in a list for `dolist`?

How can I use dolist to repeat an operation for each item in a list? I have a sequence of statements: (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) (put 'narrow-to-defun 'disabled nil) (put 'narrow-to-region 'disabled…
bignose
  • 639
  • 3
  • 15
0
votes
1 answer

Why is (eq (car '('x)) 'x) => nil

Context In notmuch there is the a function that reads the :search-type property from a list and compares it to a symbol. This comparison is always nil for 'tree' / 'unthreaded, even though saved-search is set correctly (or not - that is the…
Jens
  • 103
  • 2
0
votes
1 answer

Expand variable and transform it in a quoted list

The function cycle-themes have cycle-themes-theme-list as a quoted list, e.g., (setq cycle-themes-theme-list '(tsdh-light wheatgrass whiteboard womba)). At the same time, (custom-available-themes) will return all available themes. How do I apply the…
BuddhiLW
  • 297
  • 1
  • 7
0
votes
1 answer

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.. )) What's the difference between (setq shell t)…
Wizard
  • 1,251
  • 6
  • 17
0
votes
0 answers

highlight-regexp(s) with looping over an alist

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 appropriately: ;; 1 (defun my-highlights () …
Gabriele
  • 1,554
  • 9
  • 21
0
votes
1 answer

Function arguments in quoted lists

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)?
Valeriy
  • 377
  • 4
  • 16