Mercurial > emacs
changeset 30347:a8a6780670ad
(universal-argument-map): Bind numeric keypad keys
kp-0 to kp-9 and kp-subtract.
(digit-argument): Handle these keys.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 20 Jul 2000 20:35:05 +0000 |
parents | e720a582ab3b |
children | 2dc989936987 |
files | lisp/simple.el |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/simple.el Thu Jul 20 17:31:18 2000 +0000 +++ b/lisp/simple.el Thu Jul 20 20:35:05 2000 +0000 @@ -1398,6 +1398,17 @@ (define-key map [?7] 'digit-argument) (define-key map [?8] 'digit-argument) (define-key map [?9] 'digit-argument) + (define-key map [kp-0] 'digit-argument) + (define-key map [kp-1] 'digit-argument) + (define-key map [kp-2] 'digit-argument) + (define-key map [kp-3] 'digit-argument) + (define-key map [kp-4] 'digit-argument) + (define-key map [kp-5] 'digit-argument) + (define-key map [kp-6] 'digit-argument) + (define-key map [kp-7] 'digit-argument) + (define-key map [kp-8] 'digit-argument) + (define-key map [kp-9] 'digit-argument) + (define-key map [kp-subtract] 'universal-argument-minus) map) "Keymap used while processing \\[universal-argument].") @@ -1450,7 +1461,10 @@ "Part of the numeric argument for the next command. \\[universal-argument] following digits or minus sign ends the argument." (interactive "P") - (let ((digit (- (logand last-command-char ?\177) ?0))) + (let* ((char (if (integerp last-command-char) + last-command-char + (get last-command-char 'ascii-character))) + (digit (- (logand char ?\177) ?0))) (cond ((integerp arg) (setq prefix-arg (+ (* arg 10) (if (< arg 0) (- digit) digit))))