summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-03-09 19:44:33 -0800
committerGlenn Morris <rgm@gnu.org>2011-03-09 19:44:33 -0800
commit5772caab78b85b6ae1215fbc5d63cbb4571bcf28 (patch)
treef2c29c81a3aa02137449a78eab4f7ad32b384b4e /lisp/cus-edit.el
parentccb55d277abd81b09891917b8e4cfc7a69c5a6af (diff)
downloademacs-5772caab78b85b6ae1215fbc5d63cbb4571bcf28.tar.gz
emacs-5772caab78b85b6ae1215fbc5d63cbb4571bcf28.tar.bz2
emacs-5772caab78b85b6ae1215fbc5d63cbb4571bcf28.zip
cus-edit tweak for bug#2298.
* lisp/cus-edit.el (Custom-newline): If no button at point, look for a subgroup button at start-of-line.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 88821652784..203043ebd97 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -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"))))