I'm sending some commands to my emacs using emacsclient --eval on a timer. The only problem with this is if at the time I happen to be using emacs and press C-g to cancel something, instead of canceling what I intended to cancel it will cancel the commands that emacsclient is sending, printing the message "Quit emacsclient request." I actually want to let the emacsclient code finish, and then have C-g cancel whatever I originally intended to cancel.
I thought I could wrap the commands I'm sending in (let ((inhibit-quit t)) ...)
. But it turns out if you look at the source for server-execute and server-eval-and-print that they override inhibit-quit, on the reasoning that emacsclient actions are usually instigated by the user and that must be what they want to have quit.
Ideally, I'd have two hotkeys, C-g for quitting my normal interactive stuff, and something else, say C-S-g for quitting emacsclient stuff (in case I accidentally send an infinite loop).
I know I could copy pasta the server-execute function and rip out the quit handling bit, but then I'd be left at the mercy of infinite loops when they do come up. Ideas?