first bug? #1

Closed
opened 7 months ago by minshall · 13 comments

hi. i am on arch. emacs:

GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26

i installed consult with straight.el:

(consult :type git :flavor melpa :files (:defaults (:exclude "consult-flycheck.el") "consult-pkg.el") :host github :repo "minad/consult")

i just installed (also via straight.el) consult-recoll:

(consult-recoll :type git :flavor melpa :repo "https://codeberg.org/jao/consult-recoll.git")

and, then tried a query:

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0)
  consult--async-refresh-timer()
  consult-recoll--search()
  consult-recoll()
  funcall-interactively(consult-recoll)
  call-interactively(consult-recoll record nil)
  command-execute(consult-recoll record)
  execute-extended-command(nil "consult-recoll" nil)
  funcall-interactively(execute-extended-command nil "consult-recoll" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

cheers.

hi. i am on arch. emacs: ```` GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26 ```` i installed consult with straight.el: ```` (consult :type git :flavor melpa :files (:defaults (:exclude "consult-flycheck.el") "consult-pkg.el") :host github :repo "minad/consult") ```` i just installed (also via straight.el) `consult-recoll`: ```` (consult-recoll :type git :flavor melpa :repo "https://codeberg.org/jao/consult-recoll.git") ```` and, then tried a query: ```` Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0) consult--async-refresh-timer() consult-recoll--search() consult-recoll() funcall-interactively(consult-recoll) call-interactively(consult-recoll record nil) command-execute(consult-recoll record) execute-extended-command(nil "consult-recoll" nil) funcall-interactively(execute-extended-command nil "consult-recoll" nil) call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) ```` cheers.
Owner

Hi. Hmm, I cannot reproduce this bug. It's looking like a failure inside consult... maybe you caught it in the middle of something? Could you try to refresh it (i am not sure how straight works, i'm using vanilla package.el). Thanks!

Hi. Hmm, I cannot reproduce this bug. It's looking like a failure inside consult... maybe you caught it in the middle of something? Could you try to refresh it (i am not sure how straight works, i'm using vanilla package.el). Thanks!
Owner

Forgot to ask: what version of recoll are you running? is recollq in your path?

Forgot to ask: what version of recoll are you running? is recollq in your path?
Poster
bash apollo2 (master): {50111} recoll -v
Recoll 1.29.2 + Xapian 1.4.18

```` bash apollo2 (master): {50111} recoll -v Recoll 1.29.2 + Xapian 1.4.18 ````
Poster

so, it's some issue with byte compiling. it doesn't fail if i visit consult-recoll.el and (eval-buffer).

straight.el compiles it like this

bash apollo2 (master): {50112} /bin/emacs -Q -L /home/minshall/.emacs.d/straight/build/consult-recoll/   -L /home/minshall/.emacs.d/straight/build/consult/   --batch --eval "(byte-recompile-directory \"/home/minshall/.emacs.d/straight/build/consult-recoll/\" 0 'force)"
Checking /home/minshall/.emacs.d/straight/build/consult-recoll/...
Compiling /home/minshall/.emacs.d/straight/build/consult-recoll/consult-recoll-autoloads.el...
Compiling /home/minshall/.emacs.d/straight/build/consult-recoll/consult-recoll.el...

In consult-recoll--search:
consult-recoll.el:103:4:Warning: consult--async-refresh-timer called with 0
    arguments, but requires 1-2
consult-recoll.el:104:21:Warning: consult--async-filter called with 1
    argument, but requires 2
consult-recoll.el:105:21:Warning: consult--async-map called with 1 argument,
    but requires 2
consult-recoll.el:105:42:Warning: consult--async-process called with 1
    argument, but requires 2
consult-recoll.el:103:42:Warning: consult--async-throttle called with 0
    arguments, but requires 1-3
consult-recoll.el:103:42:Warning: consult--async-split called with 0
    arguments, but requires 1

In end of data:
consult-recoll.el:122:1:Warning: the function ‘thread-first’ is not known to
    be defined.
Done (Total of 1 file compiled, 1 skipped)

otoh, this works

/bin/emacs -Q --eval "(require 'subr-x)" -L /home/minshall/.emacs.d/straight/build/consult-recoll/   -L /home/minshall/.emacs.d/straight/build/consult/   --batch --eval "(byte-recompile-directory \"/home/minshall/.emacs.d/straight/build/consult-recoll/\" 0 'force)"

it's like this code at the beginning of consult.el is being ignored by the byte compiler?

(eval-when-compile
  (require 'cl-lib)
  (require 'subr-x))

and, in fact, if i delete consult.elc, then the compile is fine.

does that help? let me know, i'm not a big byte compile expert, but i can probe further. cheers.

so, it's some issue with byte compiling. it doesn't fail if i visit `consult-recoll.el` and `(eval-buffer)`. straight.el compiles it like this ```` bash apollo2 (master): {50112} /bin/emacs -Q -L /home/minshall/.emacs.d/straight/build/consult-recoll/ -L /home/minshall/.emacs.d/straight/build/consult/ --batch --eval "(byte-recompile-directory \"/home/minshall/.emacs.d/straight/build/consult-recoll/\" 0 'force)" Checking /home/minshall/.emacs.d/straight/build/consult-recoll/... Compiling /home/minshall/.emacs.d/straight/build/consult-recoll/consult-recoll-autoloads.el... Compiling /home/minshall/.emacs.d/straight/build/consult-recoll/consult-recoll.el... In consult-recoll--search: consult-recoll.el:103:4:Warning: consult--async-refresh-timer called with 0 arguments, but requires 1-2 consult-recoll.el:104:21:Warning: consult--async-filter called with 1 argument, but requires 2 consult-recoll.el:105:21:Warning: consult--async-map called with 1 argument, but requires 2 consult-recoll.el:105:42:Warning: consult--async-process called with 1 argument, but requires 2 consult-recoll.el:103:42:Warning: consult--async-throttle called with 0 arguments, but requires 1-3 consult-recoll.el:103:42:Warning: consult--async-split called with 0 arguments, but requires 1 In end of data: consult-recoll.el:122:1:Warning: the function ‘thread-first’ is not known to be defined. Done (Total of 1 file compiled, 1 skipped) ```` otoh, this works ```` /bin/emacs -Q --eval "(require 'subr-x)" -L /home/minshall/.emacs.d/straight/build/consult-recoll/ -L /home/minshall/.emacs.d/straight/build/consult/ --batch --eval "(byte-recompile-directory \"/home/minshall/.emacs.d/straight/build/consult-recoll/\" 0 'force)" ```` it's like this code at the beginning of consult.el is being ignored by the byte compiler? ```` (eval-when-compile (require 'cl-lib) (require 'subr-x)) ```` and, in fact, if i delete `consult.elc`, then the compile is fine. does that help? let me know, i'm not a big byte compile expert, but i can probe further. cheers.
Poster

also, this post. fwiw.

also, [this post](https://emacs.stackexchange.com/questions/37529/eval-when-compile-statements-not-running-in-files-required-by-compiled-file). fwiw.
Owner

@minshall yes, it looks as if the eval-when-compile is being skipped for some reason,
but, like you, i don't have a good explanation for that behaviour. maybe consult's maintainer, will... @minad any ideas?

@minshall yes, it looks as if the eval-when-compile is being skipped for some reason, but, like you, i don't have a good explanation for that behaviour. maybe consult's maintainer, will... @minad any ideas?
Owner

@minshall how about we add to consult-recoll.el something like

    (eval-when-compile (require 'consult))

instead of the plain require... does that help?

@minshall how about we add to consult-recoll.el something like (eval-when-compile (require 'consult)) instead of the plain require... does that help?
Owner

er, i meant (require 'subr-x) (although i don't see why we should need it)

er, i meant `(require 'subr-x)` (although i don't see why we should need it)
Poster

@jao both plain (require 'subr-x) and the same embedded in (eval-when-compile) seem to work.

@jao both plain `(require 'subr-x)` and the same embedded in `(eval-when-compile)` seem to work.
Owner

@minshall thanks for checking. since it does no harm, i've pushed a commit adding the require... i guess it'll show up in melpa in their next update.

@minshall thanks for checking. since it does no harm, i've pushed a commit adding the require... i guess it'll show up in melpa in their next update.
Poster

@jao yes, that seems to work. thanks! (what's the etiquette -- do you close? do i, as the originator, close?)

@jao yes, that seems to work. thanks! (what's the etiquette -- do you close? do i, as the originator, close?)
Owner

oh, my etiquette is... whoever gets at it first! :) closing, thanks for taking the time to follow up the problem. i hope you're finding the package useful.

oh, my etiquette is... whoever gets at it first! :) closing, thanks for taking the time to follow up the problem. i hope you're finding the package useful.
jao closed this issue 7 months ago

I didn't saw the mentioning before. The requires in the eval-when-compile block are ignored if consult.elc is used. The reason is probably that the eval-when-compile block is not present anymore in the compiled bytecode.

I didn't saw the mentioning before. The requires in the `eval-when-compile` block are ignored if consult.elc is used. The reason is probably that the `eval-when-compile` block is not present anymore in the compiled bytecode.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.