[Top][All Lists]

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

Re: Add -other-{window, frame} variants of project-prefix-map commands

From: Stefan Monnier
Subject: Re: Add -other-{window, frame} variants of project-prefix-map commands
Date: Wed, 08 Jul 2020 00:06:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> It seems the biggest challenge that needs to be solved before making
> any changes in core Emacs is how to keep backward-compatibility with
> keybindings added by users to the existing keymap ctl-x-4-map.

`other-frame-window` doesn't make any effort to handle that, indeed.
It provides `ofw-transient-map` instead.

I believe we could live with this kind of backward incompatibility.

> Then maybe a new command bound to `C-x 4` could just introspect
> ctl-x-4-map and run its commands as is.

We could try and manually combine ctl-x-5-map and ctl-x-4-map into
`ofw-transient-map` in `ofw--set-prefix`, but I'm not sure it's worth
the hassle.

Note also that the tension between parsing `C-x 4 FOO` as "lookup FOO in
`ctl-x-4-map` (or in `ofw-transient-map`)" and "lookup FOO in the normal
way", which is why in `ofw--set-prefix` we do:

  ;; FIXME: Setup a transient map to reproduce the behavior of the `C-x 4/5'
  ;; prefix keys, but only do it in "regular" buffers.  In special buffers,
  ;; these extra bindings may be more annoying than anything, e.g. in Gnus's
  ;; summary buffer `a' open a new message buffer, so we'd want `C-x
  ;; 5 a' to open it in a new frame, but instead of calling
  ;; add-change-log-entry.
  (when (eq (key-binding [?a]) 'self-insert-command) ;Heuristic!
    (set-transient-map ofw-transient-map)))

-- Stefan

reply via email to

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