Juri Linkov writes: >> +(defun tmm-clear-self-insert-and-exit () >> + "Clear the minibuffer content before self insert and exit." >> + (interactive) >> + (delete-region (minibuffer-prompt-end) (point-max)) >> + (self-insert-and-exit)) > > There is a special function 'delete-minibuffer-contents' > like is used e.g. in 'read-char-from-minibuffer-insert-char' > and 'y-or-n-p-insert-y'. Thanks. Here is a new version that uses this.