]> git.eshelyaron.com Git - emacs.git/commitdiff
(custom-no-edit): New command.
authorRichard M. Stallman <rms@gnu.org>
Wed, 12 Jul 2006 15:56:33 +0000 (15:56 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 12 Jul 2006 15:56:33 +0000 (15:56 +0000)
(custom-mode-map): Remap to custom-no-edit instead of
using suppress-keymap.

lisp/cus-edit.el

index d7ffab4bc5b0485d7d52b0c58253c46f4ac563d8..15efbc5ab9113bd6b0e64bf9c445a449df88c998 100644 (file)
@@ -4419,7 +4419,9 @@ The format is suitable for use with `easy-menu-define'."
   ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
   (let ((map (make-keymap)))
     (set-keymap-parent map widget-keymap)
-    (suppress-keymap map)
+    (define-key map [remap self-insert-command]
+      'custom-no-edit)
+    (define-key map "\^m" 'custom-no-edit)
     (define-key map " " 'scroll-up)
     (define-key map "\177" 'scroll-down)
     (define-key map "\C-c\C-c" 'Custom-set)
@@ -4431,6 +4433,11 @@ The format is suitable for use with `easy-menu-define'."
     map)
   "Keymap for `custom-mode'.")
 
+(defun custom-no-edit ()
+  "Refuse to allow editing of Custom buffer."
+  (interactive)
+  (error "You can't edit this part of the Custom buffer"))
+
 (easy-menu-define Custom-mode-menu
     custom-mode-map
   "Menu used in customization buffers."