2017-06-08 11:47:56 +02:00
|
|
|
;;; core/autoload/minibuffer.el -*- lexical-binding: t; -*-
|
2017-05-06 22:56:15 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
2017-05-26 11:16:26 +02:00
|
|
|
(defun doom/minibuffer-kill-word ()
|
2017-05-06 22:56:15 +02:00
|
|
|
"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)
|
2017-05-26 11:16:26 +02:00
|
|
|
(when (> (point) (minibuffer-prompt-end))
|
|
|
|
(call-interactively #'backward-kill-word)))
|
2017-05-06 22:56:15 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
2017-05-26 11:16:26 +02:00
|
|
|
(defun doom/minibuffer-kill-line ()
|
2017-05-06 22:56:15 +02:00
|
|
|
"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))
|
2017-05-26 11:16:26 +02:00
|
|
|
(call-interactively #'backward-kill-sentence)))
|
2017-05-06 23:01:09 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
2017-05-26 11:16:26 +02:00
|
|
|
(defun doom/minibuffer-undo ()
|
2017-05-06 23:01:09 +02:00
|
|
|
"Undo an edit in the minibuffer without throwing errors."
|
|
|
|
(interactive)
|
2017-05-26 11:16:26 +02:00
|
|
|
(ignore-errors (call-interactively #'undo)))
|