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* *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.) + 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 ** 0.7

View file

@ -116,7 +116,7 @@ single predicate)."
;; without properties, so we have to use `org-get-heading', which added additional ;; 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 ;; optional arguments in a certain Org version, so in those versions, it will
;; return priority cookies and comment strings. ;; 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) (when (gethash heading table)
;; Disambiguate heading (even adding the path isn't enough, because that could ;; Disambiguate heading (even adding the path isn't enough, because that could
;; also be duplicated). ;; 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 INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY START-INFO-DIR-ENTRY
@ -71,33 +71,33 @@ Functions / Macros
Changelog Changelog
* 0.7.1-pre: 071-pre. * 0.7.1-pre: 071-pre.
* 0.7: 07. * 0.7: 07.
* 0.6.3: 063. * 0.6.3: 063.
* 0.6.2: 062. * 0.6.2: 062.
* 0.6.1: 061. * 0.6.1: 061.
* 0.6: 06. * 0.6: 06.
* 0.5.2: 052. * 0.5.2: 052.
* 0.5.1: 051. * 0.5.1: 051.
* 0.5: 05. * 0.5: 05.
* 0.4.9: 049. * 0.4.9: 049.
* 0.4.8: 048. * 0.4.8: 048.
* 0.4.7: 047. * 0.4.7: 047.
* 0.4.6: 046. * 0.4.6: 046.
* 0.4.5: 045. * 0.4.5: 045.
* 0.4.4: 044. * 0.4.4: 044.
* 0.4.3: 043. * 0.4.3: 043.
* 0.4.2: 042. * 0.4.2: 042.
* 0.4.1: 041. * 0.4.1: 041.
* 0.4: 04. * 0.4: 04.
* 0.3.2: 032. * 0.3.2: 032.
* 0.3.1: 031. * 0.3.1: 031.
* 0.3: 03. * 0.3: 03.
* 0.2.3: 023. * 0.2.3: 023.
* 0.2.2: 022. * 0.2.2: 022.
* 0.2.1: 021. * 0.2.1: 021.
* 0.2: 02. * 0.2: 02.
* 0.1: 01. * 0.1: 01.
Notes Notes
@ -991,33 +991,33 @@ releases.
* Menu: * Menu:
* 0.7.1-pre: 071-pre. * 0.7.1-pre: 071-pre.
* 0.7: 07. * 0.7: 07.
* 0.6.3: 063. * 0.6.3: 063.
* 0.6.2: 062. * 0.6.2: 062.
* 0.6.1: 061. * 0.6.1: 061.
* 0.6: 06. * 0.6: 06.
* 0.5.2: 052. * 0.5.2: 052.
* 0.5.1: 051. * 0.5.1: 051.
* 0.5: 05. * 0.5: 05.
* 0.4.9: 049. * 0.4.9: 049.
* 0.4.8: 048. * 0.4.8: 048.
* 0.4.7: 047. * 0.4.7: 047.
* 0.4.6: 046. * 0.4.6: 046.
* 0.4.5: 045. * 0.4.5: 045.
* 0.4.4: 044. * 0.4.4: 044.
* 0.4.3: 043. * 0.4.3: 043.
* 0.4.2: 042. * 0.4.2: 042.
* 0.4.1: 041. * 0.4.1: 041.
* 0.4: 04. * 0.4: 04.
* 0.3.2: 032. * 0.3.2: 032.
* 0.3.1: 031. * 0.3.1: 031.
* 0.3: 03. * 0.3: 03.
* 0.2.3: 023. * 0.2.3: 023.
* 0.2.2: 022. * 0.2.2: 022.
* 0.2.1: 021. * 0.2.1: 021.
* 0.2: 02. * 0.2: 02.
* 0.1: 01. * 0.1: 01.
 
File: README.info, Node: 071-pre, Next: 07, Up: Changelog File: README.info, Node: 071-pre, Next: 07, Up: Changelog
@ -1030,6 +1030,8 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog
Emacs completion. (See #338 Emacs completion. (See #338
(https://github.com/alphapapa/org-ql/issues/338). Thanks to (https://github.com/alphapapa/org-ql/issues/338). Thanks to
arozbiz (https://github.com/arozbiz) for reporting.) 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 File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog
@ -1717,71 +1719,71 @@ GPLv3
 
Tag Table: Tag Table:
Node: Top225 Node: Top225
Node: Contents1812 Node: Contents1785
Node: Screenshots1935 Node: Screenshots1908
Node: Installation2053 Node: Installation2026
Node: Quelpa2567 Node: Quelpa2540
Node: Helm support3095 Node: Helm support3068
Node: Usage3498 Node: Usage3471
Node: Commands3896 Node: Commands3869
Node: org-ql-find4340 Node: org-ql-find4313
Node: org-ql-refile4806 Node: org-ql-refile4779
Node: org-ql-search5129 Node: org-ql-search5102
Node: helm-org-ql6825 Node: helm-org-ql6798
Node: org-ql-view7203 Node: org-ql-view7176
Node: org-ql-view-sidebar7733 Node: org-ql-view-sidebar7706
Node: org-ql-view-recent-items8113 Node: org-ql-view-recent-items8086
Node: org-ql-sparse-tree8609 Node: org-ql-sparse-tree8582
Node: Queries9409 Node: Queries9382
Node: Non-sexp query syntax10526 Node: Non-sexp query syntax10499
Node: General predicates12285 Node: General predicates12258
Node: Ancestor/descendant predicates19272 Node: Ancestor/descendant predicates19245
Node: Date/time predicates20400 Node: Date/time predicates20373
Node: Functions / Macros23524 Node: Functions / Macros23497
Node: Agenda-like views23822 Node: Agenda-like views23795
Ref: Function org-ql-block23984 Ref: Function org-ql-block23957
Node: Listing / acting-on results25245 Node: Listing / acting-on results25218
Ref: Caching25453 Ref: Caching25426
Ref: Function org-ql-select26366 Ref: Function org-ql-select26339
Ref: Function org-ql-query28792 Ref: Function org-ql-query28765
Ref: Macro org-ql (deprecated)30566 Ref: Macro org-ql (deprecated)30539
Node: Custom predicates30881 Node: Custom predicates30854
Ref: Macro org-ql-defpred31105 Ref: Macro org-ql-defpred31078
Node: Dynamic block34546 Node: Dynamic block34519
Node: Links37270 Node: Links37243
Node: Tips37957 Node: Tips37930
Node: Changelog38281 Node: Changelog38254
Node: 071-pre39079 Node: 071-pre39025
Node: 0739416 Node: 0739507
Node: 06342344 Node: 06342435
Node: 06242875 Node: 06242966
Node: 06143180 Node: 06143271
Node: 0643748 Node: 0643839
Node: 05246802 Node: 05246893
Node: 05147102 Node: 05147193
Node: 0547525 Node: 0547616
Node: 04949054 Node: 04949145
Node: 04849336 Node: 04849427
Node: 04749685 Node: 04749776
Node: 04650094 Node: 04650185
Node: 04550502 Node: 04550593
Node: 04450863 Node: 04450954
Node: 04351222 Node: 04351313
Node: 04251425 Node: 04251516
Node: 04151586 Node: 04151677
Node: 0451833 Node: 0451924
Node: 03255934 Node: 03256025
Node: 03156337 Node: 03156428
Node: 0356534 Node: 0356625
Node: 02359834 Node: 02359925
Node: 02260068 Node: 02260159
Node: 02160348 Node: 02160439
Node: 0260553 Node: 0260644
Node: 0164631 Node: 0164722
Node: Notes64732 Node: Notes64823
Node: Comparison with Org Agenda searches64894 Node: Comparison with Org Agenda searches64985
Node: org-sidebar65783 Node: org-sidebar65874
Node: License66062 Node: License66153
 
End Tag Table End Tag Table