Recipe starting from 'emacs -Q', on Windows assuming a PuTTy session called "session" is configured:
C-x C-f /plink:session:/tmp RET M-x grep-find RET x RET Backtrace: Lisp error: (wrong-type-argument "stringp nil") signal(wrong-type-argument ("stringp nil")) tramp-error((tramp-file-name "plink" nil nil "session" nil "/tmp/" nil) wrong-type-argument "stringp nil") tramp-signal-hook-function(wrong-type-argument (stringp nil)) regexp-quote(nil) tramp-sh-handle-expand-file-name("/plink:session:/tmp/" nil) apply(tramp-sh-handle-expand-file-name ("/plink:session:/tmp/" nil)) tramp-sh-file-name-handler(expand-file-name "/plink:session:/tmp/" nil) apply(tramp-sh-file-name-handler expand-file-name ("/plink:session:/tmp/" nil)) tramp-file-name-handler(expand-file-name "/plink:session:/tmp/" nil) expand-file-name("/plink:session:/tmp/") cd("/plink:session:/tmp/") compilation-start("find . -type f -exec grep --color=always -nH --nul..." grep-mode) grep("find . -type f -exec grep --color=always -nH --nul...") grep-find("find . -type f -exec grep --color=always -nH --nul...") funcall-interactively(grep-find "find . -type f -exec grep --color=always -nH --nul...") call-interactively(grep-find record nil) command-execute(grep-find record) execute-extended-command(nil "grep-find" nil) funcall-interactively(execute-extended-command nil "grep-find" nil) call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) This occurs because 'null-device' is let-bound to nil in 'grep-find', and this is not handled by the regex constructor in tramp-sh-handle-expand-file-name (only used on Windows). Evaluating the following form gives the same error: (let ((null-device nil)) (rx bol (| (: alpha ":") (: (literal null-device) eol)))) Bisected to this Emacs commit: be2e6228f8c9c57d2809bdd953d065ebfc63d4c4 is the first bad commit commit be2e6228f8c9c57d2809bdd953d065ebfc63d4c4 Author: Michael Albinus <michael.albi...@gmx.de> Date: Fri Aug 26 16:19:47 2022 +0200 Use `rx' in Tramp where possible