3,789 questions
0
votes
1
answer
40
views
Installation of ISLISP-MODE and ISLISP-REPL?
I am having issues with installing ISLISP-MODE and ISLISP-REPL within Emacs, to be able to use Emacs as my editor for tinkering with Easy-ISLISP (EISL).
I did follow the instructions in the two ...
3
votes
1
answer
68
views
Why are there different results in evaluating e sequence of forms in emacs elisp?
I Copy the following elisp code
; Source - https://stackoverflow.com/a/28991218
; Posted by quicoju
; Retrieved 2026-02-24, License - CC BY-SA 3.0
(setq the-empty-stream nil)
(defun stream-null? (s) (...
1
vote
0
answers
71
views
Why my custom Emacs theme loader doesn't change theme between buffers?
I'm using Emacs 30.2. I made a theme loader by file extension, a theme for each extension (Languages mostly) when open files or switching buffer. It worked fine until a moment I didn't track, but I ...
2
votes
2
answers
84
views
Add value from a list to emacs radio-button-choice widget
I've started learning Emacs and want to create a radio button widget with a value from a list as below:
(require 'widget)
(defconst cred-types (list "creds" "token"))
(eval-when-...
1
vote
0
answers
54
views
How do I get java checkstyle to work for emacs?
I wonder if there's any way to get checkstyle working with emacs, as solutions I have found are outdated or don't work.
JDEE seems to have a way to use checkstyle, but it's an outdated package that ...
1
vote
0
answers
34
views
Code for Checkstyle linter in Emacs throws error
I am trying to set up ELisp code to enable a checkstyle linter for java development with the flycheck package, but it throws an error I don't understand when running doom doctor for diagnosis.
;;;; 0
...
1
vote
1
answer
67
views
Disable font-lock-warning-face in Emacs
I'm using scratch Emacs without preconfigurations/frameworks. I want to disable the font-lock-warning-face for all Emacs modes, no remove its styles or make it "invisible", make the face be ...
1
vote
1
answer
51
views
advice for process-environment has no effect
When I run the following, it works: the environment variable "TEST" is defined inside the shell.
(let ((process-environment (cons "TEST=X" process-environment)))
(term "/bin/...
0
votes
1
answer
68
views
adding a key binding to minor mode map has no effect
When I run the following code:
(defun x () (interactive) (message "TEST")
(define-key eglot-mode-map "C-," 'x )
in any buffer managed by eglot I would expect to be able to press C-...
0
votes
0
answers
27
views
Writing elisp exwm function to switch workspaces
I'm trying to write elisp functions to work with exwm to switch to the next or previous workspaces and I came up with the following. They work as required with M-x, but when binding to a key, they don'...
0
votes
2
answers
50
views
emacs lisp: symbols and keywords not interchangable in e.g. insert-button
running emacs29 on windows/cygwin, have noticed that:
(insert-button "foobar" 'help-echo "Hovering")
works just fine with "Hovering" tooltip, while
(insert-button "...
0
votes
0
answers
44
views
Is there a way to make Emacs underline only part of the text when receiving long diagnostics?
In VS Code, when a diagnostic is received by the client, only tree dots appear under the first caracters of the concerned text.
Is there a way to customize Emacs to do the same when it receives long ...
0
votes
0
answers
42
views
Regarding buffer size warnings
I accidentally ran an infinite loop Elisp code, and the buffer size became too large, resulting in a warning.
Warning (undo): Buffer ‘foo.ass’ undo info was 24054654 bytes long.
The undo info was ...
0
votes
2
answers
64
views
Can I conditionally select a special-form at the beginning of an expression?
If I want to make a special-form conditional (making its value depend on a condition) in an expression like (FUNC ARGS) by making FUNC a conditional expression (if).
I ended up trying with something ...
2
votes
0
answers
29
views
Does Emacs/Elisp provide a way to automatically add an elisp standalone program directory to load-path?
Python automatically adds the directory of a launched program to sys.path, making other modules in the said directory's arborescence discoverable by the interpreter.
Is there a similar mechanism in ...
1
vote
1
answer
70
views
Does the binary representation of a fixnum include a sign bit?
TL;DR:
In Emacs Lisp, is the sign of a fixnum part of its binary representation or stored in some metadata? What's the distinction between positive and negative fixnums?
Can the sign be switched in ...
0
votes
1
answer
77
views
How to customise delimeters for C-backwards and C-forwards in emacs
I am configuring emacs, and would like to fix an issue with the Control Forwards, Control Backwards, Control backspace keybinds - since I am using CUA mode, these should take me backwards and forwards ...
0
votes
1
answer
95
views
How to fix C-c behaviour in emacs?
I'm configuring emacs, and have run into a roadblock trying to configure C-c to be copy:
;; Copy, cut
(global-unset-key (kbd "C-c"))
(global-unset-key (kbd "C-x"))
(global-set-key (...
1
vote
1
answer
89
views
How to use a function in setq with quote?
Suppose I'm setting a var like this:
(setq var '((:item1 "stringA") (:item2 "stringB")))
(this works)
Now I would like "stringA" be a conditional, like this:
(setq var '(...
2
votes
1
answer
177
views
Why do Lisp style guides recommend the specific numbers of semicolons for comment in several cases?
I read in the style guide of Elisp and of Common Lisp to use specific numbers of semicolons in various cases, in short this:
single semicolons for comments at the ends of code lines
double semicolons ...
0
votes
1
answer
165
views
How to transpose a table after import it in an org file automatically?
I read a table from a txt file as follows and how do I transpose it by script? It seems that org-table-transpose-table-at-point function could not be used in the script. Are there any built-in ...
0
votes
0
answers
47
views
Can a language construct like "if" be implemented as a macro in Elisp?
Open question, didn't find any answer already online or by LLM.
The result should be something like
(if (expression) (if-true) (if-false))
0
votes
0
answers
269
views
Evil-mode doesn't work on Emacs 29.1 (Windows)
I recently installed emacs 29.1 on my Windows machine from this repo:
https://ftp.gnu.org/gnu/emacs/windows/emacs-29/
I started configuring it and the first thing I did is install evil-mode, so I can ...
0
votes
3
answers
250
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
91
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
61
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
180
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
78
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
127
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
210
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
96
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
810
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
1
answer
95
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
140
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
72
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
96
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 &...
0
votes
1
answer
102
views
Understanding hooks
I want to understand hooks in elisp. I have tematika-minor-mode
which needs to be activated for emacs-lisp-mode and sh-mode.
Is this the way to do it ?
(defun tematika-activate ()
"Activate `...
0
votes
1
answer
153
views
Defining an emacs minor mode
Have coded an emacs minor mode with the definition shown below.
Would it be possible to simplify this, to perhaps call a function instead? Or is it not such a big deal having a minor-mode defined in ...
1
vote
2
answers
415
views
Looping over strings gives wrong type argument error in Emacs Lisp
I am trying to loop over a list of strings with dolist, and join element with a prefix string, using string-join from subr-x to create new string.
(dolist (p '("a" "b" "c"...
1
vote
1
answer
261
views
How to implement `cl-print-object`?
I am using 'eieio and 'cl-lib and I'm trying to define the object-print method for my class as described here:
https://www.gnu.org/software/emacs/manual/html_mono/eieio.html#Basic-Methods
(cl-...
0
votes
1
answer
73
views
Inactivate emacs-lisp % format specifier
Using emacs-lisp I want to identify the word under point, specifically I want to be able to identify hoon runes. Runes are digraphs like ?=, /+, $-. Standard emacs lisp functions like 'thing-at-point'...
1
vote
1
answer
202
views
Emacs-lisp callbacks
In Emacs 27.1, the following code gives me a (void-variable buffer) error in the callback. Are closures not supported in elisp?
(defun make-callback (buffer)
(lambda (status)
(message "...
2
votes
1
answer
192
views
How to Define a Macro that Returns Nothing [duplicate]
Background
I see the question Best way to disable code:
I think something like the following would be nice:
(off
(global-set-key "\C-x" 'do-stuff)
(defun do-stuff () ...))
I understand ...
4
votes
1
answer
389
views
How to iterate and process every heading in ORG file
I want to iterate and check every heading in an ORG file, and see if it's a link to an image file or not. If it is, I need to do some processing on the heading.
* no_image_heading # should print ...
1
vote
1
answer
77
views
I expect this elisp function to visualize entire function, but it visualizes beginning to cursor
It looks like the function that I use is not correctly visualizing the entire function. Currently, the function only visually highlights the region from the beginning of the function to the current ...
0
votes
1
answer
46
views
How to write a function that will define a keyboard shortcut
I'm trying to write a function that will set a shortcut programmatically, as in the MRE below:
(defun my/shortcut-definer (keypress end-message)
(interactive)
(global-set-key
(kbd keypress)
'...
0
votes
1
answer
64
views
Unclear behavior of the defun macro
Good afternoon. The defun macro places the procedure code in the functional cell of the symbol and, if no errors are found, prints the name of the symbol in the mini-buffer.
(defun InsertSsulku ()
&...
2
votes
1
answer
207
views
Representing Grammars in Lisp
Does anybody know of a project that uses Emacs-Lisp or Common-Lisp to formally encode grammars of programming languages? My special requirement is that I plan to use the representation to optionally ...
4
votes
3
answers
157
views
Why does a macro inside a loop only expand once in Elisp?
Let's say I define
(defmacro macro-print (str)
(print "hello"))
and run
(let ((i 0))
(while (< i 3)
(macro-print i)
(setq i (+ 1 i))))
The output is
"hello"
nil
...
0
votes
0
answers
150
views
How can I bind a kbd macro to a key for future sessions in common lisp?
This is probably a newbie question.
I'm trying to bind a keyboard macro to a key and have it available each time I load a file. I'm using lispbox.
This is the code I'm trying (the macro used here is ...