For my speech recognition mode I have emacs listen asynchronously using make-network-process
for messages sent by my python client. If I say anything that should translate to emacs taking an action the python client send an elisp snippet to execute. To prevent bad code snippets from causing emacs to go unresponsive I wrap the code in a with-timeout
as a failsafe.
The problem is if I use TRAMP to try to open say C-x C-f /sudo::/tmp/foo
, emacs completely blocks on waiting for me to enter my password. Any packets sent by the client are ignored -- emacs isn't pulling any data off the socket. This means that if I'm only using my voice with-timeout always fires, and even if I'm typing that day I need to type really quickly. This is weird because 99% of the time minibuffer prompts don't do this -- usually the rest of emacs keeps running.
Is there a way to have tramp mode not completely block? Maybe a custom command prompting for the password that sticks it in tramp's password cache so that tramp's command to ask doesn't fire?