[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggested experimental test
From: |
Yuri Khan |
Subject: |
Re: Suggested experimental test |
Date: |
Fri, 26 Mar 2021 02:30:03 +0700 |
On Thu, 25 Mar 2021 at 20:20, Dmitry Gutov <dgutov@yandex.ru> wrote:
> But C-c doesn't have a dedicated keymap, so solving this seems like the
> first step. What could we do?
>
> (kbd (format "%s C-l" ctl-c-key-sequence) 'some-command)
>
> Or maybe create a bogus ctrl-c keymap and then make sure to refer to its
> binding with something like
>
> (kbd "[C-c] C-l" 'some-command)
>
> ...I'm not sure, ideas welcome.
How about this:
* Introduce a virtual key, let’s call it <mode-specific>. Let’s
specifically *not* name it <key-formerly-known-as-C-c>.
* Have all modes use that as the prefix key for mode-specific
commands, instead of C-c.
* In the default configuration, translate C-c to <mode-specific>.
Proof of concept:
$ emacs -Q
(define-key help-mode-map (kbd "<mode-specific> <mode-specific>")
#'help-follow-symbol)
(define-key help-mode-map (kbd "<mode-specific> C-b") #'help-go-back)
(define-key help-mode-map (kbd "<mode-specific> C-f") #'help-go-forward)
(define-key key-translation-map (kbd "<menu>") (kbd "<mode-specific>"))
;; C-x C-e all of the above
(define-key help-mode-map (kbd "C-c C-c") nil)
(define-key help-mode-map (kbd "C-c C-b") nil)
(define-key help-mode-map (kbd "C-c C-f") nil)
(define-key help-mode-map (kbd "C-c") nil)
;; should be unneeded after all modes convert
(global-set-key (kbd "C-c") #'copy-region-as-kill)
(global-set-key (kbd "C-v") #'cua-paste)
<f1> m C-x o
;; I’m now in a *Help* buffer listing currently enabled modes
<f1> b
;; I’m now in a *Help* buffer listing bindings
<menu> C-b
;; I’m back to modes
<menu> C-f
;; I’m back to bindings
S-<down> S-<down> S-<down> C-c
C-x o C-v
;; I have a copy of a few lines from *Help* in my *scratch*
> Something backward-compatible would be
> ideal.
Hm, I don’t know. The above is definitely not backward-compatible. It
assumes a full conversion in Emacs and full cooperation from
third-party mode authors.
- Re: Suggested experimental test, (continued)
- Re: Suggested experimental test, Yuri Khan, 2021/03/23
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/24
- Re: Suggested experimental test, Yuri Khan, 2021/03/25
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/25
- Re: Suggested experimental test, Basil L. Contovounesios, 2021/03/25
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/25
- Re: Suggested experimental test, Yuri Khan, 2021/03/25
- Re: Suggested experimental test,
Yuri Khan <=
- Re: Suggested experimental test, Stefan Monnier, 2021/03/25
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/25
- Re: Suggested experimental test, Stefan Kangas, 2021/03/26
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/26
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/26
- Re: Suggested experimental test, Stefan Monnier, 2021/03/26
- Re: Suggested experimental test, Dmitry Gutov, 2021/03/28
- Re: Suggested experimental test, Gregory Heytings, 2021/03/22
- Re: Suggested experimental test, Lars Ingebrigtsen, 2021/03/22
- Re: Suggested experimental test, Alfred M. Szmidt, 2021/03/22