changeset 39271:d56dcab29cce

(minibuffer-prompt-modification) (minibuffer-prompt-insertion): New functions. (minibuffer-prompt-properties): Use `modification-hooks' and `insert-in-front-hooks'.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 13 Sep 2001 10:02:35 +0000
parents daf37eb76fde
children d8fa6a1b7667
files lisp/simple.el
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Thu Sep 13 09:17:05 2001 +0000
+++ b/lisp/simple.el	Thu Sep 13 10:02:35 2001 +0000
@@ -4185,4 +4185,26 @@
   (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