# HG changeset patch # User Richard M. Stallman # Date 1155704708 0 # Node ID 4130a8f389507c91765bb0a1833a084b79f5f2dc # Parent 7b77bbd3e40ccd993100ca716d649b97324fa8ac (custom-newline): New function. (custom-mode-map): Bind newline to custom-newline. diff -r 7b77bbd3e40c -r 4130a8f38950 lisp/cus-edit.el --- a/lisp/cus-edit.el Wed Aug 16 05:04:16 2006 +0000 +++ b/lisp/cus-edit.el Wed Aug 16 05:05:08 2006 +0000 @@ -4436,6 +4436,7 @@ (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) @@ -4452,6 +4453,14 @@ (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."