unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
@ 2013-05-14 10:42 Nicolas Richard
  2013-12-04 10:59 ` Nicolas Richard
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2013-05-14 10:42 UTC (permalink / raw)
  To: 14397

From emacs -Q, if I press control and the key 1 on the keypad, I see
"<C-kp-1> is undefined" in the echo area. I expected that to start an
digit-argument, just as hitting C-1 does.

Same thing is true with Meta instead of Control.

Why I use the keypad : on my belgian/french azerty keyboards, I need to
hold shift in order to produce numbers from the second line of the
keyboard ; I usually prefer to move my hand to the keypad.

The following snippet helped me solve this problem :
(dotimes (i 10)				; for all keys
  (dolist (prefix (list "M" "C"))	; for both modifiers
    (global-set-key
     (read (format "[%s-kp-%s]" prefix i))
     'digit-argument)
    (put 
     (read (format "%s-kp-%s" prefix i))
     'ascii-character
     (+ ?0 i))))

(Binding [C-kp-1] to 'digit-argument isn't enough and produces an error.
The property ascii-character is looked up by digit-argument.)

Unfortunately the above code won't make M-kp-1 work in my terminal
session, but I guess that's not an emacs problem.

In GNU Emacs 24.3.1 (i686-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2013-04-16 on LDLC-portable
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.2 LTS

Configured using:
 `configure '--with-x-toolkit=lucid''

Important settings:
  value of $LANG: fr_BE.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Org

Minor modes in effect:
  diff-auto-refine-mode: t
  org-indent-mode: t
  TeX-PDF-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  recentf-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: org-auto-fill-function
  visual-line-mode: t
  transient-mark-mode: t

Recent input:
M-f M-f M-f M-f M-f C-b C-SPC C-b \ D C-d SPC C-f C-f 
C-f C-d \ D SPC C-x C-s C-M-s d C-n C-n C-s C-s C-s 
C-n C-p C-p M-< C-s d x C-s C-s C-s C-n C-p C-p C-p 
C-a C-n M-< M-% : = <return> \ c o l o n e q q <return> 
y , y y $ $ C-g C-g C-/ C-/ C-/ SPC M-< M-% <return> 
y y e SPC <kp-4> <backspace> <return> , y y , y y y 
y y y y y y y y y C-n C-n C-x C-s C-s I n SPC b o t 
h C-s C-n C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-M-SPC C-x 
C-x C-f C-c C-e <return> <backspace> C-M-b M-D <return> 
C-n M-^ C-c C-q C-e C-x C-s C-n C-n C-h P s m a <tab> 
<tab> p <tab> <tab> <return> C-x o q C-n C-p C-l C-x 
C-s C-n C-p C-n C-n C-p C-n C-n C-n C-n C-n C-n <down> 
<up> C-a C-k C-d C-x C-s C-p C-p C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p 
C-x C-s C-n C-n C-n C-p C-p C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-c a a <down> <down> <down> <down> <down> 
<down> <down> <down> <up> <down> <down> <down> <up> 
<up> <up> <tab> C-x C-l C o m m i <return> <down> <down> 
<tab> <down> <down> <up> <tab> C-c C-a f E <down> <up> 
<up> <down> g C-c C-g C-g M-< w g <down> <down> <down> 
<down> E q C-x b C-g C-u C-x C-z C-g M-x r e p o r 
t SPC e m <tab> <tab> <return>

Recent messages:
Mark set
/home/youngfrog/mesnotes/ulb/CE/data/e8/b3baed-f908-4615-a1a6-d48263143944/
Cleaning up the recentf list...done (0 removed)
Invalid face reference: nil [4 times]
Cleaning up the recentf list...done (0 removed)
Invalid face reference: nil [24 times]
QuitInvalid face reference: nil
Invalid face reference: nil [3 times]
QuitInvalid face reference: nil
Invalid face reference: nil [11 times]

Load-path shadows:
/mnt/gentoo-home/youngfrog/sourcetrees/sage-mode-from-hg/emacs/.dir-locals hides ~/sourcetrees/magit/.dir-locals
~/sourcetrees/org-mode/lisp/ob-matlab hides /usr/local/share/emacs/24.3/lisp/org/ob-matlab
~/sourcetrees/org-mode/lisp/ob-sh hides /usr/local/share/emacs/24.3/lisp/org/ob-sh
~/sourcetrees/org-mode/lisp/org-archive hides /usr/local/share/emacs/24.3/lisp/org/org-archive
~/sourcetrees/org-mode/lisp/ob-dot hides /usr/local/share/emacs/24.3/lisp/org/ob-dot
~/sourcetrees/org-mode/lisp/org-version hides /usr/local/share/emacs/24.3/lisp/org/org-version
~/sourcetrees/org-mode/lisp/org-capture hides /usr/local/share/emacs/24.3/lisp/org/org-capture
~/sourcetrees/org-mode/lisp/ob-ruby hides /usr/local/share/emacs/24.3/lisp/org/ob-ruby
~/sourcetrees/org-mode/lisp/org-ctags hides /usr/local/share/emacs/24.3/lisp/org/org-ctags
~/sourcetrees/org-mode/lisp/org-footnote hides /usr/local/share/emacs/24.3/lisp/org/org-footnote
~/sourcetrees/org-mode/lisp/org-crypt hides /usr/local/share/emacs/24.3/lisp/org/org-crypt
~/sourcetrees/org-mode/lisp/ob-awk hides /usr/local/share/emacs/24.3/lisp/org/ob-awk
~/sourcetrees/org-mode/contrib/lisp/org-vm hides /usr/local/share/emacs/24.3/lisp/org/org-vm
~/sourcetrees/org-mode/lisp/ob-calc hides /usr/local/share/emacs/24.3/lisp/org/ob-calc
~/sourcetrees/org-mode/lisp/ob-picolisp hides /usr/local/share/emacs/24.3/lisp/org/ob-picolisp
~/sourcetrees/org-mode/lisp/ob-sass hides /usr/local/share/emacs/24.3/lisp/org/ob-sass
~/sourcetrees/org-mode/lisp/ob-ref hides /usr/local/share/emacs/24.3/lisp/org/ob-ref
~/sourcetrees/org-mode/lisp/ob-lilypond hides /usr/local/share/emacs/24.3/lisp/org/ob-lilypond
~/sourcetrees/org-mode/lisp/org-docview hides /usr/local/share/emacs/24.3/lisp/org/org-docview
~/sourcetrees/org-mode/lisp/org-rmail hides /usr/local/share/emacs/24.3/lisp/org/org-rmail
~/sourcetrees/org-mode/lisp/ob-keys hides /usr/local/share/emacs/24.3/lisp/org/ob-keys
~/sourcetrees/org-mode/lisp/ob-shen hides /usr/local/share/emacs/24.3/lisp/org/ob-shen
~/sourcetrees/org-mode/lisp/ob-octave hides /usr/local/share/emacs/24.3/lisp/org/ob-octave
~/sourcetrees/org-mode/lisp/org-info hides /usr/local/share/emacs/24.3/lisp/org/org-info
~/sourcetrees/org-mode/lisp/org-feed hides /usr/local/share/emacs/24.3/lisp/org/org-feed
~/sourcetrees/org-mode/lisp/ob-C hides /usr/local/share/emacs/24.3/lisp/org/ob-C
~/sourcetrees/org-mode/lisp/org-eshell hides /usr/local/share/emacs/24.3/lisp/org/org-eshell
~/sourcetrees/org-mode/lisp/org-list hides /usr/local/share/emacs/24.3/lisp/org/org-list
~/sourcetrees/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.3/lisp/org/org-protocol
~/sourcetrees/org-mode/lisp/ob-emacs-lisp hides /usr/local/share/emacs/24.3/lisp/org/ob-emacs-lisp
~/sourcetrees/org-mode/lisp/org-compat hides /usr/local/share/emacs/24.3/lisp/org/org-compat
~/sourcetrees/org-mode/lisp/ob-lisp hides /usr/local/share/emacs/24.3/lisp/org/ob-lisp
~/sourcetrees/org-mode/lisp/org-macs hides /usr/local/share/emacs/24.3/lisp/org/org-macs
~/sourcetrees/org-mode/lisp/ob-ditaa hides /usr/local/share/emacs/24.3/lisp/org/ob-ditaa
~/sourcetrees/org-mode/lisp/ob-mscgen hides /usr/local/share/emacs/24.3/lisp/org/ob-mscgen
~/sourcetrees/org-mode/lisp/ob hides /usr/local/share/emacs/24.3/lisp/org/ob
~/sourcetrees/org-mode/lisp/org-indent hides /usr/local/share/emacs/24.3/lisp/org/org-indent
~/sourcetrees/org-mode/lisp/ob-gnuplot hides /usr/local/share/emacs/24.3/lisp/org/ob-gnuplot
~/sourcetrees/org-mode/lisp/ob-maxima hides /usr/local/share/emacs/24.3/lisp/org/ob-maxima
~/sourcetrees/org-mode/lisp/ob-scheme hides /usr/local/share/emacs/24.3/lisp/org/ob-scheme
~/sourcetrees/org-mode/contrib/lisp/org-wl hides /usr/local/share/emacs/24.3/lisp/org/org-wl
~/sourcetrees/org-mode/lisp/ob-table hides /usr/local/share/emacs/24.3/lisp/org/ob-table
~/sourcetrees/org-mode/lisp/org-inlinetask hides /usr/local/share/emacs/24.3/lisp/org/org-inlinetask
~/sourcetrees/org-mode/lisp/org-id hides /usr/local/share/emacs/24.3/lisp/org/org-id
~/sourcetrees/org-mode/contrib/lisp/org-mac-message hides /usr/local/share/emacs/24.3/lisp/org/org-mac-message
~/sourcetrees/org-mode/lisp/ob-java hides /usr/local/share/emacs/24.3/lisp/org/ob-java
~/sourcetrees/org-mode/lisp/org-clock hides /usr/local/share/emacs/24.3/lisp/org/org-clock
~/sourcetrees/org-mode/lisp/ob-screen hides /usr/local/share/emacs/24.3/lisp/org/ob-screen
~/sourcetrees/org-mode/lisp/org-faces hides /usr/local/share/emacs/24.3/lisp/org/org-faces
~/sourcetrees/org-mode/lisp/ob-sql hides /usr/local/share/emacs/24.3/lisp/org/ob-sql
~/sourcetrees/org-mode/lisp/org-mhe hides /usr/local/share/emacs/24.3/lisp/org/org-mhe
~/sourcetrees/org-mode/lisp/ob-tangle hides /usr/local/share/emacs/24.3/lisp/org/ob-tangle
~/sourcetrees/org-mode/lisp/org-irc hides /usr/local/share/emacs/24.3/lisp/org/org-irc
~/sourcetrees/org-mode/lisp/ob-ocaml hides /usr/local/share/emacs/24.3/lisp/org/ob-ocaml
~/sourcetrees/org-mode/lisp/org-loaddefs hides /usr/local/share/emacs/24.3/lisp/org/org-loaddefs
~/sourcetrees/org-mode/lisp/org-colview hides /usr/local/share/emacs/24.3/lisp/org/org-colview
~/sourcetrees/org-mode/lisp/org-w3m hides /usr/local/share/emacs/24.3/lisp/org/org-w3m
~/sourcetrees/org-mode/lisp/org-plot hides /usr/local/share/emacs/24.3/lisp/org/org-plot
~/sourcetrees/org-mode/lisp/ob-R hides /usr/local/share/emacs/24.3/lisp/org/ob-R
~/sourcetrees/org-mode/lisp/org-install hides /usr/local/share/emacs/24.3/lisp/org/org-install
~/sourcetrees/org-mode/lisp/org-attach hides /usr/local/share/emacs/24.3/lisp/org/org-attach
~/sourcetrees/org-mode/lisp/org-mobile hides /usr/local/share/emacs/24.3/lisp/org/org-mobile
~/sourcetrees/org-mode/lisp/org-datetree hides /usr/local/share/emacs/24.3/lisp/org/org-datetree
~/sourcetrees/org-mode/lisp/org-mouse hides /usr/local/share/emacs/24.3/lisp/org/org-mouse
~/sourcetrees/org-mode/lisp/ob-org hides /usr/local/share/emacs/24.3/lisp/org/ob-org
~/sourcetrees/org-mode/lisp/org-bibtex hides /usr/local/share/emacs/24.3/lisp/org/org-bibtex
~/sourcetrees/org-mode/lisp/org-gnus hides /usr/local/share/emacs/24.3/lisp/org/org-gnus
~/sourcetrees/org-mode/lisp/ob-plantuml hides /usr/local/share/emacs/24.3/lisp/org/ob-plantuml
~/sourcetrees/org-mode/lisp/ob-css hides /usr/local/share/emacs/24.3/lisp/org/ob-css
~/sourcetrees/org-mode/contrib/lisp/org-mew hides /usr/local/share/emacs/24.3/lisp/org/org-mew
~/sourcetrees/org-mode/lisp/ob-perl hides /usr/local/share/emacs/24.3/lisp/org/ob-perl
~/sourcetrees/org-mode/lisp/ob-comint hides /usr/local/share/emacs/24.3/lisp/org/ob-comint
~/sourcetrees/org-mode/lisp/ob-python hides /usr/local/share/emacs/24.3/lisp/org/ob-python
~/sourcetrees/org-mode/lisp/ob-asymptote hides /usr/local/share/emacs/24.3/lisp/org/ob-asymptote
~/sourcetrees/org-mode/lisp/ob-io hides /usr/local/share/emacs/24.3/lisp/org/ob-io
~/sourcetrees/org-mode/lisp/ob-scala hides /usr/local/share/emacs/24.3/lisp/org/ob-scala
~/sourcetrees/org-mode/lisp/ob-fortran hides /usr/local/share/emacs/24.3/lisp/org/ob-fortran
~/sourcetrees/org-mode/lisp/org-src hides /usr/local/share/emacs/24.3/lisp/org/org-src
~/sourcetrees/org-mode/lisp/org-table hides /usr/local/share/emacs/24.3/lisp/org/org-table
~/sourcetrees/org-mode/lisp/org-agenda hides /usr/local/share/emacs/24.3/lisp/org/org-agenda
~/sourcetrees/org-mode/lisp/org hides /usr/local/share/emacs/24.3/lisp/org/org
~/sourcetrees/org-mode/lisp/org-pcomplete hides /usr/local/share/emacs/24.3/lisp/org/org-pcomplete
~/sourcetrees/org-mode/lisp/org-bbdb hides /usr/local/share/emacs/24.3/lisp/org/org-bbdb
~/sourcetrees/org-mode/lisp/ob-clojure hides /usr/local/share/emacs/24.3/lisp/org/ob-clojure
~/sourcetrees/org-mode/lisp/ob-eval hides /usr/local/share/emacs/24.3/lisp/org/ob-eval
~/sourcetrees/org-mode/lisp/ob-js hides /usr/local/share/emacs/24.3/lisp/org/ob-js
~/sourcetrees/org-mode/lisp/org-timer hides /usr/local/share/emacs/24.3/lisp/org/org-timer
~/sourcetrees/org-mode/lisp/org-element hides /usr/local/share/emacs/24.3/lisp/org/org-element
~/sourcetrees/org-mode/lisp/ob-ledger hides /usr/local/share/emacs/24.3/lisp/org/ob-ledger
~/sourcetrees/org-mode/lisp/ob-haskell hides /usr/local/share/emacs/24.3/lisp/org/ob-haskell
~/sourcetrees/org-mode/lisp/ob-latex hides /usr/local/share/emacs/24.3/lisp/org/ob-latex
~/sourcetrees/org-mode/lisp/ob-sqlite hides /usr/local/share/emacs/24.3/lisp/org/ob-sqlite
~/sourcetrees/org-mode/lisp/ob-lob hides /usr/local/share/emacs/24.3/lisp/org/ob-lob
~/sourcetrees/org-mode/lisp/ob-exp hides /usr/local/share/emacs/24.3/lisp/org/ob-exp
~/sourcetrees/org-mode/lisp/org-habit hides /usr/local/share/emacs/24.3/lisp/org/org-habit
~/sourcetrees/org-mode/lisp/org-entities hides /usr/local/share/emacs/24.3/lisp/org/org-entities
/mnt/gentoo-home/youngfrog/sourcetrees/sage-mode-from-hg/emacs/.dir-locals hides /usr/local/share/emacs/24.3/lisp/gnus/.dir-locals

Features:
(shadow sort mail-extr emacsbug sendmail org-attach org-id diary-lib
diary-loaddefs cal-iso network-stream starttls url-http tls url-gw
url-cache url-auth url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util lisp-mnt finder-inf texmathp
diff magit-bisect magit-key-mode magit diff-mode log-edit pcvs-util
add-log bookmark quail pp edebug debug org-datetree image-file
org-element tabify dabbrev telnet browse-url sgml-mode view woman man
org-table org-indent disp-table org-rmail org-mhe org-irc org-info
org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m misearch
multi-isearch vc-git reftex-dcr reftex-auc reftex reftex-vars preview
prv-emacs font-latex latex tex-style sage-auctex org-latex
org-export-latex org-beamer org-exp org-exp-blocks footnote tex-buf tex
dbus xml crm paredit multiple-cursors mc-separate-operations
rectangular-region-mode mc-mark-more thingatpt mc-cycle-cursors
mc-edit-lines multiple-cursors-core rect adaptive-wrap-autoloads
bbdb-autoloads multiple-cursors-autoloads paredit-autoloads
workgroups-autoloads ob-sage ob-maxima .loaddefs el-get help-mode
autoload package sage rx sage-load preview-latex tex-site auto-loads
pcase ob-sh shell windmove latexenc paren doc-view jka-compr image-mode
ido uniquify recentf tree-widget org-contacts org-capture org-agenda
gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig mailcap
find-lisp dired org-inlinetask org warnings derived org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle org-src
easy-mmode ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
find-func cal-menu calendar cal-loaddefs gnus-sum nnoo gnus-group
gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range
message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win gnus gnus-ems nnheader mail-utils wid-edit cl-macs
gv advice help-fns advice-preload time ffap url-parse auth-source eieio
byte-opt bytecomp byte-compile cconv gnus-util time-date mm-util
mail-prsvr password-cache url-vars edmacro kmacro cl cl-lib
two-mode-mode info easymenu 50magit server tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dynamic-setting system-font-setting
font-render-setting x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-05-14 10:42 bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined Nicolas Richard
@ 2013-12-04 10:59 ` Nicolas Richard
  2013-12-05  1:28   ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2013-12-04 10:59 UTC (permalink / raw)
  To: 14397

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>>From emacs -Q, if I press control and the key 1 on the keypad, I see
> "<C-kp-1> is undefined" in the echo area. I expected that to start an
> digit-argument, just as hitting C-1 does.
>
> Same thing is true with Meta instead of Control.
>
> Why I use the keypad : on my belgian/french azerty keyboards, I need to
> hold shift in order to produce numbers from the second line of the
> keyboard ; I usually prefer to move my hand to the keypad.

Here's a cleaner snippet to achieve the same behaviour, now using
function-key-map :

(dotimes (i 10)
  (dolist (prefix (list "M" "C"))
    (define-key function-key-map
      (kbd (format "<%s-kp-%s>" prefix i))
      (kbd (format "%s-%d" prefix i)))))

Below is a patch to achieve this from simple.el.

diff --git a/lisp/simple.el b/lisp/simple.el
index 260c170..4cded6e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7130,6 +7130,10 @@ PREFIX is the string that represents this modifier in an event type symbol."
      (define-key function-key-map (vector keypad) (vector normal))))
  '((kp-0 ?0) (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)
+   (M-kp-0 ?\M-0) (M-kp-1 ?\M-1) (M-kp-2 ?\M-2) (M-kp-3 ?\M-3) (M-kp-4 ?\M-4)
+   (M-kp-5 ?\M-5) (M-kp-6 ?\M-6) (M-kp-7 ?\M-7) (M-kp-8 ?\M-8) (M-kp-9 ?\M-9)
+   (C-kp-0 ?\C-0) (C-kp-1 ?\C-1) (C-kp-2 ?\C-2) (C-kp-3 ?\C-3) (C-kp-4 ?\C-4)
+   (C-kp-5 ?\C-5) (C-kp-6 ?\C-6) (C-kp-7 ?\C-7) (C-kp-8 ?\C-8) (C-kp-9 ?\C-9)
    (kp-space ?\s)
    (kp-tab ?\t)
    (kp-enter ?\r)

-- 
Nico.






^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-04 10:59 ` Nicolas Richard
@ 2013-12-05  1:28   ` Juri Linkov
  2013-12-05  9:59     ` Nicolas Richard
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2013-12-05  1:28 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 14397

> Here's a cleaner snippet to achieve the same behaviour, now using
> function-key-map :
>
> (dotimes (i 10)
>   (dolist (prefix (list "M" "C"))
>     (define-key function-key-map
>       (kbd (format "<%s-kp-%s>" prefix i))
>       (kbd (format "%s-%d" prefix i)))))

Do you think the patch from
http://thread.gmane.org/gmane.emacs.devel/153656/focus=153681
will fix your issue?

As I recall the problem was where to define the function `powerset'
used to create all combinations of modifiers C-, M-, S-, etc.

Now that we have `todo-powerset' in lisp/calendar/todo-mode.el
we could use it in lisp/bindings.el.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-05  1:28   ` Juri Linkov
@ 2013-12-05  9:59     ` Nicolas Richard
  2013-12-06  1:15       ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2013-12-05  9:59 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 14397

Juri Linkov <juri@jurta.org> writes:

>> Here's a cleaner snippet to achieve the same behaviour, now using
>> function-key-map :
>>
>> (dotimes (i 10)
>>   (dolist (prefix (list "M" "C"))
>>     (define-key function-key-map
>>       (kbd (format "<%s-kp-%s>" prefix i))
>>       (kbd (format "%s-%d" prefix i)))))
>
> Do you think the patch from
> http://thread.gmane.org/gmane.emacs.devel/153656/focus=153681
> will fix your issue?

Sorry I hadn't seen that discussion before. 

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.

-- 
Nico.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-05  9:59     ` Nicolas Richard
@ 2013-12-06  1:15       ` Juri Linkov
  2013-12-11  0:45         ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2013-12-06  1:15 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 14397

> 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))))))))





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-06  1:15       ` Juri Linkov
@ 2013-12-11  0:45         ` Juri Linkov
  2013-12-12 10:11           ` Nicolas Richard
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2013-12-11  0:45 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 14397-done

Version: 24.4

> 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.

To reduce the total number of entries in the map I installed
the mapping only with basic modifiers control, meta and shift
and without using a powerset function.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-11  0:45         ` Juri Linkov
@ 2013-12-12 10:11           ` Nicolas Richard
  2013-12-13  1:09             ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2013-12-12 10:11 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 14397-done

Le 11/12/2013 01:45, Juri Linkov a écrit :
> Version: 24.4
> 
>> 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.
> 
> To reduce the total number of entries in the map I installed
> the mapping only with basic modifiers control, meta and shift
> and without using a powerset function.
> 

Thanks.

Just a thought : your patch puts, in bindings.el, some function-key-map
bindings which were already defined in simple.el ; see the section
;;;; Keypad support.
in simple.el.

-- 
Nicolas.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined
  2013-12-12 10:11           ` Nicolas Richard
@ 2013-12-13  1:09             ` Juri Linkov
  0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2013-12-13  1:09 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 14397

> Just a thought : your patch puts, in bindings.el, some function-key-map
> bindings which were already defined in simple.el ; see the section
> ;;;; Keypad support.
> in simple.el.

Now I removed duplicate bindings from simple.el, except kp-enter.
simple.el binds kp-enter to ?\r, and bindings.el binds it to `enter'.
Loadup loads simple.el later after bindings.el, so keybindings in
simple.el override the keybindings in bindings.el. Thus we could
leave it as is, allowing simple.el to override kp-enter with ?\r.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-12-13  1:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 10:42 bug#14397: 24.3; <C-kp-1> and <M-kp-1> undefined Nicolas Richard
2013-12-04 10:59 ` Nicolas Richard
2013-12-05  1:28   ` Juri Linkov
2013-12-05  9:59     ` Nicolas Richard
2013-12-06  1:15       ` Juri Linkov
2013-12-11  0:45         ` Juri Linkov
2013-12-12 10:11           ` Nicolas Richard
2013-12-13  1:09             ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).