Skip to content

Commit 359a280

Browse files
committed
Change/Fix: (org-ql-view--format-element) Use org-ql--tags-at
Use org-ql--tags-at instead of org-get-tags/org-get-tags-at. This uses our cache, which should improve performance, and it obviates the function alias for Org versions before 9.3 (which occasionally misbehaves, e.g. if Org is reloaded).
1 parent 958cd50 commit 359a280

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

README.org

+3
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
418418
*Changed*
419419
+ Binding to refresh search/view buffers changed to =r=.
420420

421+
*Internal*
422+
+ When formatting entries for Org QL View buffers, use internal function for retrieving heading tags. This improves speed by using our cache, and it removes the need for a compatibility alias for Org versions before 9.3.
423+
421424
** 0.4.6
422425

423426
*Fixed*

org-ql-view.el

+6-13
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
(require 'ov)
4848
(require 'ts)
4949

50-
;;;; Compatibility
51-
52-
(when (version< org-version "9.2")
53-
(defalias 'org-get-tags #'org-get-tags-at))
54-
5550
;;;; Faces
5651

5752
(defface org-ql-view-due-date
@@ -729,18 +724,16 @@ return an empty string."
729724
(org-link-display-format it)))
730725
(todo-keyword (-some--> (org-element-property :todo-keyword element)
731726
(org-ql-view--add-todo-face it)))
732-
;; FIXME: Figure out whether I should use `org-agenda-use-tag-inheritance' or `org-use-tag-inheritance', etc.
733727
(tag-list (if org-use-tag-inheritance
734-
;; FIXME: Note that tag inheritance cannot be used here unless markers are
735-
;; added, otherwise we can't go to the item's buffer to look for inherited
736-
;; tags. (Or does `org-element-headline-parser' parse inherited tags too? I
737-
;; forget...)
728+
;; MAYBE: Use our own variable instead of `org-use-tag-inheritance'.
738729
(if-let ((marker (or (org-element-property :org-hd-marker element)
739730
(org-element-property :org-marker element))))
740-
(with-current-buffer (marker-buffer marker)
741-
;; I wish `org-get-tags' used the correct buffer automatically.
742-
(org-get-tags marker (not org-use-tag-inheritance)))
731+
(cl-loop for type in (org-ql--tags-at marker)
732+
unless (or (eq 'org-ql-nil type)
733+
(not type))
734+
append type)
743735
;; No marker found
736+
;; TODO: Use `display-warning' with `org-ql' as the type.
744737
(warn "No marker found for item: %s" title)
745738
(org-element-property :tags element))
746739
(org-element-property :tags element)))

org-ql.info

+25-19
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,12 @@ File: README.info, Node: 05-pre, Next: 046, Up: Changelog
772772
*Changed*
773773
• Binding to refresh search/view buffers changed to r.
774774

775+
*Internal*
776+
• When formatting entries for Org QL View buffers, use internal
777+
function for retrieving heading tags. This improves speed by using
778+
our cache, and it removes the need for a compatibility alias for
779+
Org versions before 9.3.
780+
775781

776782
File: README.info, Node: 046, Next: 045, Prev: 05-pre, Up: Changelog
777783

@@ -1205,25 +1211,25 @@ Node: Listing / acting-on results21208
12051211
Node: Tips25810
12061212
Node: Changelog26141
12071213
Node: 05-pre26780
1208-
Node: 04627369
1209-
Node: 04527772
1210-
Node: 04428131
1211-
Node: 04328488
1212-
Node: 04228683
1213-
Node: 04128842
1214-
Node: 0429081
1215-
Node: 03233012
1216-
Node: 03133389
1217-
Node: 0333586
1218-
Node: 02336561
1219-
Node: 02236789
1220-
Node: 02137057
1221-
Node: 0237256
1222-
Node: 0141291
1223-
Node: Notes41392
1224-
Node: Comparison with Org Agenda searches41554
1225-
Node: org-sidebar42426
1226-
Node: License42705
1214+
Node: 04627626
1215+
Node: 04528029
1216+
Node: 04428388
1217+
Node: 04328745
1218+
Node: 04228940
1219+
Node: 04129099
1220+
Node: 0429338
1221+
Node: 03233269
1222+
Node: 03133646
1223+
Node: 0333843
1224+
Node: 02336818
1225+
Node: 02237046
1226+
Node: 02137314
1227+
Node: 0237513
1228+
Node: 0141548
1229+
Node: Notes41649
1230+
Node: Comparison with Org Agenda searches41811
1231+
Node: org-sidebar42683
1232+
Node: License42962
12271233

12281234
End Tag Table
12291235

0 commit comments

Comments
 (0)