mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-07 22:32:08 -08:00
fix(org,cli): tangle: filter by tag properly
Org files with tagged headlines weren't tangled correctly. Also improves filtering by tag as in current shape it is not working at all. Fix: #8622
This commit is contained in:
parent
eeb66ed0e0
commit
29dad16dea
1 changed files with 5 additions and 7 deletions
|
|
@ -49,7 +49,7 @@ EXAMPLES:
|
|||
(setq last-heading-pos current-heading-pos)))
|
||||
(unless (or (org-in-commented-heading-p)
|
||||
(org-in-archived-heading-p))
|
||||
(let* ((tags (org-get-tags-at))
|
||||
(let* ((headline-tags (org-get-tags))
|
||||
(info (org-babel-get-src-block-info 'no-eval))
|
||||
(src-lang (nth 0 info))
|
||||
(src-tfile (cdr (assq :tangle (nth 2 info))))
|
||||
|
|
@ -66,16 +66,14 @@ EXAMPLES:
|
|||
|
||||
((let* ((tags (seq-group-by (fn! (equal (car %) "--or")) tags))
|
||||
(or-tags (mapcar #'cdr (cdr (assq t tags))))
|
||||
(and-tags (mapcar #'cdr (cdr (assq nil tags))))
|
||||
(all-tags (append or-tags and-tags)))
|
||||
(and-tags (mapcar #'cdr (cdr (assq nil tags)))))
|
||||
(and (or or-tags and-tags)
|
||||
(or (not and-tags)
|
||||
(let ((a (cl-intersection and-tags all-tags :test #'string=))
|
||||
(let ((a (cl-intersection and-tags headline-tags :test #'string=))
|
||||
(b and-tags))
|
||||
(not (or (cl-set-difference a b :test #'equal)
|
||||
(cl-set-difference b a :test #'equal)))))
|
||||
(cl-set-exclusive-or a b :test #'equal)))
|
||||
(or (not or-tags)
|
||||
(cl-intersection or-tags all-tags :test #'string=))
|
||||
(not (cl-intersection or-tags headline-tags :test #'string=)))
|
||||
t)))
|
||||
|
||||
((or (not src-tfile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue