Got it! Good news is it works perfectly to have the minibuffer active in one window and type in another*. Bad news is it requires recompiling emacs
, as it's the C-implementation of read_minibuf which forces single-kboard. It's probably possible to reimplement the minibuffer largely in elisp, intercepting most calls to it, but that would be somewhat complex...
Anyway, with emacs-26, the line to comment is src/minibuf.c:480
,
temporarily_switch_to_single_kboard (XFRAME (mini_frame));
*I've tested it some, no promises it won't break things in subtle ways. Also note that the minibuffer uses a single, global input state, so opening the mini buffer closes any mini buffers opened in other frames. If you enable recursive-minibuffers, you do get your partial command back when the other person is done, but there's still likely to be some odd behaviour. Also, things like find-file
use switch_to_single_kboard
too.
I'll probably follow up on the mailing list to see if this can get turned into a proper customizable variable, possibly disabling all switch_to_single_kboard
calls, as it's a must for sharing an emacs instance on a joint project.
If you want to disable single-keyboard mode everywhere, insert return;
on a new line at src/keyboard.c:883
.
As requested, a diff...
*** src/minibuf.c 2020-02-20 17:27:13.472345220 -0800
--- src.orig/minibuf.c 2020-02-20 17:26:20.164343599 -0800
***************
*** 478,482 ****
Fraise_frame (mini_frame);
< //temporarily_switch_to_single_kboard (XFRAME (mini_frame));
/* We have to do this after saving the window configuration
--- 478,482 ----
Fraise_frame (mini_frame);
> temporarily_switch_to_single_kboard (XFRAME (mini_frame));
/* We have to do this after saving the window configuration
And the other diff
*** src/keyboard.c 2020-02-20 17:27:01.452344855 -0800
--- src.orig/keyboard.c 2020-02-20 17:26:15.040343443 -0800
***************
*** 881,885 ****
temporarily_switch_to_single_kboard (struct frame *f)
{
< return false;
bool was_locked = single_kboard;
--- 881,884 ----
--socket-name=emacs-$TTY
(see github.com/asmeurer/dotfiles/blob/master/bin/emacs-server-start for the exact script I use). Since I only use a handful of terminal tabs and never close them, this works well for me.