(let ((map (make-keymap)))
(set-keymap-parent map widget-keymap)
(define-key map [remap self-insert-command] 'custom-no-edit)
+ (define-key map "\^m" 'custom-newline)
(define-key map " " 'scroll-up)
(define-key map "\177" 'scroll-down)
(define-key map "\C-c\C-c" 'Custom-set)
(interactive "@d")
(error "You can't edit this part of the Custom buffer"))
+(defun custom-newline (pos &optional event)
+ "Invoke button at POS, or refuse to allow editing of Custom buffer."
+ (interactive "@d")
+ (let ((button (get-char-property pos 'button)))
+ (if button
+ (widget-apply-action button event)
+ (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."