[Top][All Lists]

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

Re: master 859190f 2/3: Convert some keymaps to defvar-keymap

From: Lars Ingebrigtsen
Subject: Re: master 859190f 2/3: Convert some keymaps to defvar-keymap
Date: Thu, 14 Oct 2021 22:35:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Kangas <stefan@marxist.se> writes:

>> I also like the suggestion to allow
>>     [C-s C-s]
> Yes, isn't that the best one, even?  It certainly looks less noisy
> than the proposed alternatives, and it also has the nice property that
> it's just a vector so you can manipulate it in all the ways you'd
> expect.  For that reason, it also stands out just enough from a
> regular list and the surrounding code.

I assumed that it would be ambiguous with the (B) syntax, but I didn't
really look into it.  Let's do some grepping...

(define-key map [next]  'calendar-scroll-left-three-months)
(define-key map [left]  'calendar-backward-day)

These are fine...

(define-key map [remap undo] 'calc-undo)
(define-key map [vertical-scroll-bar mouse-1]

That's OK.

(define-key map [tab] 'todo-next-button)

Hm, the kbd syntax would be

(define-key map [TAB] 'todo-next-button)

but I guess it's fine...

(define-key function-key-map [C-delete] [?\M-d])

That's C-<delete> in kbd syntax -- I guess it's fine if we accept both,
but then we lose the opportunity to be stricter with the syntax.

(define-key map [M-clear] [?\M-\C-l])


(defvar vc-git-stash-menu-map
  (let ((map (make-sparse-keymap "Git Stash")))
    (define-key map [sn]
      '(menu-item "Snapshot Stash" vc-git-stash-snapshot
                  :help "Snapshot stash"))

Oh, yeah, I had totally forgotten that this is how menus are defined.
To it's ambiguous here -- the thing in [] could be anything, including
[s], which kdb would interpret as the key "s".

This form is limited to menu items, though, so perhaps it could be made
to work (i.e., if the DEF is a menu item, then we have different logic).

So I'm not sure.  It's not 100% straightforward, but it could work.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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