hamacs
hamacs copied to clipboard
`eshell/do` doesn't seem to work?
Hi. I was checking out your talk about eshell for emacsconf 2022 and wanted to try out the do command you wrote, however it doesn't seem to work for me. I'm using eshell/do as defined in https://github.com/howardabrams/hamacs/blob/main/ha-eshell.org . After evaluating it, I try something like the following in eshell:
$ do echo _ :: file-1.txt
And Emacs gives me this error:
Debugger entered--Lisp error: (cl-assertion-failed ((> (cdar handle) 0) nil 0))
cl--assertion-failed((> (cdar handle) 0) nil (0) nil)
eshell-close-handle(((nil . 0) t) t)
eshell-close-handles(nil 'nil)
eshell-lisp-command(eshell/do ("echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))
eshell-plain-command("do" ("echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))
eshell-named-command("do" ("echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))
(unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook))
(let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook)))
(condition-case err (let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook))) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1)))
(condition-case-unless-debug err (let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook))) (error (eshell-errorn (error-message-string err)) (eshell-close-handles 1)))
(if eshell-handle-errors (condition-case-unless-debug err (let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks ... rear-nonsticky ... front-sticky ... field command-output)))) (mapc #'funcall eshell-this-command-hook))) (error (eshell-errorn (error-message-string err)) (eshell-close-handles 1))) (let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook))))
(eshell-condition-case err (let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))) (mapc #'funcall eshell-this-command-hook))) (error (eshell-errorn (error-message-string err)) (eshell-close-handles 1)))
(eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output)))))
(let ((eshell-current-handles (eshell-duplicate-handles eshell-current-handles t))) (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))))
(eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))) t)
(progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks (eshell--mark-as-output eshell--mark-yanked-as-output) rear-nonsticky (field) front-sticky (field) field command-output))))) t))
(unwind-protect (progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 (insert-in-front-hooks ... rear-nonsticky ... front-sticky ... field command-output))))) t)) (run-hooks 'eshell-post-command-hook))
(progn (run-hooks 'eshell-pre-command-hook) (unwind-protect (progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" #("foo" 0 3 ...)))) t)) (run-hooks 'eshell-post-command-hook)))
(let ((eshell-current-handles (eshell-create-handles t 'append)) eshell-current-subjob-p) (progn (run-hooks 'eshell-pre-command-hook) (unwind-protect (progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" ...))) t)) (run-hooks 'eshell-post-command-hook))))
(eshell-commands (progn (run-hooks 'eshell-pre-command-hook) (unwind-protect (progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" (list "echo" "_" "::" ...))) t)) (run-hooks 'eshell-post-command-hook))))
eval((eshell-commands (progn (run-hooks 'eshell-pre-command-hook) (unwind-protect (progn (eshell-with-copied-handles (eshell-trap-errors (eshell-named-command "do" ...)) t)) (run-hooks 'eshell-post-command-hook)))))
eshell-send-input(nil)
funcall-interactively(eshell-send-input nil)
command-execute(eshell-send-input)
I'm using Emacs 30.1.
By the way, your github profile's link to your fediverse profile seems to be broken.