• 作成:

EmacsのWoManでディレクトリが存在しない時のエラーが鬱陶しいので調べましたが未解決

要約

*WoMan-Log*を警告程度では表示させない方法を探したけど公式的には無いようです。エラーログ全体ごと殺すか、見えにくくするしか無い。

問題

初期設定したEmacsのwoman関係コマンドでmanを引くと、 *WoMan-Log*バッファに以下のように警告が表示されます。

  **  Ignoring unreadable ‘manpath’ directory tree ‘/usr/man’!

今回は/usr/manでしたけど、いつもは/usr/local/manとかが多いですね。

これまで私は、「あーはいはい読み込めないエラーね、適当にディレクトリを作って…」と行っていたので、今回もそうしようかと思いましたが、 local以下ならともかくそれ以外のディレクトリをパッケージマネージャの管轄外で触るのはヤバイなと思ったので、そもそもこの警告が出ることがおかしいのではないかと思い、警告を消す方法を考えました。

woman-manpath周りの編集はボツ

woman-manpath変数周りを弄って存在しないパスを消そうかと思いましたが、 Cygwinとかはもう使わないとしても、パッケージによって独自のmanを配置していることもあるので、それぞれ把握し切るのは困難だと思いました。

バッファを見ないことにしました

6 The WoMan-Log Buffer

This is modeled on the Emacs byte-compiler. It logs all files formatted by WoMan and the time taken. If WoMan finds anything that it c> annot handle then it writes a warning to this buffer. If the variable woman-show-log is non-nil (by default it is nil) then WoMan automatically displays this buffer. See Interface Options. Many WoMan warnings can be completely ignored, because they are reporting the fact that WoMan has ignored requests that it is correct for WoMan to ignore. In some future version this level of paranoia may be reduced, but not until WoMan is deemed more reliable. At present, all warnings should be treated with some suspicion. Uninterpreted escape sequences are also logged (in some cases). By resetting the variable woman-ignore to nil (by default it is t), uninterpreted roff requests can optionally be left in the formatte> d buffer to indicate precisely where they occurred. See Interface Options.

https://www.gnu.org/software/emacs/manual/html_mono/woman.html#Log

これによるとwoman-show-logがnon-nilの場合表示されて、デフォルトnilらしいですが、 nilでも表示されますね…

ソース読むほうが英語読むより早い。

なるほどバッファは必ず作られて、 woman-show-logはそのバッファを表示。この表示とはバッファがウィンドウのカレントになることを指しているのですね。

woman-ignorenilにすることで更に細かいエラーを見ることが出来ると。

Emacsの伝統的な使い方では小さなバッファは作られても害では無いのですが、 Helmみたいな一覧インターフェイスを使っていると、一覧表示した時にノイズになるのでできるだけバッファ作成は遠慮したい所ですね。

かと言って、完全にログを殺してしまうのも考えものです。 Manのパースエラーとかもここに書き込まれるので、本当にエラーになったことがわからなくなります。

woman-file-readable-pを書き換えてログ出力しないことも考えましたが、あまり行儀がよろしくありません。

helm-boring-buffer-regexp-list"\\*WoMan-Log"を追加することで無視することにしました。そろそろHelmを考え時ですかねえ。