[Mew-dist 812] Re: C-u digit

SAKAI Kiyotaka ksakai at example.com
1997年 4月 4日 (金) 15:17:57 JST


>> In article <9704030312.AA11135 at example.com>, Murata Takashi <Takashi.Murata at example.com> writes:

>   draft modeで、 C-u C-d だとちゃんとC-dが効きますが、 C-u 4 C-d と、
> digitを付けると^Dがdigitだけ挿入されてしまいます(C-u 4 C-q C-dと同等)。
> 以前からそうなのですが、他の方は問題ないのでしょうか?

universal-argument のときに prefix-argument が完全に取り除けていないの
が原因です。

以下のパッチを当てれば解決することができます。

# ただ、どうもこのコードでは美しくないなあ。
# mew-subvertor を string も取れるようにすれば、もう少し簡潔に書けるかな。
-- 
酒井 清隆 (E-mail: ksakai at example.com)


===================================================================
RCS file: RCS/mew-draft.el,v
retrieving revision 1.2
diff -c -r1.2 mew-draft.el
*** mew-draft.el	1997/04/04 05:05:25	1.2
--- mew-draft.el	1997/04/04 06:14:07
***************
*** 875,890 ****
  
  (defun mew-draft-keyswitch ()
    (interactive)
!   (let* ((key (this-command-keys)) (len (length key))
  	 (command (lookup-key (current-global-map) key))
! 	 (i 0) func)
      (if (numberp command)
! 	(setq command (lookup-key (current-global-map) 
  				  (if (vectorp key) 
! 				      (mew-subvector key 0 command)
! 				    (substring key 0 command)))))
      (if (or (eq command 'universal-argument) (eq command 'digit-argument))
  	(catch 'keyswitch
  	  (while (< i len)
  	    (if (eq 'mew-draft-keyswitch
  		    (key-binding (char-to-string (aref key i))))
--- 875,898 ----
  
  (defun mew-draft-keyswitch ()
    (interactive)
!   (let* ((key (this-command-keys))
  	 (command (lookup-key (current-global-map) key))
! 	 (i 0) len func)
      (if (numberp command)
! 	(setq len command
! 	      command (lookup-key (current-global-map) 
  				  (if (vectorp key) 
! 				      (mew-subvector key 0 len)
! 				    (substring key 0 len)))
! 	      key (if (vectorp key)
! 		      (mew-subvector key len)
! 		    (substring key len))))
!     (setq len (length key))
      (if (or (eq command 'universal-argument) (eq command 'digit-argument))
  	(catch 'keyswitch
+ 	  (while (and (eq command 'universal-argument)
+ 		      (<= ?0 (aref key i)) (>= ?9 (aref key i)))
+ 	    (setq i (1+ i)))
  	  (while (< i len)
  	    (if (eq 'mew-draft-keyswitch
  		    (key-binding (char-to-string (aref key i))))



Mew-dist メーリングリストの案内