From: Richard M. Stallman Date: Wed, 16 Aug 2006 05:05:08 +0000 (+0000) Subject: (custom-newline): New function. X-Git-Tag: emacs-pretest-22.0.90~987 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19f0515adac3bc3b0ffa371fb92350bdb0b5fd15;p=emacs.git (custom-newline): New function. (custom-mode-map): Bind newline to custom-newline. --- diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 0493dd0894c..609b5572a08 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4436,6 +4436,7 @@ The format is suitable for use with `easy-menu-define'." (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 @@ The format is suitable for use with `easy-menu-define'." (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."