Skip to content

Commit 0080055

Browse files
committed
Fix: Copy macro peg-parse-string from peg-tests.el
Unfortunately, the macro was moved from peg.el to peg-tests.el in later versions of peg, so we copy it for our use here. Fixes #75. Thanks to Karl Voit (@novoid) and @karlicoss for reporting. Released as 0.4.6.
1 parent 5a031bf commit 0080055

File tree

3 files changed

+93
-57
lines changed

3 files changed

+93
-57
lines changed

README.org

+5
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
398398

399399
/Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases.
400400

401+
** 0.4.6
402+
403+
*Fixed*
404+
+ Compatibility with newer versions of the =peg= library, which removed a macro used by this package. (Fixes [[https://github.com/alphapapa/org-ql/issues/75][#75]]. Thanks to [[https://github.com/novoid][Karl Voit]] and [[https://github.com/karlicoss][@karlicoss]] for reporting.)
405+
401406
** 0.4.5
402407

403408
*Fixed*

org-ql.el

+17-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
;; Author: Adam Porter <[email protected]>
44
;; Url: https://github.com/alphapapa/org-ql
5-
;; Version: 0.4.5
5+
;; Version: 0.4.6
66
;; Package-Requires: ((emacs "26.1") (dash "2.13") (dash-functional "1.2.0") (f "0.17.2") (org "9.0") (org-super-agenda "1.2-pre") (ov "1.0.6") (peg "0.6") (s "1.12.0") (ts "0.2-pre"))
77
;; Keywords: hypermedia, outlines, Org, agenda
88

@@ -1529,6 +1529,21 @@ element should be a regexp string."
15291529
(defvar peg-errors nil)
15301530
(defvar peg-stack nil)
15311531

1532+
(defmacro org-ql--peg-parse-string (rules string &optional noerror)
1533+
"Parse STRING according to RULES.
1534+
If NOERROR is non-nil, push nil resp. t if the parse failed
1535+
resp. succeded instead of signaling an error."
1536+
;; Unfortunately, this macro was moved to peg-tests.el, so we copy it here.
1537+
`(with-temp-buffer
1538+
(insert ,string)
1539+
(goto-char (point-min))
1540+
,(if noerror
1541+
(let ((entry (make-symbol "entry"))
1542+
(start (caar rules)))
1543+
`(peg-parse (entry (or (and ,start `(-- t)) ""))
1544+
. ,rules))
1545+
`(peg-parse . ,rules))))
1546+
15321547
(cl-eval-when (compile load eval)
15331548
;; This `eval-when' is necessary, otherwise the macro does not define
15341549
;; the function correctly, apparently because `org-ql-predicates'
@@ -1555,7 +1570,7 @@ Builds the PEG expression using predicates defined in
15551570
"Return query parsed from plain query string INPUT.
15561571
Multiple predicates are combined with BOOLEAN."
15571572
(unless (s-blank-str? input)
1558-
(let* ((query (peg-parse-string
1573+
(let* ((query (org-ql--peg-parse-string
15591574
((query (+ term
15601575
(opt (+ (syntax-class whitespace) (any)))))
15611576
(term (or (and negation (list positive-term)

org-ql.info

+71-55
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Functions / Macros
6363

6464
Changelog
6565

66+
* 0.4.6: 046.
6667
* 0.4.5: 045.
6768
* 0.4.4: 044.
6869
* 0.4.3: 043.
@@ -708,6 +709,7 @@ releases.
708709

709710
* Menu:
710711

712+
* 0.4.6: 046.
711713
* 0.4.5: 045.
712714
* 0.4.4: 044.
713715
* 0.4.3: 043.
@@ -724,9 +726,22 @@ releases.
724726
* 0.1: 01.
725727

726728

727-
File: README.info, Node: 045, Next: 044, Up: Changelog
729+
File: README.info, Node: 046, Next: 045, Up: Changelog
728730

729-
5.1 0.4.5
731+
5.1 0.4.6
732+
=========
733+
734+
*Fixed*
735+
• Compatibility with newer versions of the peg library, which removed
736+
a macro used by this package. (Fixes #75
737+
(https://github.com/alphapapa/org-ql/issues/75). Thanks to Karl
738+
Voit (https://github.com/novoid) and @karlicoss
739+
(https://github.com/karlicoss) for reporting.)
740+
741+

742+
File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog
743+
744+
5.2 0.4.5
730745
=========
731746

732747
*Fixed*
@@ -738,7 +753,7 @@ File: README.info, Node: 045, Next: 044, Up: Changelog
738753

739754
File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog
740755

741-
5.2 0.4.4
756+
5.3 0.4.4
742757
=========
743758

744759
*Fixed*
@@ -750,7 +765,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog
750765

751766
File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog
752767

753-
5.3 0.4.3
768+
5.4 0.4.3
754769
=========
755770

756771
*Fixed*
@@ -760,7 +775,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog
760775

761776
File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog
762777

763-
5.4 0.4.2
778+
5.5 0.4.2
764779
=========
765780

766781
*Fixed*
@@ -769,7 +784,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog
769784

770785
File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog
771786

772-
5.5 0.4.1
787+
5.6 0.4.1
773788
=========
774789

775790
*Fixed*
@@ -779,7 +794,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog
779794

780795
File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog
781796

782-
5.6 0.4
797+
5.7 0.4
783798
=======
784799

785800
_Note:_ The next release, 0.5, may include changes which will require
@@ -860,7 +875,7 @@ as they will be pushed to the master branch when ready.
860875

861876
File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog
862877

863-
5.7 0.3.2
878+
5.8 0.3.2
864879
=========
865880

866881
*Fixed*
@@ -873,7 +888,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog
873888

874889
File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog
875890

876-
5.8 0.3.1
891+
5.9 0.3.1
877892
=========
878893

879894
*Fixed*
@@ -883,8 +898,8 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog
883898

884899
File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog
885900

886-
5.9 0.3
887-
=======
901+
5.10 0.3
902+
========
888903

889904
*Added*
890905
• Alternative, non-sexp query syntax for commands org-ql-search and
@@ -948,7 +963,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog
948963

949964
File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog
950965

951-
5.10 0.2.3
966+
5.11 0.2.3
952967
==========
953968

954969
*Fixed*
@@ -958,7 +973,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog
958973

959974
File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog
960975

961-
5.11 0.2.2
976+
5.12 0.2.2
962977
==========
963978

964979
*Fixed*
@@ -969,7 +984,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog
969984

970985
File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog
971986

972-
5.12 0.2.1
987+
5.13 0.2.1
973988
==========
974989

975990
*Fixed*
@@ -979,7 +994,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog
979994

980995
File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog
981996

982-
5.13 0.2
997+
5.14 0.2
983998
========
984999

9851000
*Added*
@@ -1062,7 +1077,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog
10621077

10631078
File: README.info, Node: 01, Prev: 02, Up: Changelog
10641079

1065-
5.14 0.1
1080+
5.15 0.1
10661081
========
10671082

10681083
First tagged release.
@@ -1123,45 +1138,46 @@ GPLv3
11231138

11241139
Tag Table:
11251140
Node: Top225
1126-
Node: Contents1477
1127-
Node: Screenshots1651
1128-
Node: Installation1769
1129-
Node: Quelpa2407
1130-
Node: Usage2850
1131-
Node: Commands3199
1132-
Node: org-ql-search3672
1133-
Node: helm-org-ql5320
1134-
Node: org-ql-view5732
1135-
Node: org-ql-view-sidebar5930
1136-
Node: org-ql-view-recent-items6286
1137-
Node: org-ql-sparse-tree6770
1138-
Node: Queries7570
1139-
Node: Non-sexp query syntax8478
1140-
Node: General predicates10185
1141-
Node: Ancestor/descendant predicates14992
1142-
Node: Date/time predicates16120
1143-
Node: Functions / Macros18775
1144-
Node: Agenda-like views19008
1145-
Node: Listing / acting-on results20413
1146-
Node: Changelog25015
1147-
Node: 04525619
1148-
Node: 04425966
1149-
Node: 04326323
1150-
Node: 04226518
1151-
Node: 04126677
1152-
Node: 0426916
1153-
Node: 03230847
1154-
Node: 03131224
1155-
Node: 0331419
1156-
Node: 02334392
1157-
Node: 02234620
1158-
Node: 02134888
1159-
Node: 0235087
1160-
Node: 0139122
1161-
Node: Notes39223
1162-
Node: Comparison with Org Agenda searches39385
1163-
Node: org-sidebar40256
1164-
Node: License40535
1141+
Node: Contents1492
1142+
Node: Screenshots1666
1143+
Node: Installation1784
1144+
Node: Quelpa2422
1145+
Node: Usage2865
1146+
Node: Commands3214
1147+
Node: org-ql-search3687
1148+
Node: helm-org-ql5335
1149+
Node: org-ql-view5747
1150+
Node: org-ql-view-sidebar5945
1151+
Node: org-ql-view-recent-items6301
1152+
Node: org-ql-sparse-tree6785
1153+
Node: Queries7585
1154+
Node: Non-sexp query syntax8493
1155+
Node: General predicates10200
1156+
Node: Ancestor/descendant predicates15007
1157+
Node: Date/time predicates16135
1158+
Node: Functions / Macros18790
1159+
Node: Agenda-like views19023
1160+
Node: Listing / acting-on results20428
1161+
Node: Changelog25030
1162+
Node: 04625649
1163+
Node: 04526037
1164+
Node: 04426396
1165+
Node: 04326753
1166+
Node: 04226948
1167+
Node: 04127107
1168+
Node: 0427346
1169+
Node: 03231277
1170+
Node: 03131654
1171+
Node: 0331849
1172+
Node: 02334824
1173+
Node: 02235052
1174+
Node: 02135320
1175+
Node: 0235519
1176+
Node: 0139554
1177+
Node: Notes39655
1178+
Node: Comparison with Org Agenda searches39817
1179+
Node: org-sidebar40688
1180+
Node: License40967
11651181

11661182
End Tag Table
11671183

0 commit comments

Comments
 (0)