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
2
votes
1answer
510 views

How to programmatically invoke interactive function? [duplicate]

I have written an interactive function to connect to multiple mysql databases (defun mysql-connect (name) "Connect to a predefined MySQL connection." (interactive (list (completing-read "...
4
votes
3answers
208 views

What are the situations where defining a function as non-interactive is better than interactive?

Assume that we have a function which can be defined either interactive or non-interactive. When we define it as interactive, we can use it as a command by invoking M-x so we have more freedom. I am ...
5
votes
1answer
498 views

log keystrokes with timestamp and other metadata?

If I evaluate this form: (open-dribble-file "/home/joe/keys.log") then type something, Emacs saves what I type to the keys.log file: <return>hellow<backspace> keyloggi<down-mouse-5&...
4
votes
1answer
238 views

Partial input to interactive command

Let's say I want to provide partial input to an interactive function such as insert-char. For example, I might want to have a command that automatically starts typing GREEK SMALL LETTER or BOX ...
2
votes
1answer
200 views

buffer-file-name is a function, so why doesn't M-x buffer-file-name work? [duplicate]

When trying to run it I get M-x buffer-file-name [No match] But it has a function help entry via C-h f and I can evaluate it with M-: buffer-file-name. So why isn't it accessible via M-x?
0
votes
1answer
88 views

Interactive input, strings and quoted items

(defun ecli-metadata-single (ecli meta) "meta needs to be quotes \n example: (case-metadata ECLI:NL:HR:2013:BY6108 'identifier)" (interactive "sEnter ecli: \nxEnter identifier: ") (insert (car (...
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 ...
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.
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 ...

1 2
3