From: Gerd Moellmann Date: Thu, 20 Jul 2000 20:35:05 +0000 (+0000) Subject: (universal-argument-map): Bind numeric keypad keys X-Git-Tag: emacs-pretest-21.0.90~2710 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bd7acc8d7c8626963a34786ecb8bdb4631b5e9e4;p=emacs.git (universal-argument-map): Bind numeric keypad keys kp-0 to kp-9 and kp-subtract. (digit-argument): Handle these keys. --- diff --git a/lisp/simple.el b/lisp/simple.el index 4ad1422e082..58aa83f5bb2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1398,6 +1398,17 @@ specifies the value of ERROR-BUFFER." (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 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." "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))))