[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting magic numbers 134217734 etc in a repetable keymap
From: |
Eli Zaretskii |
Subject: |
Re: Getting magic numbers 134217734 etc in a repetable keymap |
Date: |
Sat, 03 Apr 2021 10:32:11 +0300 |
> From: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
> Date: Sat, 3 Apr 2021 11:50:50 +0530
>
> I would like to create a repeatable keymap which has magic number
> 134217734 etc in it using either `define-key' or any other API.
>
> I have tried the following, and it desn't work
>
> (define-key sexp--repeat-map
> (vector
> (car
> (listify-key-sequence
> (kbd "C-M-f"))))
> 'forward-sexp)
>
> Getting numbers like 134217734 etc in to the repeatable keymap are
> important for successful setting up of repetition. That is, for
> repetition to succeed, the condition below in `repeat-post-hook' need
> to succeed.
>
> (or (memq last-command-event keys)
> (memq this-original-command '(universal-argument
> universal-argument-more
> digit-argument
> negative-argument)))
>
> ... and when I invoke C-M-f `last-command-event' comes out as 134217734.
>
> ----------------
>
> For now I have hard-coded `sexp--repeat-map' as below, and this works
> as expected. But I want a cleaner and less-hackish recipe for achieving the
> same.
Display the "magic" numbers in hex, and I think you will see the way
clearly.