Questions tagged [elisp]
Emacs Lisp is the extension language for the GNU Emacs text editor, and in fact, most of the functionality of Emacs is implemented using Emacs Lisp. Users generally customize Emacs' behavior by adding Emacs Lisp statements to their `~/.emacs`, or writing separate packages.
elisp
3,768
questions
0
votes
3
answers
57
views
How to iterate over nested alist in emacs lisp?
I want to iterate over this my-list.
How to do it?
(setq my-list '[((a . 1) (b . 2)) ((c . 3))])
(loop for k in my-list do
(cl-loop for (i . j) in k do
(message "%c %d" i j)
)
I ...
0
votes
1
answer
46
views
Emacs generate values based on system-type in an early return schema
I try to generate values from the system-type like in an common Pascal function with a early return schema:
{ ASSUMING system_type is a global VAR }
FUNCTION font_name: String
BEGIN
result :='...
0
votes
1
answer
44
views
Elisp upcase match in replace-regexp-in-string
I'm wanting to extract the content from LaTeX markup, modify the content, and then copy it to the clipboard. Specifically, I want to pull everything inside a \textsc{} environment and change it to ...
0
votes
1
answer
96
views
How can I provide a custom function, depending on major-mode variables, right after the startup of Spacemacs?
I recently started to write some elisp code, mostly to customize my spacemacs -> absolute beginner. Although there are a many different sources of "how to customize..." around, I still am ...
0
votes
1
answer
42
views
Why does logically negating an unused optional argument throw an error?
I am attempting to solve exercise 5.5 of the tutorial
Write an interactive function with an optional argument that tests whether its argument, a number, is greater than or equal to, or else, less ...
3
votes
2
answers
100
views
Under any Scheme standard, is (let (x y z) x) valid code?
In both Emacs Lisp and Common Lisp, the following returns nil
(let (x y z)
x)
yet in every Scheme that I've tried, it throws an error.
Has the above been acceptable under any Scheme standard?
0
votes
2
answers
84
views
How to use “and” with “seq-reduce” in Elisp?
I’m trying to write something like this:
(setq l '(nil t nil nil))
(seq-reduce 'and l t)
I get this error:
Invalid function: and
My understanding, after a bit of googling, is that this is due to ...
0
votes
1
answer
40
views
elisp, pass arguments but specify optional
(defun helm-do-ag (&optional basedir targets default-input)
I want to call the above function with default-input, leaving basedir targets empty
Do I call (helm-do-ag nil nil "something")...
2
votes
2
answers
293
views
Iterate over plist and set value per key
How can I iterate over a plist, prompt for each key a value and fill in said value into the plist?
I have 'the skeleton' of a list of properties for my projects
(defconst project-properties
'(:...
0
votes
0
answers
65
views
What does it mean when JSON from jest coverage have null as column?
I'm trying to run my Emacs Lisp code on Code Coverage from jest with TypeScript and it fails because the file (/coverage/coverage-final.json) that I use to read coverage that has an invalid (according ...
0
votes
0
answers
50
views
Multiple permutations with head algorithm
Have written the following elisp function to compute permutations of a string using hde Heap Algarithm. But I am getting repetitions, whereas the algorithm should avoid this.
(defun permute-strg-heap ...
0
votes
1
answer
71
views
Computing permutations with the Heap Algorithm
I am using the following the Heap Algorithm for computing permutation of words in elisp, but the permutations are not correct.
The problem could be associated with the way I use the two calls to ...
0
votes
2
answers
78
views
ELisp macro different expansions based on static parameters
I’m trying to understand if it’s possible/good practice to write macros that expand differently depending on whether the arguments are constants or symbols. As an example (in Emacs 30.0.50):
(...
0
votes
1
answer
45
views
org-mode: Downgrade in priority all items in current buffer
Is there a way to downgrade all items in the current org-mode buffer?
I guess the relevant function is (org-priority-down) but I'm not sure how to apply it recursively. Unless there is a simpler way
...
0
votes
1
answer
47
views
Printing arbitrary number of columns with tabulated-list-print
I have the following function that displays a table in a buffer.
But this handles only two columns. How can I extend this to handle
an arbitrary number of columns?
(defun tlprint-alist (alist &...