diff lisp/cus-edit.el @ 90580:7f3f771c85fa

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 382-398) - Update from CVS - Update from erc--emacs--22 - Fix ERC bug introduced in last patch - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 123-125) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-101
author Miles Bader <miles@gnu.org>
date Wed, 16 Aug 2006 14:08:49 +0000
parents 858cb33ae39d 4130a8f38950
children c358d0861b16
line wrap: on
line diff
--- a/lisp/cus-edit.el	Mon Aug 07 06:45:41 2006 +0000
+++ b/lisp/cus-edit.el	Wed Aug 16 14:08:49 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."