Skip over unimportant contexts in +org/dwim-at-point

This commit is contained in:
Henrik Lissner 2017-09-30 17:06:09 +02:00
parent ce17ecd239
commit 3c05966347
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -46,6 +46,10 @@ If on a:
(let* ((scroll-pt (window-start))
(context (org-element-context))
(type (org-element-type context)))
;; skip over unimportant contexts
(while (and context (memq type '(verbatim code bold italic underline strike-through)))
(setq context (org-element-property :parent context)
type (org-element-type context)))
(pcase type
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))