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 DRAWINGS
.
This does not work, because call-interactively
exits before insert
is called:
(defun insert-box-drawing-char ()
(interactive)
(call-interactively 'insert-char)
(insert "BOX DRAWING"))
How can I provide partial input to an interactive function?
insert-char
is coded in C), but it's maybe good to remind readers that bothcompleting-read
andread-from-minibuffer
let you pass anINITIAL-INPUT
argument, and you can position the cursor anywhere within that string, which is inserted in the minibuffer to start with. (Vanilla Emacs considersINITIAL-INPUT
to be deprecated forcompleting-read
, but that proscription can be ignored.)