Subject: Re: bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined

From: Juri Linkov <[email-masked]>
Date: Fri, 06 Dec 2013 03:15:12 +0200

> Indeed, it would fix the issue ; but from what I gather, the suggestion
> was dismissed because it makes function-key-map too big (and so does my
> suggestion).
>
> Adding "functional keymap" support as suggested in
> http://article.gmane.org/gmane.emacs.devel/153726 seems beyond my
> ability.

Neither functional keymaps nor keymaps with pattern matching
are quick to implement, at least not until the feature freeze,
so it would be better now just to add all combinations
using `todo-powerset' to completely support keypad keys
in the next release.

The current code is following, but maybe `todo-powerset' should be moved
to bindings.el or other appropriate place like cl-seq.el.

(let ((modifiers (todo-powerset '(control meta shift super hyper)))
      (keys '((kp-end . end) (kp-down . down) (kp-next . next)
	      (kp-left . left) (kp-begin . begin) (kp-right . right)
	      (kp-home . home) (kp-up . up) (kp-prior . prior)
	      (kp-insert . insert) (kp-delete . delete) (kp-enter . enter)
	      (kp-add . +) (kp-subtract . -) (kp-multiply . *) (kp-divide . /)
	      (kp-1 . ?1) (kp-2 . ?2) (kp-3 . ?3) (kp-4 . ?4) (kp-5 . ?5)
	      (kp-6 . ?6) (kp-7 . ?7) (kp-8 . ?8) (kp-9 . ?9) (kp-0 . ?0)
	      (kp-decimal . .))))
  (dolist (pair keys)
    (dolist (mod modifiers)
      (define-key function-key-map
	(vector (append mod (list (car pair))))
	(vector (append mod (list (cdr pair))))))))