2008-03-20から1日間の記事一覧

elispでgrepする

普通に書くならば、 (let (matched) (save-excursion (goto-char (point-min)) (while (re-search-forward regexp nil t) (push (match-string 0) matched)) (nreverse matched))) 正直ヘドが出るコードだ。 だがloopマクロを使うと簡潔に書ける。 (save-exc…