emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: other-frame, other-window prefix keys


From: Stefan Monnier
Subject: Re: other-frame, other-window prefix keys
Date: Sat, 08 Aug 2015 16:52:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> C-x 7 <command> causes a buffer displayed by <command> to appear in
> another window in the same frame; a window is created if necessary.
>
> C-x 8 <command> causes a buffer displayed by <command> to appear in
> another frame; a frame is created if necessary.

It'd be great if you could bind them to C-x 4 and C-x 5 and arrange for
C-x 4 f (and friends) to still work as before.

That would make the advice on switch-to-buffer unnecessary, I think
since C-x 4 b and C-x 5 b would be more handy than C-x 4 C-x C-b anyway.

> Advising temp-buffer-window-show-advice addresses the issue of how
> temporary prompt buffers are displayed.

Indeed, this is a bit ugly.  Doesn't it prevent C-x 5 C-h f from
displaying the help in a separate frame?

Maybe we should arrange for the ofw-frame-window-prefix-arg to be
save&restored around calls to read-from-minibuffer.  It's not the first
time we have a need for such a thing, so adding a general list of "vars
to save&restore around recursive edits" might be a good idea.

> There is one issue (see the FIXMEs); if the command is aborted for any
> reason, the prefix (set in ofw-frame-window-prefix-arg) needs to be
> reset. I haven't looked into doing that yet.
> If post-command-hook is run even if a command is aborted, that might be
> a good place to reset this. I'll have to try it.

Yes, post-command-hook should run even if the command is aborted, IIRC.
But it's also run right after C-x 7 calls ofw-other-window-argument, so
you'd have to be careful to make it survive one post-command-hook.
It's also run for each command executed in the minibuffer (similar
problem to the one for temp-buffer-window-show-advice).

> I'd be happy to put this in GNU ELPA (in part so it is available for
> Emacs 24.3), but there was some discussion in the original thread about
> having something like this in core.

I think it's OK to put in GNU ELPA for now.  I do hope it can be moved
later into core to replace the C-x 4 and C-x 5 keymaps.

Regarding experimentation: I'm slightly worried about having
a constantly non-nil display-buffer-overriding-action.  So maybe instead
of setting ofw-frame-window-prefix-arg and then interpret this from
a globally-set display-buffer-overriding-action, we could make
ofw-other-window-argument set display-buffer-overriding-action and
dispense with ofw-frame-window-prefix-arg.

One other thing: I'd be neat if the echo-area could display the "C-x 7"
prefix if you wait a couple seconds, like it does for C-u.  I have some
experimental code around somewhere that moves some of that C-u code from
C so it could be used for C-x 7.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]