@kyanny's blog

My thoughts, my life. Views/opinions are my own.

wanderlust が動かなくなってしまった

POPFile での再判定をコマンドラインから(というか emacs から)やりたかったのでそういうスクリプトをかいて、いざ wl からやろうとしたらパイプで渡す部分がシェル補完を扱えず、shell-command.el の補完可能版みたいにならんのかと思って探していたら 2ch の過去ログがひっかかって、作者からのパッチが載っているらしいけど過去ログ倉庫入りでみれない、どうしてもみたかったのでモリタポをはじめて購入してみてパッチあててみたところ、 wl 起動後に Folder モードへいくところで wl-folder-get-elmo-folder 関数のエラーだとかでメッセージを読めなくなってしまった・・・。手も足もでません。 biff を消してみたりなんか対処療法的なことをやってみたけどダメな感じ。 elmo のデータベースを作り直すのってどうやるんだろうか。悪いことにバックアップしておいたオリジナルのパッチ当てられるファイルのほうで上書きしてバイトコンパイルもしなおしたのにエラーが消えません。困ったなあ。

原因はわからないけど、 emerge してる最中に作られた?であろうバイトコンパイル済みの .elc ファイルと、パッチをあてたあとに自分で emacs を起動して作ったバイトコンパイルファイルで、コンパイル条件でも違うのか、自分でバイトコンパイルしたほうだと Invalid function wl-folder-get-elmo-folder とかでおこられてしま・・・と、ここまでかいて、 site-lisp/wl 以下は root 権限だから root で emacs を起動してバイトコンパイルをしていたけど、 wl を使っていて ~/.elmo とかが存在するのは一般ユーザーだから .elmo フォルダがないことでエラーになっているのかな?と気づいた。とりあえず .elc を消してパッチあてた .el のみ読むように仕向けたら動くようになった。

予想どおり、一般ユーザーで .elc をつくりなおしたらうまくいった。焦った。

50 モリタポ払ってゲットしたパッチは以下。過去ログなうえになぜかスレにかいてあったものは Base64 エンコードされていたのだけど、まあ公開しちゃう。これと http://www.bookshelf.jp/soft/meadow_45.html#SEC668 の shell-command.el があると Summary モードで | 押してパイプるときにタブで補完できるようになった。

Index: wl/wl-summary.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-summary.el,v
retrieving revision 1.400
diff -u -r1.400 wl-summary.el
--- wl/wl-summary.el	22 Mar 2005 06:38:57 -0000	1.400
+++ wl/wl-summary.el	6 Apr 2005 09:24:47 -0000
@@ -4787,8 +4787,8 @@
   (interactive (list current-prefix-arg nil))
   (if (null (wl-summary-message-number))
       (message "No message.")
-    (setq command (read-string "Shell command on message: "
-			       wl-summary-shell-command-last))
+    (setq command (wl-read-shell-command "Shell command on message: "
+					 wl-summary-shell-command-last))
     (if (y-or-n-p "Send this message to pipe? ")
 	(wl-summary-pipe-message-subr prefix command))))
 
@@ -4797,8 +4797,9 @@
   (interactive (list current-prefix-arg nil))
   (if (null wl-summary-buffer-target-mark-list)
       (message "No marked message.")
-    (setq command (read-string "Shell command on each marked message: "
-			       wl-summary-shell-command-last))
+    (setq command (wl-read-shell-command
+		   "Shell command on each marked message: "
+		   wl-summary-shell-command-last))
     (when (y-or-n-p "Send each marked message to pipe? ")
       (while (car wl-summary-buffer-target-mark-list)
 	(let ((num (car wl-summary-buffer-target-mark-list)))
Index: wl/wl-util.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-util.el,v
retrieving revision 1.74
diff -u -r1.74 wl-util.el
--- wl/wl-util.el	20 Mar 2005 09:19:40 -0000	1.74
+++ wl/wl-util.el	6 Apr 2005 09:24:48 -0000
@@ -1067,6 +1067,17 @@
 	(setq value (prin1-to-string value)))
       (concat (downcase field) ":" value)))))
 
+(cond
+ ((fboundp 'shell-command-read-minibuffer)
+  (defun wl-read-shell-command (prompt &optional
+				       initial-contents keymap read hist)
+    (shell-command-read-minibuffer prompt default-directory
+				   initial-contents keymap read hist)))
+ (t
+  (defun wl-read-shell-command (prompt &optional
+				       initial-contents keymap read hist)
+    (read-from-minibuffer prompt initial-contents keymap read hist))))
+
 (require 'product)
 (product-provide (provide 'wl-util) (require 'wl-version))