Subject: Re: bug#74735: 31.0.50; Commit 986621ae1ff4d3cfad31adb20216f1f71ce0747c broke org-ql

From: Visuwesh <[email-masked]>
Date: Sat, 14 Dec 2024 07:13:23 +0530

[வெள்ளி டிசம்பர் 13, 2024] Stefan Monnier wrote:

>> The recent change you made in
>>
>>     commit 986621ae1ff4d3cfad31adb20216f1f71ce0747c
>>     Author: Stefan Monnier <[email-masked]>
>>     Date:   Tue Nov 12 23:12:07 2024 -0500
>>
>>         (with-peg-rules): Build proper `peg-function`s
>>
>>         * lisp/progmodes/peg.el (with-peg-rules): Use the new (FUNC EXP)
>>         feature in `cl-labels`.
>>
>> broke org-ql's PEG parser.  I tried to reproduce it with the number
>> parser example given in the Elisp Info manual but failed.  With the
>> above change, I get an assertion error when I try to use org-ql-find:
>>
>> Debugger entered--Lisp error: (cl-assertion-failed (lexical-binding nil))
>
> Thanks.  Until this is fixed on `master`, the patch below will fix
> `org-ql` to use lexical-binding for that code (like it already does for
> all the rest of the code).

Thanks!  I tried this exact change but it still erred.  Now, the error
went away.  I guess I did not re-eval the relevant functions properly.

> [ It also removes a NUL byte from the file which caused some tools to
>   treat it as a binary file.  ]

Thanks for catching this!  I always wondered why the modeline did not
say 'U' for the encoding.

> diff --git a/org-ql.el b/org-ql.el
> index f3b7715..654da49 100644
> --- a/org-ql.el
> +++ b/org-ql.el
> @@ -863,7 +863,7 @@ respectively."
>                                        (zero-or-more (not (any "\n\":"))))
>                                   (zero-or-more (not (any "\n\":")))))
>                        (group (zero-or-more (not (any "\n")))) "\n"
> -                      (63 (group (*\? (not (any "."))) "\n"))
> +                      (63 (group (*\? (not (any "\0"))) "\n"))
>                        (zero-or-more (any "	 "))
>                        "#+end_src")
>                  t))
> @@ -1003,7 +1003,8 @@ value of `org-ql-predicates')."
>                                           (peg-run (peg ,(caar pexs))
>                                                    (lambda (failures)
>                                                      (when org-ql-signal-peg-failure
> -                                                      (peg-signal-failure failures)))))))))
> +                                                      (peg-signal-failure failures)))))
> +                                      t))))
>                          (pcase parsed-sexp
>                            (`(,one-predicate) one-predicate)
>                            (`(,_ . ,_) (cons boolean (reverse parsed-sexp)))

Shall I notify Adam of this change?