(defun check-parens ()
"バッファの括弧の釣り合いを調べる."
(interactive)
(handler-case
(let ((home (point)))
(goto-char (point-min))
(while (forward-list))
(goto-char home)
(message "だいたいあってる")
t)
(simple-error (c)
(message "このへん間違ってるかも")
(ding)
nil)))
(compile 'check-parens)
使い方
lisp-mode、lisp-interaction-modeで
M-x: check-parens
これをもうちょっと弄ってbefore-save-buffer-hookとかに引っ掛ければ便利そう。
とか思いつつも最近は括弧の閉じ忘れをすることがなくなったので、ほとんど使って いない状況です。
元ネタ: http://calypso.tux.org/pipermail/xemacs-beta/2009-January/015729.html
0 件のコメント:
コメントを投稿