From: Richard M. Stallman Date: Wed, 12 Jul 2006 15:56:33 +0000 (+0000) Subject: (custom-no-edit): New command. X-Git-Tag: emacs-pretest-22.0.90~1491 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ce026b1d2cb332b6fbc377b6a218a15a5b3ae16;p=emacs.git (custom-no-edit): New command. (custom-mode-map): Remap to custom-no-edit instead of using suppress-keymap. --- 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."