[Top][All Lists]

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

Re: "modern" colors Re: Changes for emacs 28

From: Göktuğ Kayaalp
Subject: Re: "modern" colors Re: Changes for emacs 28
Date: Sun, 13 Sep 2020 11:53:46 +0300
User-agent: mu4e 1.2.0; emacs 28.0.50

On 2020-09-13 07:06 +03, Richard Stallman <rms@gnu.org> wrote:
> I think the hardest part will be to modify the various mode-specific
> C-Mouse-3 (Mouse-3 in this mode) menus to conditionally include basic
> editing commands.

IMHO this is not really necessary.  A simpler approach would be to
simply have a mode which has the plain right click (mouse-3) show a
simple menu.  This is what VS Code has, which looks fit for us too:

Go to definition => xref-find-definitions
Command palette => execute-extended-command

We could extend this with undo/redo + maybe ‘insert-char’, which are
present in some other applications.  The following is a demonstrative
example that’s IMHO fairly ‘Emacsy’ but I couldn’t get the attached
commands to run (FWIW the relevant docs are pretty sparse for this):

 (kbd "<mouse-3>")
 (lambda (event)
   (interactive "e")
    (let ((map (make-sparse-keymap)))
      (define-key map [xref] '("Go to definition" . #'xref-find-definitions))
        map [sep1] '("--" . nil) 'xref)
        map [cut] '("Cut" . #'kill-region) 'sep1)
        map [copy] '("Copy" . #'kill-ring-save) 'cut)
        map [paste] '("Paste" . #'yank) 'copy)
        map [sep2] '("--" . nil) 'paste)
        map [undo] '("Undo" . #'undo) 'sep2)
        map [redo] '("Paste" . #'undo-redo) 'undo)
        map [sep3] '("--" . nil) 'redo)
        map [special] '("Insert special character" . #'insert-char) 'sep3)
        map [command] '("Execute command" . #'execute-extended-command) 
        map [sexp] '("Execute lisp expression" . #'eval-expression) 'command)

İ. Göktuğ Kayaalp / @cadadr / <https://www.gkayaalp.com/>
pgp:   024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427

reply via email to

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