fix(org): list checkbox toggle on RET

A subtle change in the way org-toggle-checkbox handles its prefix
argument changed how RET (+org/dwim-at-point) handled list
checkboxes (incorrectlying swapping [ ] with [-], but not back, unless
the cursor was directly on top of the checkbox).
This commit is contained in:
Henrik Lissner 2024-02-17 07:11:48 -05:00
parent cce9438d9f
commit f0ad161643
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -272,13 +272,12 @@ If on a:
(org-element-property :end lineage)) (org-element-property :end lineage))
(org-open-at-point arg)))) (org-open-at-point arg))))
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
(org-toggle-checkbox))
(`paragraph (`paragraph
(+org--toggle-inline-images-in-subtree)) (+org--toggle-inline-images-in-subtree))
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))
(org-toggle-checkbox (if (equal match "[ ]") '(16)))))
(_ (_
(if (or (org-in-regexp org-ts-regexp-both nil t) (if (or (org-in-regexp org-ts-regexp-both nil t)
(org-in-regexp org-tsr-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t)