Fix: (org-ql-completing-read) Format links before display

Also use org-entry-get to get the heading, which should avoid issues
with different Org versions having different optional arguments to
org-get-heading.
This commit is contained in:
Adam Porter 2023-05-05 17:23:50 -05:00
parent 1d98c7d07c
commit 2c098540ca
3 changed files with 124 additions and 121 deletions

View file

@ -547,6 +547,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like:
*Fixes*
+ Function ~org-ql-completing-read~ is more compatible with default Emacs completion. (See [[https://github.com/alphapapa/org-ql/issues/338][#338]]. Thanks to [[https://github.com/arozbiz][arozbiz]] for reporting.)
+ In ~org-ql-completing-read~, format links for display, and use ~org-entry-get~ internally rather than ~org-get-heading~.
** 0.7

View file

@ -116,7 +116,7 @@ single predicate)."
;; without properties, so we have to use `org-get-heading', which added additional
;; optional arguments in a certain Org version, so in those versions, it will
;; return priority cookies and comment strings.
(let ((heading (org-get-heading t t)))
(let ((heading (org-link-display-format (org-entry-get (point) "ITEM"))))
(when (gethash heading table)
;; Disambiguate heading (even adding the path isn't enough, because that could
;; also be duplicated).

View file

@ -1,4 +1,4 @@
This is README.info, produced by makeinfo version 5.2 from README.texi.
This is README.info, produced by makeinfo version 6.7 from README.texi.
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
@ -1030,6 +1030,8 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog
Emacs completion. (See #338
(https://github.com/alphapapa/org-ql/issues/338). Thanks to
arozbiz (https://github.com/arozbiz) for reporting.)
• In org-ql-completing-read, format links for display, and use
org-entry-get internally rather than org-get-heading.

File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog
@ -1717,71 +1719,71 @@ GPLv3

Tag Table:
Node: Top225
Node: Contents1812
Node: Screenshots1935
Node: Installation2053
Node: Quelpa2567
Node: Helm support3095
Node: Usage3498
Node: Commands3896
Node: org-ql-find4340
Node: org-ql-refile4806
Node: org-ql-search5129
Node: helm-org-ql6825
Node: org-ql-view7203
Node: org-ql-view-sidebar7733
Node: org-ql-view-recent-items8113
Node: org-ql-sparse-tree8609
Node: Queries9409
Node: Non-sexp query syntax10526
Node: General predicates12285
Node: Ancestor/descendant predicates19272
Node: Date/time predicates20400
Node: Functions / Macros23524
Node: Agenda-like views23822
Ref: Function org-ql-block23984
Node: Listing / acting-on results25245
Ref: Caching25453
Ref: Function org-ql-select26366
Ref: Function org-ql-query28792
Ref: Macro org-ql (deprecated)30566
Node: Custom predicates30881
Ref: Macro org-ql-defpred31105
Node: Dynamic block34546
Node: Links37270
Node: Tips37957
Node: Changelog38281
Node: 071-pre39079
Node: 0739416
Node: 06342344
Node: 06242875
Node: 06143180
Node: 0643748
Node: 05246802
Node: 05147102
Node: 0547525
Node: 04949054
Node: 04849336
Node: 04749685
Node: 04650094
Node: 04550502
Node: 04450863
Node: 04351222
Node: 04251425
Node: 04151586
Node: 0451833
Node: 03255934
Node: 03156337
Node: 0356534
Node: 02359834
Node: 02260068
Node: 02160348
Node: 0260553
Node: 0164631
Node: Notes64732
Node: Comparison with Org Agenda searches64894
Node: org-sidebar65783
Node: License66062
Node: Contents1785
Node: Screenshots1908
Node: Installation2026
Node: Quelpa2540
Node: Helm support3068
Node: Usage3471
Node: Commands3869
Node: org-ql-find4313
Node: org-ql-refile4779
Node: org-ql-search5102
Node: helm-org-ql6798
Node: org-ql-view7176
Node: org-ql-view-sidebar7706
Node: org-ql-view-recent-items8086
Node: org-ql-sparse-tree8582
Node: Queries9382
Node: Non-sexp query syntax10499
Node: General predicates12258
Node: Ancestor/descendant predicates19245
Node: Date/time predicates20373
Node: Functions / Macros23497
Node: Agenda-like views23795
Ref: Function org-ql-block23957
Node: Listing / acting-on results25218
Ref: Caching25426
Ref: Function org-ql-select26339
Ref: Function org-ql-query28765
Ref: Macro org-ql (deprecated)30539
Node: Custom predicates30854
Ref: Macro org-ql-defpred31078
Node: Dynamic block34519
Node: Links37243
Node: Tips37930
Node: Changelog38254
Node: 071-pre39025
Node: 0739507
Node: 06342435
Node: 06242966
Node: 06143271
Node: 0643839
Node: 05246893
Node: 05147193
Node: 0547616
Node: 04949145
Node: 04849427
Node: 04749776
Node: 04650185
Node: 04550593
Node: 04450954
Node: 04351313
Node: 04251516
Node: 04151677
Node: 0451924
Node: 03256025
Node: 03156428
Node: 0356625
Node: 02359925
Node: 02260159
Node: 02160439
Node: 0260644
Node: 0164722
Node: Notes64823
Node: Comparison with Org Agenda searches64985
Node: org-sidebar65874
Node: License66153

End Tag Table