Thread View: fj.editor.mule
4 messages
4 total messages
Started by SHIIBA Michiharu
Sat, 22 Jun 2002 10:14
how to replace aa_bcd with aaBcd
Author: SHIIBA Michiharu
Date: Sat, 22 Jun 2002 10:14
Date: Sat, 22 Jun 2002 10:14
27 lines
1465 bytes
1465 bytes
$BDGMU$H8@$$$^$9!#(B query-replace-regexp $B$K4X$9$k<ALd$G$9!#(B (defun foo () (interactive) (query-replace-regexp "\\(\\w\\)_\\(\\w\\)" "\\1\\2"))) $B$N$h$&$J4X?t$rMQ0U$7$F<B9T$9$k$3$H$K$h$j!"%P%C%U%!Fb$K$"$k(B aa_bcd, foo_bar $B$N$h$&$JJ8;zNs$r(B aabcd, foobar $B$K$G$-$^$9$,!"F1;~$K(B _ $B$N8e$N(B1$BJ8;z$rBgJ8;z$KJQ49$7$F(B aaBcd, fooBar $B$N$h$&$K$J$k$h$&$K$9$k$K$O!"@h$N4X?t(B foo $B$r$I$N$h$&$K=q$-JQ$($l$P(B $B$h$$$G$7$g$&$+!#(B $B$h$m$7$/$*4j$$$7$^$9!#(B -- $BDGMU(B $B=<@2(B (Michiharu CBAR)
Re: how to replace aa_bcd with aaBcd
Author: Katsumi Yamaoka
Date: Thu, 27 Jun 2002 01:57
Date: Thu, 27 Jun 2002 01:57
31 lines
2343 bytes
2343 bytes
>>>>> In <x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp>
>>>>> SHIIBA Michiharu <shiiba@civilnet.kuciv.kyoto-u.ac.jp> wrote:
ๆค่ใใ> query-replace-regexp ใซ้ขใใ่ณชๅใงใใ
ๆค่ใใ> (defun foo ()
ๆค่ใใ> (interactive)
ๆค่ใใ> (query-replace-regexp "\\(\\w\\)_\\(\\w\\)" "\\1\\2")))
[...]
ๆค่ใใ> aaBcd, fooBar
ๆค่ใใ> ใฎใใใซใชใใใใซใใใซใฏใๅ
ใฎ้ขๆฐ foo ใใฉใฎใใใซๆธใๅค
ๆค่ใใ> ใใใฐใใใงใใใใใ
query-replace-regexp ใ ใใงใฏใใถใ็ก็ใงใใใใใชๆใใงใใใใ?
(defun foo2 ()
(interactive)
(let (old new)
(while (re-search-forward "\\(\\w+\\)_\\(\\w+\\)" nil t)
(setq old (match-string 0)
new (concat (match-string 1)
(capitalize (match-string 2))))
(if (y-or-n-p (concat "Query replacing \"" old
"\" with \"" new "\" "))
(replace-match new)))
(message "done")))
--
ๅฑฑๅฒก
Re: how to replace aa_bcd with aaBcd
Author: SHIIBA Michiharu
Date: Mon, 01 Jul 2002 02:30
Date: Mon, 01 Jul 2002 02:30
32 lines
1906 bytes
1906 bytes
$B;32,MM(B
$B$"$j$,$H$&$4$6$$$^$7$?!#(B
$B;32,MM(B> query-replace-regexp $B$@$1$G$O$?$V$sL5M}$G$9!#$3$s$J46$8$G$7$g$&$+(B?
$B;32,MM(B> (defun foo2 ()
$B;32,MM(B> (interactive)
$B;32,MM(B> (let (old new)
$B;32,MM(B> (while (re-search-forward "\\(\\w+\\)_\\(\\w+\\)" nil t)
$B;32,MM(B> (setq old (match-string 0)
$B;32,MM(B> new (concat (match-string 1)
$B;32,MM(B> (capitalize (match-string 2))))
$B;32,MM(B> (if (y-or-n-p (concat "Query replacing \"" old
$B;32,MM(B> "\" with \"" new "\" "))
$B;32,MM(B> (replace-match new)))
$B;32,MM(B> (message "done")))
foo_bar_aho $B$J$I$KBP1~$9$k$?$a$K!"(B
(replace-match new)
$B$r(B
(progn
(replace-match new)
(backward-char 1))
$B$H$7$F;H$&$3$H$K$7$^$7$?!#$I$&$b$"$j$,$H$&$4$6$$$^$7$?!#(B
--
$BDGMU(B $B=<@2(B (Michiharu CBAR)
Re: how to replace aa_bcd with aaBcd
Author: Keiichi Suzuki
Date: Mon, 01 Jul 2002 07:57
Date: Mon, 01 Jul 2002 07:57
29 lines
2378 bytes
2378 bytes
>>>>> Message-Id: <x5hejkch8a.fsf@civilnet.kuciv.kyoto-u.ac.jp> ใฎ่จไบใงใ
>>>>> "ๆค่" == SHIIBA Michiharu <shiiba@civilnet.kuciv.kyoto-u.ac.jp>ใใพๆฐใ...
(defun y-or-n-p-with-replace-highlight (beg end form &rest args)
(unwind-protect
(progn
(pop-to-buffer (current-buffer))
(replace-highlight beg end)
(y-or-n-p (apply 'format form args)))
(replace-dehighlight)))
ไฝใฆใใฎใใใใใใๅฎ็พฉใใฆใใใฆ
ๅฑฑๅฒกๆง> (if (y-or-n-p (concat "Query replacing \"" old
ๅฑฑๅฒกๆง> "\" with \"" new "\" "))
.ใฎไปฃใใซ
(if (y-or-n-p-with-replace-highlight
(match-beginning 0) (match-end 0)
"Quely replaceing \"%s\" with \"%s\" "
old new)
ใชใฉใจใใใจใกใใฃใจใ ใๅนธใใใ็ฅใใพใใใ
--
้ดๆจๅญไธ / keiichi@nanap.org
PGP finger print (DH/DSS)
0B32 B37E 6DE9 3BC1 68A4 4089 7AAF 2B03 ECBD 614B
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads