[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suppress user-prompting when calling commands in programs
From: |
Thorsten Jolitz |
Subject: |
Suppress user-prompting when calling commands in programs |
Date: |
Fri, 13 Jun 2014 15:51:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Hi List,
I often encounter user commands that do exactly what I want, and would
like to reuse them in a program, but they are not really written for
programmatical use, i.e. they prompt the user for information to be
stored in (local) variables, but don't expose these variables as
function arguments:
#+begin_src emacs-lisp
(defun foo (&optional arg)
(interactive "P")
(let ((bar (org-icompleting-read ...)))))
#+end_src
I guess thats because writing the interactive spec and binding keys
becomes so much simpler that way.
Assuming `foo' can't be changed - is there another way to bind `bar'
before calling `foo' in a program rather than advising `foo' (with the
aim to suppress any user-prompting at all during the execution of
`foo')?
I seem to remember that a solution for this exists, but I can't find
it anymore. Thanks for any hint.
--
cheers,
Thorsten