Newsgroups: fj.editor.emacs,fj.editor.misc
Path: galaxy.trc.rwcp.or.jp!jaist-news!cs.titech!koudai!fujieda
From: fujieda@cs.titech.ac.jp (Fujieda Kazuhiro)
Subject: Re: [vip-mode] using Kanji in Replace-mode
In-Reply-To: bizenya@coins.is.tsukuba.ac.jp's message of 23 Jan 93 17:01:43 GMT
Message-ID: <FUJIEDA.93Jan24221757@cake.cs.titech.ac.jp>
Lines: 122
Sender: news@cs.titech.ac.jp (Usenet News System)
Nntp-Posting-Host: cake
Organization: Tokyo Institute of Tech., Dept. of Computer Science, Japan
References: <C1BGMz.7I2@coins.is.tsukuba.ac.jp>
Distribution: fj
Date: Sun, 24 Jan 1993 13:18:02 GMT
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:3444 fj.editor.misc:430
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.editor.emacs&nb=3444&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$BF#;^!wEl9)Bg$G$9!#(B

In article <C1BGMz.7I2@coins.is.tsukuba.ac.jp> bizenya@coins.is.tsukuba.ac.jp (Katsujiroh NAKANO) writes:
> 
> $BA0Ds=*$j(B. 
> 
> $B$H$3$m$G(B, vip-mode (version 4.3)$B$O(B, $B2?8N$+(BReplace-mode$B$K$O$$$k$H(B, 
> fence-mode$B$,$*$+$7$/$J$j$^$9(B. 
> 
> $B860x$rCN$C$F$$$i$C$7$c$kJ}$O(B, $B8fO"Mm2<$5$k$H4r$7$$$G$9(B. 

  $B$-$C$HBg@*$N(B vip & egg $B%f!<%6$+$iEz$,JV$C$F$/$k$G$7$g$&(B :-)$B!#(B

  $B$$$m$$$m$JEz$,$"$k$H;W$$$^$9$,!"$H$j$"$($:;d$O(B vip-get-editor-
command $B$H(B vip-overwrite-execute $B$r0J2<$N$h$&$K=$@5$7$^$7$?!#(B

  $B$I$&$$$&Iw$K<($9$N$,NI$$$N$+J,$+$i$J$$$N$G!";d$N(B 
vip-get-editor-command $B$H(B vip-overwrite-execute $B$rA4It$D$1$^$9!#(B
`>>>' $B$G<($7$?ItJ,$,=$@52U=j$G$9!#(B

----------------------------$B$3$3$+$i(B---------------------------------------
(defun vip-get-editor-command (l-map g-map &optional str)
  "Read characters from keyboard until an editor command is formed, using
local keymap L-MAP and global keymap G-MAP.  If the command is a
self-insert-command, the character just read is returned instead.  Optional
string STR is used as initial input string."
  (let (char l-bind g-bind)
    (setq char
  (if (or (null str) (string= str ""))
      (read-char)
    (string-to-char str)))
    (setq last-command-char char)
    (setq l-bind (vip-binding-of char l-map))
    (if (null l-bind)
;; since local binding is empty, we concentrate on global one.
(progn
  (setq g-bind (vip-binding-of char g-map))
  (if (null g-bind)
      nil ;; return nil, since both bindings are void.
    (if (keymapp g-bind)
(vip-get-editor-command nil g-bind (vip-string-tail str))
>>>      ; by fujieda
>>>      (if (or (eq g-bind 'self-insert-command)
>>>      (and (boundp 'egg-version)
>>>   (eq g-bind 'egg-self-insert-command)))
>>>  char g-bind))))
      ;; local binding is nonvoid
      (if (keymapp l-bind)
  ;; since l-bind is a keymap, we consider g-bind as well.
  (progn
    (setq g-bind (vip-binding-of char g-map))
    (if (null g-bind)
(vip-get-editor-command l-bind nil (vip-string-tail str))
      (if (keymapp g-bind)
  ;; both bindings are keymap
  (vip-get-editor-command l-bind g-bind (vip-string-tail str))
;; l-bind is a keymap, so we neglect g-bind
(vip-get-editor-command l-bind nil (vip-string-tail str)))))
;; l-bind is a command
>>>    ; by fujieda
>>>(if (or (eq l-bind 'self-insert-command)
>>>(and (boundp 'egg-version)
>>>     (eq l-bind 'egg-self-insert-command)))
>>>    char l-bind)))))


(defun vip-overwrite-execute (&optional arg exclusive limit)
  (interactive)
  (let (com overrun (cont t))
    (if limit
(if (> limit (point))
    (set-mark limit)
  (setq cont nil)))
    (while (and (not vip-need-to-exit-overwrite) cont
>>>        ; by fujieda
>>>(if (boundp 'egg-version)
>>>    (not (and egg:*input-mode* egg:*mode-on*)) t))
      (setq com (vip-get-editor-command vip-insert-local-map global-map))
      (if (numberp com)
  (progn
    (if exclusive
(progn
  (if (eolp) (forward-char 1))
  (insert (char-to-string com))
  (delete-char 1))
      (insert (char-to-string com))
      (if (not overrun)
  (if (not (eolp))
      (delete-char 1)
    (setq overrun t))))
    (if (and limit (= (point) (mark)))
(progn
  (setq cont nil)
  (vip-change-mode-line "Insert")
  (vip-refresh-mode-line))))
(command-execute com arg)))
))
----------------------------$B$3$3$^$G(B---------------------------------------

> 
> $B$"$H(B, $B%F%-%9%HKv$G$N(B, dd $B$,(Bvi-like$B$G$J$$$N$r(B, 
> $BD>$7$?J}$,$$$i$C$7$c$C$?$i(B, $B$=$l$b(B, $B8fO"Mm2<$5$$(B. 

  $B$3$l$OD>$7$F$^$;$s!#D>$=$&D>$=$&$H;W$C$F$$$k$&$A$K!"47$l$F$7$^$$$^(B
$B$7$?(B ^^;;

>  $B!t(B  vip-mode$B$C$F(B, $BB>$K$b$$$C$Q$$F|K\8l$K4X$7$F$O(B, 
>  $B!t!!JQ$J$H$3$m$"$k$1$I(B, $B$=$f$H$3D>$7$?$C$F$$$&OC$7$OJ9$+$J$$$J$!(B. 
> 

  $B%o!<%I0\F0$K$D$$$F$bD>$7$^$7$?$1$I!"$$$j$^$9$+!)(B

  $B%+!<%=%k0LCV$,F|K\8l$N>l9g$K$O!"(Bnemacs $B$N%o!<%I0\F0$r;H$&$h$&$K$7(B
$B$F$"$j$^$9!#$5$9$,$K(B e $B$O$I$&$7$F$$$$$N$+J,$+$i$J$+$C$?$G!">/$7$$$$(B
$B2C8:$G$9!#(B
  Sun $B$N(B JLE vi $B$HF0:n$r9g$o$;$k$3$H$b9M$($?$N$G$9$,!"(Bnemacs $B$N%o!<(B
$B%I0\F0$O$H$F$bJXMx$J$N$G$3$A$i$r:NMQ$7$^$7$?!#(B
--
-------------------------------------------------------------------
   $BC/$b$=$&;W$C$F$J$$$1$I(B     $BEl5~9)6HBg3X(B $B>pJs9)3X2J(B $BJR;38&5f<<(B
   $BKM$O:#G/$GB46H$9$k$N$5(B     $BF#;^(B $BOB9((B  fujieda@cs.titech.ac.jp
-------------------------------------------------------------------
