]> git.eshelyaron.com Git - emacs.git/commitdiff
cus-edit tweak for bug#2298.
authorGlenn Morris <rgm@gnu.org>
Thu, 10 Mar 2011 03:44:33 +0000 (19:44 -0800)
committerGlenn Morris <rgm@gnu.org>
Thu, 10 Mar 2011 03:44:33 +0000 (19:44 -0800)
* lisp/cus-edit.el (Custom-newline): If no button at point, look for a
subgroup button at start-of-line.

lisp/ChangeLog
lisp/cus-edit.el

index 63e132e95507e44448e73bfb7c4b3132c05b7e31..bd8bf932799e1fff9e5a8e82e4010b50285c0050 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-10  Glenn Morris  <rgm@gnu.org>
 
+       * cus-edit.el (Custom-newline): If no button at point, look
+       for a subgroup button at start-of-line.  (Bug#2298)
+
        * mail/rmail.el (rmail-msgend, rmail-msgbeg): Doc fixes.
 
 2011-03-10  Julien Danjou  <julien@danjou.info>
index 888216527846913e2686e66e9211cf1f9ecedc51..203043ebd97266f2aed497288d15b4d825d810b1 100644 (file)
@@ -4756,6 +4756,12 @@ The format is suitable for use with `easy-menu-define'."
   "Invoke button at POS, or refuse to allow editing of Custom buffer."
   (interactive "@d")
   (let ((button (get-char-property pos 'button)))
+    ;; If there is no button at point, then use the one at the start
+    ;; of the line, if it is a custom-group-link (bug#2298).
+    (or button
+       (if (setq button (get-char-property (line-beginning-position) 'button))
+           (or (eq (widget-type button) 'custom-group-link)
+               (setq button nil))))
     (if button
        (widget-apply-action button event)
       (error "You can't edit this part of the Custom buffer"))))