Commit 9b350152 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(minibuffer-prompt-modification)

(minibuffer-prompt-insertion): New functions.
(minibuffer-prompt-properties): Use `modification-hooks' and
`insert-in-front-hooks'.
parent 68d0efa6
......@@ -4185,4 +4185,26 @@ See also `normal-erase-is-backspace'."
(and (boundp 'byte-compile-current-file)
(stringp byte-compile-current-file)))
;;; Minibuffer prompt stuff.
(defun minibuffer-prompt-modification (start end)
(error "You cannot modify the prompt"))
(defun minibuffer-prompt-insertion (start end)
(let ((inhibit-modification-hooks t))
(delete-region start end)
;; Discard undo information for the text insertion itself
;; and for the text deletion.above.
(when (consp buffer-undo-list)
(setq buffer-undo-list (cddr buffer-undo-list)))
(message "You cannot modify the prompt")))
(setq minibuffer-prompt-properties
(list 'modification-hooks '(minibuffer-prompt-modification)
'insert-in-front-hooks '(minibuffer-prompt-insertion)))
;;; simple.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment