emacs-devel
[Top][All Lists]
Advanced

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

Re: PROPOSAL: Repurpose one key and reserve it for third-party packages


From: Yuri Khan
Subject: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages
Date: Tue, 9 Feb 2021 14:42:49 +0700

On Tue, 9 Feb 2021 at 07:37, Gregory Heytings <gregory@heytings.org> wrote:

> For example you can move all C-x
> bindings to F7 with (progn (define-key global-map (kbd "<f7>") ctl-x-map)
> (define-key global-map (kbd "C-x") nil)).

Does it work that easily though? I might like to do that to C-x and
C-c so that I could bind those to Cut and Copy[^1]. But no:

    $ emacs -Q
    (define-key global-map (kbd "<f7>") ctl-x-map) ;; C-x C-e
    (define-key global-map (kbd "C-x") #'kill-region) ;; f7 C-e
    (+ 2 2) ;; C-x C-e ⇒ no effect; f7 C-e ⇒ 4

    C-r buffer RET C-S-right C-x

Expected: the word is killed.

Observed: I get a “C-x-” prompt in the minibuffer, indicating C-x is
still acting as a prefix key. Indeed, pressing C-h reveals a number of
C-x 8 … bindings in key translations, and a bunch of C-x @ … bindings
in function key map translations.

    M-x hl-lock-mode RET
    C-s define-key M-C-B C-x w .

Expected: “define-key” is killed and replaced with “w.”.
Observed: ‘highlight-symbol-at-point’ picks up “define-key” and
highlights its all occurrences.


[^1]: Yes, I know of and use cua-mode. No, it’s not satisfying.
Because with all this pandemic work-from-home, my Emacs is over there
at my office, and it’s displaying its frames on my X server here at my
home[^2], and network lag interferes with the timeout-based heuristic
that causes cua-mode to cut where I intended to do a prefix C-x, or
vice versa, to switch buffers when I intended to cut and then move
point left or right.

[^2]: Yes, I know about Tramp, but have not made it part of my
workflow, partially because I’m unsure if eglot will work over tramp.



reply via email to

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