Closed bsag closed 3 years ago
Thanks for the report!
Your configuration looks fine, I tried it here and it works without problems. Can you tell me your Emacs version, and also do the following:
M-x toggle-debug-on-error RET
C-c c
You might want to also try the following as a hot patch. Paste it into Emacs, place the cursor after the last paretheses, and type C-x C-e
:
(defun run-command--run (command-spec)
"Run `COMMAND-SPEC'. Back end for helm and ivy actions."
(let* ((buffer-base-name (format "%s[%s]"
(plist-get command-spec :command-name)
(plist-get command-spec :scope-name)))
(default-directory (plist-get command-spec :working-dir)))
(with-current-buffer
(cond
((run-command--experiment-p 'vterm-run-method)
(run-command--run-vterm (plist-get command-spec :command-line) buffer-base-name))
((eq run-command-run-method 'compile)
(run-command--run-compile (plist-get command-spec :command-line) buffer-base-name))
((eq run-command-run-method 'term)
(run-command--run-term (plist-get command-spec :command-line) buffer-base-name)))
(setq-local run-command-command-spec command-spec))))
Hey, just dropping in to say that I also noticed the same thing in Doom Emacs, and was able to get it working by disabling byte-compilation in packages.el
:
(package! run-command
;; Leaving out "compile" and "native-compile" in the build steps will skip byte compilation
:recipe (:build (autoloads info)))
It works fine in vanilla / non-Doom emacs though, and I'm not sure exactly why the combination of Doom + byte-compilation produces that error.
@ktfleming were you also getting "Symbol's value as variable is void: command-name"? There is only one place in the code that uses command-name
as variable, inside a cl-destructuring-bind
. The patch above removes cl-seatructuring-bind
in favor of plain plist-get
calls, so it might fix it.
I just pushed a change which removes cl-restructuring-bind
, hopefully it fixes this.
(If you can paste a backtrace here before upgrading, much appreciated, it might clue me in to why it wasn't working it the first place.)
@bard Thanks for the quick response!
Here's the backtrace:
Debugger entered--Lisp error: (void-variable command-name)
run-command--run((:command-name "say-hello" :command-line "echo Hello, World!" :display "say-hello" :working-dir "/Users/bsag/dotfiles/emacs/.doom.d/" :scope-name "~/dotfiles/emacs/.doom.d/"))
run-command--completing-read()
run-command()
funcall-interactively(run-command)
call-interactively(run-command nil nil)
command-execute(run-command)
I then tried your hot patch which worked. I didn't yet try the change to byte-compilation suggested by @ktfleming, so your patch seems to work without that. I'll try updating now - thanks so much for the quick fix!
I've updated and can confirm it works perfectly. I'll close the issue now. Thanks again for such a useful package!
Late reply, but yeah I was seeing the same error message as @bsag, and can also confirm that the new version works without the byte-compile workaround. Thanks!
This is an exciting project, and one I know I will find useful for a number of different projects, so thanks for writing it!
I'm trying to set this up in Doom Emacs (with Selectrum), but I'm getting an error when trying out the simple example recipes.
When I try to run a command with the config below, both commands are displayed correctly in the minibuffer, but when I select either, I get the error 'Symbol's value as variable is void: command-name'. I do have
sloccount
installed and it works fine run manually, but theecho
command example doesn't work either.I suspect that the way I have added the examples to the
run-command-recipes
variable is wrong, but I'm a bit of a newbie with elisp and suspect that I somehow haven't quoted it properly (quoting still baffles me!).Here's my configuration:
Any help you can give me would be much appreciated!