@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

= Mewでメールを受信できなくなった.undo-treeが悪さしてた

[2010-08-22 03:12:33]
>>>[emacs]
>>>[mew]

以下のパッチをあてるとなおります.

--- undo-tree.el	(revision 597)
+++ undo-tree.el	(working copy)
@@ -548,8 +548,9 @@
 
 ;; `characterp' isn't defined in Emacs versions <= 22
 (eval-and-compile
-  (unless (fboundp 'characterp)
-    (defmacro characterp (arg) `(char-valid-p ,arg))))
+  (if (fboundp 'characterp)
+      (defalias 'undo-tree-characterp 'characterp)
+    (defmacro undo-tree-characterp (arg) `(char-valid-p ,arg))))
 
 
 ;;; =====================================================================
@@ -1654,7 +1655,7 @@
   ;; Insert character or string STR ARG times, overwriting, and using
   ;; `undo-tree-insert-face'.
   (unless arg (setq arg 1))
-  (when (characterp str)
+  (when (undo-tree-characterp str)
     (setq str (make-string arg str))
     (setq arg 1))
   (dotimes (i arg) (insert str))

ようするにcharacterpがない時に勝手にマクロで上書きしちゃうんですね.

mewでは/Applications/Emacs.app/Contents/Resources/site-lisp/mew/mew-env.elのこの部分(67-70行目)

(if (fboundp 'characterp)
    (defalias 'mew-characterp 'characterp)
  (defalias 'mew-characterp 'integerp))

いままでintegerp使ってたみたい.

エラーの内容はこんな感じ.(適当に省略)

Debugger entered--Lisp error: (invalid-function mew-characterp)
  mew-characterp(nil)
  mew-scan-insert-line("%inbox" ["%inbox" ...
  byte-code("&#198;...
  mew-imap-command-post-fetch(#<process mew-imap-info-imap.gmail.com/inbox> ...
  mew-imap-filter(#<process mew-imap-info-imap.gmail.com/inbox> ...

上のパッチあてたらうまく動くようになった