Questions tagged [interactive]
`interactive` spec of an Emacs-Lisp command (function invocable using `M-x` or a key binding)
153 questions
1 vote
0 answers
46 views
How to navigate in org files via executing babel code blocks?
I try to navigate in an org-mode file via babel source blocks. Unfortunately none of the ways I tried so far seem to work when triggered via evaluating a source block. They do however work when I call ...
2 votes
1 answer
273 views
`post-command-hook` execution does not seem to make logical sense
According to my understanding of the post-command-hook from the documentation (https://www.gnu.org/software/emacs/manual/html_node/elisp/Command-Overview.html): the post-command-hook is executed after ...
0 votes
1 answer
77 views
Am I supposed to pass an empty string an argument to mark a function as interactive?
I am creating an interactive command like this: emacs_value func = env->make_function(env, 0, 0, hello_world, "Returns 'hello world'", NULL); emacs_value symbol = env->intern(env, &...
1 vote
3 answers
113 views
reusing text (to give feedback to students)
When I grade students' essays, I frequently have to write the same comments. I would like to write an emacs function to help me reuse the most used comments in a file potential comments. The function ...
0 votes
1 answer
46 views
How can I write a function to modify the word before or after the cursor?
I have written the following function to shorten a string: (defun shorten-hash () "Shorten string (forward or backwards) to eight characters; particularly for shortening hashes" (...
0 votes
1 answer
201 views
How can I pass arguments to a function called interactively?
Consider this: (defun kill-arg-words (arg) "kill `arg' words ahead of you" (interactive) (kill-region (point) (progn (forward-word arg) (point) ))) ...
1 vote
1 answer
403 views
How do I pass an optional argument to a command called programmatically?
I would like to call a certain command from Emacs Lisp. This function takes two arguments plus a third optional argument. This third argument, when non-nil, doesn't ask for confirmation. I would like ...
-1 votes
2 answers
74 views
interactively prompt for a list (or regex) rather than just a single item
I have a function to kill buffers matching a given regex: ;; Like kill-matching-buffers, but doesn't prompt every time. ;; TODO: get this to use vertico (defun kill-matching-buffers-just-do-it () &...