Questions tagged [interactive]

`interactive` spec of an Emacs-Lisp command (function invocable using `M-x` or a key binding)

Filter by
Sorted by
Tagged with
3
votes
4answers
929 views

How can I determine which function was called interactively in the stack?

Say I have two functions (defun tmp:a () (interactive) (tmp:b)) (defun tmp:b () (message "called from %S" "?")) If I call M-x tmp:a, how can I determine this from tmp:b?
0
votes
1answer
112 views

How to interactivelly pass a `listp arg` to `yank`

Is it possible to interactively pass an argument that matches listp to the function yank so that current-kill receives an argument of 0? If so, how please can that be achieved? Background: I am ...
3
votes
1answer
321 views

How can I use an interactive function in a script?

I'm using virtualenvwrapper.el to load Python virtualenvs during emacs sessions. I would like emacs to start with a default one, so I don't have to load it manually every time. To load it manually, I ...
3
votes
1answer
178 views

Can I accept a prefix argument based on another argument within an `(interactive …)` form?

(defun tmp:interactive (&optional scope pos-style) "POS-STYLE has no effect when SCOPE is `directory'." (interactive (list (cdr (assoc (read-char-choice "Copy (f)ull ...
12
votes
4answers
865 views

How can I read a single character from the minibuffer?

When part of a defun, (interactive "c(C)hoose (A)n (O)ption") will prompt the user for a single character; RET is not required. How can I replicate this reading behavior without the need for ...
8
votes
1answer
462 views

ielm, bound to a certain buffer

Is there a way to run ielm, but with variables bound to a certain buffer? I know about M-:, but having a shell like ielm to inspect things would be much easier.
4
votes
1answer
263 views

How do I maintain a history of ido-read-filenames?

I've written a helper function for mu4e to run checkpatch against a message. However I want to be easily able to switch between previous calls to checkpatch and this seems difficult with ido-read-file-...
5
votes
1answer
331 views

Helm and custom commands

If I write a command that calls (interactive "f"), Emacs will prompt the user to select a file when the command is run interactively. With Helm enabled, this selection is done through Helm with no ...
7
votes
3answers
1k views

How to search for lines not containing some text?

In a large file, I want to find which lines which do not contain a given string, grep -v basically. M-x grep helps, but it forces to protect special characters, is not interactive nor incremental, ...
1
vote
2answers
684 views

Interactive pop-up dialog?

Is there a popup input dialogue box for Emacs, which returns the string that a user enters? Maybe something that can be launched through the mini-buffer? Or through an elisp command/function?

1 2
3