summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-07-12 15:56:33 +0000
committerRichard M. Stallman <rms@gnu.org>2006-07-12 15:56:33 +0000
commit0ce026b1d2cb332b6fbc377b6a218a15a5b3ae16 (patch)
tree43716878e73a16063d6e42fd864de28ee543cfe3 /lisp/cus-edit.el
parente55deb0b2c90a9f6fb6c53adb56403d369174ee0 (diff)
downloademacs-0ce026b1d2cb332b6fbc377b6a218a15a5b3ae16.tar.gz
(custom-no-edit): New command.
(custom-mode-map): Remap to custom-no-edit instead of using suppress-keymap.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d7ffab4bc5b..15efbc5ab91 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -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."