Error running timer: (void-variable repo)
m-delfino opened this issue · comments
Describe the bug
consult-gh-search-[issues,prs,code] raise a Error running timer: (void-variable repo)
error when called with a prefix ARG.
To Reproduce
Steps to reproduce the behavior:
- C-u M-x consult-gh-search-[issues,prs,code]
- Search for a repository and select it
- Enter at least two characters in the [issues,prs,code] search
- See error
Expected behavior
Search for issues, prs or code inside the selected repository.
Important Information:
- GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-08-30, modified by Debian
Additional context
The possible cause is a wrong quoting of the arguments passed to append consult-gh-args
, eg: https://github.com/armindarvish/consult-gh/blob/develop/consult-gh.org?plain=1#L2351
Pull request #81 should fix this bug.
@m-delfino I cannot reproduce this issue! I looked at your pull-request, and it seems fine to me, but I am still hesitant to accept it because I am not sure why you have the original issue to begin with. I am wondering if there is something special in your case (and perhaps more fundamental about how everything gets compiled or built in your setup) that is causing the issue to begin with.
I am going to wait and see if anyone else reports the same issue or if I find a way to reproduce the issue before moving forward with your pull request. If you have any other extra information that can help figure out why this is happening in your case, I'd appreciate it.
@armindarvish, sure, here is some extra information.
I have updated the bug description for clarity. The initial wording indicated that the error occurred when selecting a repository. However, the issue actually arises after selecting a repository and then conducting a search for issues, pull requests, or code.
I'm able to reproduce the bug using a vanilla emacs GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-08-30, modified by Debian
with the following init.el
:
(setq package-enable-at-startup nil)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package
'(consult-gh :type git :host github :repo "armindarvish/consult-gh" :branch "main"))
(require 'consult)
(require 'consult-gh)
(setq consult-gh-show-preview t)
(setq consult-gh-preview-key "M-o")
Then:
- C-u M-x consult-gh-search-issues
- Search Repos: #consult-gh
- select armindarvish/consult-gh
- Search Issues: #void
- see the error pop out
Hope this helps.
@m-delfino Can you turn lexical-binding on and also add consult
and vertico
and try again? If it does not work can you report back the version of consult
as well?
Here is the init.el I used in the screenshot below and it just worked fine, so I am not sure why it does not work for you!
;;; init.el --- -*- lexical-binding: t; -*-
(setq package-enable-at-startup nil)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'vertico)
(straight-use-package 'consult)
(straight-use-package
'(consult-gh :type git :host github :repo "armindarvish/consult-gh" :branch "main"))
(require 'vertico)
(require 'consult)
(require 'consult-gh)
(vertico-mode)
(setq consult-gh-show-preview t)
(setq consult-gh-preview-key "M-o")
@armindarvish the issue is with consult-gh-search-*
and similar, used with a prefix argument, not with consult-gh-issue-list
Oh, yeah! Of course that makes sense! I merged your PR in both develop and main branch now. Thanks a lot for the contribution!