doomemacs/core/autoload/minibuffer.el

26 lines
851 B
EmacsLisp
Raw Normal View History

;;; ../core/autoload/minibuffer.el
;;;###autoload
(defun doom/minibuffer-kill-word ()
"Kill a word, backwards, but only if the cursor is after
`minibuffer-prompt-end', to prevent the 'Text is read-only' warning from
monopolizing the minibuffer."
(interactive)
(when (> (point) (minibuffer-prompt-end))
(call-interactively #'backward-kill-word)))
;;;###autoload
(defun doom/minibuffer-kill-line ()
"Kill the entire line, but only if the cursor is after
`minibuffer-prompt-end', to prevent the 'Text is read-only' warning from
monopolizing the minibuffer."
(interactive)
(when (> (point) (minibuffer-prompt-end))
(call-interactively #'backward-kill-sentence)))
2017-05-07 05:01:09 +08:00
;;;###autoload
(defun doom/minibuffer-undo ()
2017-05-07 05:01:09 +08:00
"Undo an edit in the minibuffer without throwing errors."
(interactive)
(ignore-errors (call-interactively #'undo)))