org-list.el: Fix `org-at-radio-list-p'

* lisp/org-list.el (org-at-radio-list-p): Don't choke the list
is at the beginning of the buffer.
This commit is contained in:
Bastien 2020-02-16 11:12:06 +01:00
parent 833753abcf
commit 4eaddab3dd
1 changed files with 7 additions and 6 deletions

View File

@ -2340,13 +2340,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?"
(when (org-at-item-p)
(let (attr)
(save-excursion
(goto-char (caar (org-list-struct)))
(save-excursion
(goto-char (caar (org-list-struct)))
(ignore-errors
(org-backward-element)
(setq attr (org-export-read-attribute
:attr_org (org-element-at-point))))
(when (plist-get attr :radio) t))))
(string= (plist-get (org-export-read-attribute
:attr_org (org-element-at-point))
:radio)
"t")))))
(defun org-toggle-checkbox (&optional toggle-presence)
"Toggle the checkbox in the current line.