Hi,
I got the below error when trying to list the sessions, even after I
delete the session db and restart Emacs. I'm using `GNU Emacs 29.1
(build 1, x86_64-apple-darwin22.3.0, Carbon Version 169 AppKit 2299.4)
of 2023-08-09`. I am not sure if it happens in other versions.
```
Debugger entered--Lisp error: (wrong-type-argument listp
#s(detached-session :id 92690c93cd8bd8a19cef0c4c4b3b2678 :command
"cargo build --release" :origin shell :working-directory
"~/git/rust/cabinet/src/bin/" :initial-mode attached :directory
"/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata nil
:host ("macOS.local" . localhost) :degraded nil :text-mode
terminal-data :env nil :action (:attach
detached-shell-command-attach-session :view detached-view-dwim :run
detached-start-shell-command-session) :local nil :annotation nil :time
(:start 1692781786.436485 :end 0.0 :duration 0.0 :offset 0.0) :status
(unknown . 0) :size 0 :state active :initialized-emacsen (68720)))
car(#s(detached-session :id 92690c93cd8bd8a19cef0c4c4b3b2678
:command "cargo build --release" :origin shell :working-directory
"~/git/rust/cabinet/src/bin/" :initial-mode attached :directory
"/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata nil
:host ("macOS.local" . localhost) :degraded nil :text-mode
terminal-data :env nil :action (:attach
detached-shell-command-attach-session :view detached-view-dwim :run
detached-start-shell-command-session) :local nil :annotation nil :time
(:start 1692781786.436485 :end 0.0 :duration 0.0 :offset 0.0) :status
(unknown . 0) :size 0 :state active :initialized-emacsen (68720)))
mapcar(car (#s(detached-session :id 92690c93cd8bd8a19cef0c4c4b3b2678
:command "cargo build --release" :origin shell :working-directory
"~/git/rust/cabinet/src/bin/" :initial-mode attached :directory
"/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata nil
:host ("macOS.local" . localhost) :degraded nil :text-mode
terminal-data :env nil :action (:attach
detached-shell-command-attach-session :view detached-view-dwim :run
detached-start-shell-command-session) :local nil :annotation nil :time
(:start 1692781786.436485 :end 0.0 :duration 0.0 :offset 0.0) :status
(unknown . 0) :size 0 :state active :initialized-emacsen (68720))))
#f(compiled-function () #<bytecode -0x1565d7e764d2313d>)()
#f(compiled-function (src) #<bytecode -0xa0defc5e83181a9>)((:narrow
(97 . "Active") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e764d2313d>)))
mapc(#f(compiled-function (src) #<bytecode -0xa0defc5e83181a9>)
[(:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x12293cce427ec6a8>))
(:narrow (97 . "Active") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e764d2313d>)) (:narrow (105 . "Inactive") :hidden
t :category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565d7e76339b13d>))
(:narrow (32 . "Hidden") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x12293cac341326a8>)) (:narrow (115 . "Success") :hidden t
:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565e7afbf58713d>))
(:narrow (102 . "Failure") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e71106713d>)) (:narrow (108 . "Local Host")
:hidden t :category detached :annotate detached-session-annotation
:action (lambda (x) (detached-open-session (detached--decode-session
x))) :items #f(compiled-function () #<bytecode -0x1565d7e704da713d>)
"Local host `detached' sessions as a source for `co...") (:narrow (114
. "Remote Host") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e705fef13d>)) (:narrow (99 . "Current Host")
:hidden t :category detached :annotate detached-session-annotation
:action (lambda (x) (detached-open-session (detached--decode-session
x))) :items #f(compiled-function () #<bytecode -0xda925ccfd05549b>))])
seq-do(#f(compiled-function (src) #<bytecode -0xa0defc5e83181a9>)
[(:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x12293cce427ec6a8>))
(:narrow (97 . "Active") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e764d2313d>)) (:narrow (105 . "Inactive") :hidden
t :category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565d7e76339b13d>))
(:narrow (32 . "Hidden") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x12293cac341326a8>)) (:narrow (115 . "Success") :hidden t
:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565e7afbf58713d>))
(:narrow (102 . "Failure") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e71106713d>)) (:narrow (108 . "Local Host")
:hidden t :category detached :annotate detached-session-annotation
:action (lambda (x) (detached-open-session (detached--decode-session
x))) :items #f(compiled-function () #<bytecode -0x1565d7e704da713d>)
"Local host `detached' sessions as a source for `co...") (:narrow (114
. "Remote Host") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e705fef13d>)) (:narrow (99 . "Current Host")
:hidden t :category detached :annotate detached-session-annotation
:action (lambda (x) (detached-open-session (detached--decode-session
x))) :items #f(compiled-function () #<bytecode -0xda925ccfd05549b>))])
consult--multi-candidates([(:category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x12293cce427ec6a8>)) (:narrow (97 . "Active") :hidden t
:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565d7e764d2313d>))
(:narrow (105 . "Inactive") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e76339b13d>)) (:narrow (32 . "Hidden") :hidden t
:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x12293cac341326a8>))
(:narrow (115 . "Success") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565e7afbf58713d>)) (:narrow (102 . "Failure") :hidden t
:category detached :annotate detached-session-annotation :action
(lambda (x) (detached-open-session (detached--decode-session x)))
:items #f(compiled-function () #<bytecode -0x1565d7e71106713d>))
(:narrow (108 . "Local Host") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0x1565d7e704da713d>) "Local host `detached' sessions as a
source for `co...") (:narrow (114 . "Remote Host") :hidden t :category
detached :annotate detached-session-annotation :action (lambda (x)
(detached-open-session (detached--decode-session x))) :items
#f(compiled-function () #<bytecode -0x1565d7e705fef13d>)) (:narrow (99
. "Current Host") :hidden t :category detached :annotate
detached-session-annotation :action (lambda (x) (detached-open-session
(detached--decode-session x))) :items #f(compiled-function ()
#<bytecode -0xda925ccfd05549b>))])
consult--multi((detached-consult--source-session
detached-consult--source-active-session
detached-consult--source-inactive-session
detached-consult--source-hidden-session
detached-consult--source-success-session
detached-consult--source-failure-session
detached-consult--source-local-session
detached-consult--source-remote-session
detached-consult--source-current-session) :prompt "Select session: "
:require-match t :sort nil)
detached-consult-session()
funcall-interactively(detached-consult-session)
call-interactively(detached-consult-session nil nil)
command-execute(detached-consult-session)
```
Maximin Liebkne <ispinfx@gmail.com> writes:
> Hi,
>
> I got the below error when trying to list the sessions, even
> after I delete the session db and restart Emacs. I'm using `GNU
> Emacs 29.1 (build 1, x86_64-apple-darwin22.3.0, Carbon Version
> 169 AppKit 2299.4) of 2023-08-09`. I am not sure if it happens
> in other versions.
>
> ``` Debugger entered--Lisp error: (wrong-type-argument listp
> #s(detached-session :id 92690c93cd8bd8a19cef0c4c4b3b2678
> :command "cargo build --release" :origin shell
> :working-directory "~/git/rust/cabinet/src/bin/" :initial-mode
> attached :directory
> "/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata
> nil :host ("macOS.local" . localhost) :degraded nil :text-mode
> terminal-data :env nil :action (:attach
> detached-shell-command-attach-session :view detached-view-dwim
> :run detached-start-shell-command-session) :local nil
> :annotation nil :time (:start 1692781786.436485 :end 0.0
> :duration 0.0 :offset 0.0) :status (unknown . 0) :size 0 :state
> active :initialized-emacsen (68720)))
> car(#s(detached-session :id 92690c93cd8bd8a19cef0c4c4b3b2678
> :command "cargo build --release" :origin shell
> :working-directory "~/git/rust/cabinet/src/bin/" :initial-mode
> attached :directory
> "/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata
> nil :host ("macOS.local" . localhost) :degraded nil :text-mode
> terminal-data :env nil :action (:attach
> detached-shell-command-attach-session :view detached-view-dwim
> :run detached-start-shell-command-session) :local nil
> :annotation nil :time (:start 1692781786.436485 :end 0.0
> :duration 0.0 :offset 0.0) :status (unknown . 0) :size 0 :state
> active :initialized-emacsen (68720)))
> mapcar(car (#s(detached-session :id
> 92690c93cd8bd8a19cef0c4c4b3b2678
> :command "cargo build --release" :origin shell
> :working-directory "~/git/rust/cabinet/src/bin/" :initial-mode
> attached :directory
> "/Users/User/.emacs.d/savefile/var/detached/sess..." :metadata
> nil :host ("macOS.local" . localhost) :degraded nil :text-mode
> terminal-data :env nil :action (:attach
> detached-shell-command-attach-session :view detached-view-dwim
> :run detached-start-shell-command-session) :local nil
> :annotation nil :time (:start 1692781786.436485 :end 0.0
> :duration 0.0 :offset 0.0) :status (unknown . 0) :size 0 :state
> active :initialized-emacsen (68720))))
> #f(compiled-function () #<bytecode -0x1565d7e764d2313d>)()
> #f(compiled-function (src) #<bytecode
> -0xa0defc5e83181a9>)((:narrow
> (97 . "Active") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e764d2313d>)))
> mapc(#f(compiled-function (src) #<bytecode
> -0xa0defc5e83181a9>)
> [(:category detached :annotate detached-session-annotation
> :action (lambda (x) (detached-open-session
> (detached--decode-session x))) :items #f(compiled-function ()
> #<bytecode -0x12293cce427ec6a8>)) (:narrow (97 . "Active")
> :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e764d2313d>))
> (:narrow (105 . "Inactive") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e76339b13d>))
> (:narrow (32 . "Hidden") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x12293cac341326a8>))
> (:narrow (115 . "Success") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565e7afbf58713d>))
> (:narrow (102 . "Failure") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e71106713d>))
> (:narrow (108 . "Local Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e704da713d>) "Local
> host `detached' sessions as a source for `co...") (:narrow (114
> . "Remote Host") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e705fef13d>))
> (:narrow (99 . "Current Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0xda925ccfd05549b>))])
> seq-do(#f(compiled-function (src) #<bytecode
> -0xa0defc5e83181a9>)
> [(:category detached :annotate detached-session-annotation
> :action (lambda (x) (detached-open-session
> (detached--decode-session x))) :items #f(compiled-function ()
> #<bytecode -0x12293cce427ec6a8>)) (:narrow (97 . "Active")
> :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e764d2313d>))
> (:narrow (105 . "Inactive") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e76339b13d>))
> (:narrow (32 . "Hidden") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x12293cac341326a8>))
> (:narrow (115 . "Success") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565e7afbf58713d>))
> (:narrow (102 . "Failure") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e71106713d>))
> (:narrow (108 . "Local Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e704da713d>) "Local
> host `detached' sessions as a source for `co...") (:narrow (114
> . "Remote Host") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e705fef13d>))
> (:narrow (99 . "Current Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0xda925ccfd05549b>))])
> consult--multi-candidates([(:category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x12293cce427ec6a8>))
> (:narrow (97 . "Active") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e764d2313d>))
> (:narrow (105 . "Inactive") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e76339b13d>))
> (:narrow (32 . "Hidden") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x12293cac341326a8>))
> (:narrow (115 . "Success") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565e7afbf58713d>))
> (:narrow (102 . "Failure") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e71106713d>))
> (:narrow (108 . "Local Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e704da713d>) "Local
> host `detached' sessions as a source for `co...") (:narrow (114
> . "Remote Host") :hidden t :category detached :annotate
> detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0x1565d7e705fef13d>))
> (:narrow (99 . "Current Host") :hidden t :category detached
> :annotate detached-session-annotation :action (lambda (x)
> (detached-open-session (detached--decode-session x))) :items
> #f(compiled-function () #<bytecode -0xda925ccfd05549b>))])
> consult--multi((detached-consult--source-session
> detached-consult--source-active-session
> detached-consult--source-inactive-session
> detached-consult--source-hidden-session
> detached-consult--source-success-session
> detached-consult--source-failure-session
> detached-consult--source-local-session
> detached-consult--source-remote-session
> detached-consult--source-current-session) :prompt "Select
> session: " :require-match t :sort nil)
> detached-consult-session()
> funcall-interactively(detached-consult-session)
> call-interactively(detached-consult-session nil nil)
> command-execute(detached-consult-session)
> ```
Hi, I think the problem is that some of
detached-consult--source-*-session variables are not working
correctly, as the thread-last parts result in things incompatible
with :annotate and :action. Something like the following fix one
of them, others are similar:
(consult-customize
detached-consult--source-inactive-session
:items
(lambda ()
(mapcar #'car
(seq-filter (lambda (s) (detached-session-inactive-p (cdr s)))
(detached-session-candidates (detached-get-sessions))))))