diff --git a/doc/org-manual.org b/doc/org-manual.org index 148708939..e3a2c29f8 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -4537,14 +4537,14 @@ The following commands work with checkboxes: #+findex: org-toggle-radio-button #+cindex: radio button, checkbox as Toggle checkbox status by using the checkbox of the item at point as - a radio button: when turned on, all other checkboxes on the same - level will be turned off. With a universal prefix argument, toggle - the presence of the checkbox. With a double prefix argument, set it - to =[-]=. + a radio button: when the checkbox is turned on, all other checkboxes + on the same level will be turned off. With a universal prefix + argument, toggle the presence of the checkbox. With a double prefix + argument, set it to =[-]=. #+findex: org-list-checkbox-radio-mode {{{kdb(C-c C-c)}}} can be told to consider checkboxes as radio buttons by - setting =#+ATTR_ORG: :radio= right before the list or by calling + setting =#+ATTR_ORG: :radio t= right before the list or by calling {{{kbd(M-x org-list-checkbox-radio-mode)}}} to activate this minor mode. - {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) :: diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 8ed6a1adf..c22d9bcf8 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -54,7 +54,7 @@ If you want to occasionally toggle a checkbox as a radio button without turning this minor mode on, you can use == to call ~org-toggle-radio-button~. -You can also add =#+ATTR_ORG: :radio= right before the list to tell +You can also add =#+ATTR_ORG: :radio t= right before the list to tell Org to use radio buttons for this list only. *** Looping agenda commands over headlines diff --git a/lisp/org-list.el b/lisp/org-list.el index 6d50ea0ed..d3e661c49 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2339,13 +2339,14 @@ is an integer, 0 means `-', 1 means `+' etc. If WHICH is (defsubst org-at-radio-list-p () "Is point in a list with radio buttons?" - (let (attr) - (save-excursion - (org-at-item-p) - (goto-char (caar (org-list-struct))) - (org-backward-element) - (setq attr (car (org-element-property :attr_org (org-element-at-point)))) - (when attr (string-match-p ":radio" attr))))) + (when (org-at-item-p) + (let (attr) + (save-excursion + (goto-char (caar (org-list-struct))) + (org-backward-element) + (setq attr (org-export-read-attribute + :attr_org (org-element-at-point)))) + (when (plist-get attr :radio) t)))) (defun org-toggle-checkbox (&optional toggle-presence) "Toggle the checkbox in the current line.