As described some 12 years ago in two stackoverflow posts (which I don’t link to, because I don’t really want to promote that site)… many people continue to experience problems where tramp-mode stops working…
Messages says: Wrong type argument: “Wrong type argument”, “listp 0” tramp-error: Wrong type argument: “listp 0”
Yeah, it works with “emacs -Q”, and list some other posters, a run through debugging one’s init results in it also working.
Even more interesting, it will work with a newly started emacs with my regular init files. Then at some point fail. I have seen this with emacs versions 26,27,28,29,30. On Debian 8,9,10,11,12,13, Devuan,Ubuntu 20,22,24 (LTS).
My conclusion is that there is some symbol, probably a function, which tramp relies upon, or even maybe it provides, and some other package also uses/provides, and that at some point both elisp packages get loaded. I looked, and I looked, and I didn’t find it until today.
The clue was in the backtrace:
signal(wrong-type-argument ("listp 0"))
tramp-error((tramp-file-name "ssh" nil nil "herring.sandelman.ca" nil "/ssw/projects/trentonio" nil) wrong-type-argument "listp 0")
tramp-signal-hook-function(wrong-type-argument (listp 0))
nth(0 0)
(* (nth 0 time) 65536.0)
(+ (* (nth 0 time) 65536.0) (nth 1 time) (/ (nth 2 time) 1000000.0))
(let ((time (or time (current-time)))) (+ (* (nth 0 time) 65536.0) (nth 1 time) (/ (nth 2 time) 1000000.0)))
time-seconds(0)
...
I think last time, I spent my time looking at nth. This time, I looked at the time-seconds…. and I found one in my private elisp directory. In make-regexp.el. Why do I have this? Required by an ancient bison-mode, and autoloading on certain cases. Goes back to 2006.
I nuked that file, and restarted emacs, and it was all well.
