From 9b350152813e032bafd56b9773bd134f1694381e Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 13 Sep 2001 10:02:35 +0000 Subject: [PATCH] (minibuffer-prompt-modification) (minibuffer-prompt-insertion): New functions. (minibuffer-prompt-properties): Use `modification-hooks' and `insert-in-front-hooks'. --- lisp/simple.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index e276b1dea32..19fee9a0c92 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 -- 2.39.5