Преглед на файлове

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.
Bastien преди 5 години
родител
ревизия
4eaddab3dd
променени са 1 файла, в които са добавени 7 реда и са изтрити 6 реда
  1. 7 6
      lisp/org-list.el

+ 7 - 6
lisp/org-list.el

@@ -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.