- 1 名前:名無しさん@お腹いっぱい。 [2011/11/29(火) 17:50:44.24 ]
- 前スレ
Emacs Part 38 hibari.2ch.net/test/read.cgi/unix/1308635178/
- 542 名前:名無しさん@お腹いっぱい。 mailto:sage [2012/01/06(金) 14:29:08.57 ]
- (defun somefunc ()
(interactive) (let ((buf (save-excursion (save-restriction (widen) (buffer-substring-no-properties (point-min) (point-max))))) str) (save-match-data (while (and (setq str (read-string "input:")) (string-match (regexp-quote str) buf)))) (insert (format "%s" (make-my-decoration str))) ))
- 543 名前:名無しさん@お腹いっぱい。 mailto:sage [2012/01/06(金) 14:38:52.45 ]
- >>542
widen するかどうかは処理内容によるんじゃないのか?あとバッファ全コピはやりすぎだ (defun somefunc () (interactive) (let (str) (save-match-data (while (and (setq str (read-string "input:")) (save-excursion (goto-char (point-min)) (search-forward str nil t)))) (insert (format "%s" (なんか str))) )))
|

|