[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:04552] digit-argument with ctrl



なかだです。

  なぁんで #\C-1 とかが効かないかなと思ってたんですが、CCF_0 と
かが連続してないのって Windows の事情かなにかなんでしょうか。


--- lisp/cmds.l.orig	Sun May 21 22:18:16 2000
+++ lisp/cmds.l	Thu May 25 14:36:00 2000
@@ -600,9 +600,24 @@
       (setq *this-command* 'kill-region)))
   t)
 
+(defconstant ctrl-digit-char-hash (make-hash-table :size 10))
+(setf (gethash #\C-0 ctrl-digit-char-hash) 0)
+(setf (gethash #\C-1 ctrl-digit-char-hash) 1)
+(setf (gethash #\C-2 ctrl-digit-char-hash) 2)
+(setf (gethash #\C-3 ctrl-digit-char-hash) 3)
+(setf (gethash #\C-4 ctrl-digit-char-hash) 4)
+(setf (gethash #\C-5 ctrl-digit-char-hash) 5)
+(setf (gethash #\C-6 ctrl-digit-char-hash) 6)
+(setf (gethash #\C-7 ctrl-digit-char-hash) 7)
+(setf (gethash #\C-8 ctrl-digit-char-hash) 8)
+(setf (gethash #\C-9 ctrl-digit-char-hash) 9)
+
+(defun ctrl-digit-char-p (c) (gethash c ctrl-digit-char-hash))
+
 (defun digit-argument (raw &optional arg)
   (interactive "P\np")
-  (let ((n (or (digit-char-p (set-meta-bit *last-command-char* nil)) 0)))
+  (let ((n (set-meta-bit *last-command-char* nil)))
+    (setq n (or (digit-char-p n) (ctrl-digit-char-p n) 0))
     (process-prefix-args 'digit-argument
 			 (if (or (null arg)
 				 (eq raw 'universal-argument))

Index Home