From 7c1cae994895bfe3424c92ab10899cbec9ca5854 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sat, 30 Aug 2003 10:01:46 +0000 Subject: [PATCH] Synch up with main trunk. --- ChangeLog | 13 + NEWS | 60 ++++ NEWS.ja | 56 ++++ WL-MK | 53 +-- doc/TODO | 1 + doc/TODO.ja | 1 + doc/version.tex | 2 +- doc/version.texi | 2 +- doc/wl-ja.texi | 202 +++++++----- doc/wl-refcard-ja.tex | 13 +- doc/wl-refcard.tex | 13 +- doc/wl.texi | 161 +++++---- elmo/ChangeLog | 207 ++++++++++++ elmo/elmo-dop.el | 13 +- elmo/elmo-filter.el | 11 +- elmo/elmo-imap4.el | 7 +- elmo/elmo-localdir.el | 15 +- elmo/elmo-maildir.el | 165 +++++++--- elmo/elmo-mime.el | 28 +- elmo/elmo-msgdb.el | 101 +++++- elmo/elmo-multi.el | 134 ++++---- elmo/elmo-net.el | 7 +- elmo/elmo-nmz.el | 3 +- elmo/elmo-nntp.el | 4 +- elmo/elmo-pipe.el | 57 +++- elmo/elmo-pop3.el | 8 +- elmo/elmo-util.el | 10 +- elmo/elmo-version.el | 2 +- elmo/elmo.el | 274 ++++++++-------- etc/VERSION | 5 +- samples/en/dot.wl | 6 - samples/ja/dot.wl | 6 - tests/ChangeLog | 4 + tests/check-modules.el | 6 + wl/ChangeLog | 350 ++++++++++++++++++++ wl/wl-action.el | 201 ++++++------ wl/wl-address.el | 18 +- wl/wl-draft.el | 5 +- wl/wl-expire.el | 40 +-- wl/wl-highlight.el | 135 ++++---- wl/wl-message.el | 3 +- wl/wl-mime.el | 61 +++- wl/wl-refile.el | 6 +- wl/wl-score.el | 11 +- wl/wl-summary.el | 847 ++++++++++++++++++++---------------------------- wl/wl-thread.el | 22 +- wl/wl-util.el | 11 +- wl/wl-vars.el | 127 ++++++-- wl/wl.el | 12 +- 49 files changed, 2194 insertions(+), 1305 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2751d4..de137db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-08-26 Tetsurou Okazaki + + * WL-MK (wl-texinfo-info-file, wl-texinfo-texi-file, + wl-texinfo-check-newer): New functions. + (wl-texinfo-install-file): Use `wl-texifo-info-file'. + (wl-primary-info-file): Likewise. + (wl-texinfo-format-file): Use `wl-texinfo-check-newer' + and `wl-texinfo-texi-file'. Remove unused local variable `beg'. + +2003-07-26 Hiroya Murata + + * doc/.cvsignore: New file. + 2003-07-19 Hiroya Murata * etc/icons/wl-summary-dispose-up.xpm: New file. diff --git a/NEWS b/NEWS index 22d1339..32cb3b8 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,65 @@ Wanderlust NEWS -- User-visible changes in Wanderlust. +* Changes in 2.12.0 from 2.10.1 + +** New mark, 'A' and '&' is added for answered messages. + Now answered messages have its own mark in the summary mode. + 'A' is displayed for uncached messages and '&' is for cached messages. + +** New search condition 'Flag' (Status of the message) is added. + There are flags 'unread', 'important', 'answered', + 'digest' (unread or important) and 'any' (any of the flag). + For example, following filter folder contains only unread or important + messages in the %inbox folder. + + /flag:digest/%inbox + +** In the multi-folder, status of messages are synchronized with original + folder. + For example, unread status of '+inbox' is updated to '*+inbox,+outbox'. + +** The temporary mark and corresponding action is now customizable. + + By default, follwoing mark-and-actions are defined. + mark-and-actions which are defined as before. + "o" refile (same as before) + "O" copy (same as before) + "d" dispose (formerly delete, 'D' mark. Messages are moved to + wl-trash-folder. Its behavior is decided by + wl-dispose-folder-alist.) + New mark-and-actions which are newly introduced. + "D" delete (remove message immediately) + "i" prefetch (prefetch message) + "~" resend (resend message) + Press 'x' to execute actions which corresponds to the mark. + mark-and-actions can be define by the new variable, + 'wl-summary-mark-action-list'. See its docstring for more in detail. + +** The function wl-summary-resend-message is abolished. Instead of it, + you can put mark for resending by wl-summary-resend. + +** New face + + wl-highlight-summary-disposed-face + wl-highlight-summary-prefetch-face + wl-highlight-summary-resend-face + wl-highlight-summary-answered-face + wl-highlight-action-argument-face + +** Abolished face + + wl-highlight-refile-destination-face + (renamed to wl-highlight-action-argument-face) + +** Variables renamed + wl-summary-delete-folder-alist is renamed to + wl-summary-dispose-folder-alist. + +** POP3 folder existence check is simplifyed (by default). + The default value for elmo-pop3-exists-exactly is changed to nil. + +** IMAP4 commands EXPUNGE and CHECK are now send asynchronously. + ** Default value of wl-folder-hierarchy-access-folders has been changed. ** Access group "@/" of shimbun folders can be used now. diff --git a/NEWS.ja b/NEWS.ja index 8224383..d3df5f8 100644 --- a/NEWS.ja +++ b/NEWS.ja @@ -1,5 +1,61 @@ Wanderlust NEWS ($BF|K\8lHG(B) -- User-visible changes in Wanderlust. +* 2.10.1 $B$+$i(B 2.12.0 $B$X$NJQ99E@(B + +** $BJV?.:Q$_%^!<%/(B A,& $B$,DI2C$5$l$^$7$?!#(B + $B%5%^%j$K$*$$$F!$JV?.$7$?%a%C%;!<%8$K(B A $B%^!<%/(B($B%-%c%C%7%e$J$7$N>l9g(B) + $B$b$7$/$O(B & $B%^!<%/(B($B%-%c%C%7%e$"$j$N>l9g(B) $B$,I=<($5$l$^$9!#(B + +** $B%U%)%k%@$N8!:w>r7o$K!$(B'$B%U%i%0(B' ($B%a%C%;!<%8$N>uBV(B) $B$,DI2C$5$l$^$7$?!#(B + $B%U%i%0$K$O!"(Bunread($BL$FI(B), important($B=EMW(B), answered($BJV?.:Q$_(B), + digest ($BL$FI$^$?$O=EMW(B), any ($BL$FI$^$?$O=EMW$^$?$OJV?.:Q$_(B)$B$,$"$j$^$9!#(B + $BNc$($P!"uBV$,F14|$5$l$k$h$&$K$J$j$^$7$?!#(B + $BNc$($P!$(B+inbox $B$NL$FI>pJs$,!$(B*+inbox,+outbox $B$K$bH?1G$5$l$^$9!#(B + +** $B0l;~%^!<%/$H!"$=$l$KBP$9$k%"%/%7%g%s$r<+M3$KDj5A$G$-$k$h$&$K$J$j$^$7$?!#(B + + $B%G%U%)%k%H$G$O0J2<$N%^!<%/$H%"%/%7%g%s$rDj5A$7$F$$$^$9!#(B + $B=>Mh$+$i0z$-7Q$,$l$?%^!<%/$H%"%/%7%g%s(B + "o" refile ($B=>Mh$N%j%U%!%$%k$HF1$8(B) + "O" copy ($B=>Mh$N%3%T!<$HF1$8(B) + "d" dispose ($B5l(B delete, D $B%^!<%/!#(Bwl-trash-folder $B$K0\F0!#(B + wl-dispose-folder-alist $B$NCM$K$h$j5sF0$,7h$^$k!#(B) + $B?7$?$KDI2C$5$l$?%^!<%/$H%"%/%7%g%s(B + "D" delete ($B$$$-$J$j>C5n(B) + "i" prefetch ($B%W%j%U%'%C%A(B) + "~" resend ($B:FAw(B) + $B%5%^%j$G(B x $B%-!<$r2!$9$H%^!<%/$KBP1~$7$?%"%/%7%g%s$,$9$Y$F\$7$/$OF1JQ?t$N(B docstring $B$r;2>H$7$F$/$@$5$$!#(B + +** $B4X?t(B wl-summary-resend-message $B$OGQ;_$5$l$^$7$?!#$=$NBe$o$j$K(B + wl-summary-resend $B$r;H$($P:FAw%^!<%/$rIU$1$k$3$H$,$G$-$^$9!#(B + +** $B?75,(B face + + wl-highlight-summary-disposed-face + wl-highlight-summary-prefetch-face + wl-highlight-summary-resend-face + wl-highlight-summary-answered-face + wl-highlight-action-argument-face + +** $BGQ;_$5$l$?(B face + + wl-highlight-refile-destination-face + (wl-highlight-action-argument-face $B$KJQL>(B) + +** $BJQ?t(B wl-summary-delete-folder-alist $B$O(B wl-summary-dispose-folder-alist $B$K(B + $BL>A0$,JQ99$5$l$^$7$?!#(B + +** POP3 $B%U%)%k%@$NB8:_%A%'%C%/$N%G%U%)%k%H5sF0$r4JN,2=(B + elmo-pop3-exists-exactly $B$N%G%U%)%k%HCM$r(B nil $B$K$7$^$7$?!#(B + +** IMAP4 $B$K$*$$$F!"(BEXPUNGE, CHECK $B%3%^%s%I$rHsF14|$GAw?.$9$k$h$&$K$7$^$7$?!#(B + ** wl-folder-hierarchy-access-folders $B$N=i4|CM$,JQ99$5$l$^$7$?!#(B ** $B?7J9%U%)%k%@$N%"%/%;%9%0%k!<%W(B "@/" $B$,;H$($k$h$&$K$J$j$^$7$?!#(B diff --git a/WL-MK b/WL-MK index cb0235d..123db2b 100644 --- a/WL-MK +++ b/WL-MK @@ -375,26 +375,37 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Texinfo stuff +(defun wl-texinfo-info-file (lang) + (symbol-value (intern (format "wl-%s-info" lang)))) + +(defun wl-texinfo-texi-file (lang) + (symbol-value (intern (format "wl-%s-texi" lang)))) + +(defun wl-texinfo-check-newer (lang) + (let ((info-file (expand-file-name (wl-texinfo-info-file lang) DOCDIR))) + (and + (file-newer-than-file-p info-file + (expand-file-name "version.texi" DOCDIR)) + (file-newer-than-file-p info-file + (expand-file-name (wl-texinfo-texi-file lang) DOCDIR))))) + (defun wl-texinfo-format-file (lang) - (let ((infofile (symbol-value (intern (format "wl-%s-info" lang)))) - (texifile (symbol-value (intern (format "wl-%s-texi" lang))))) - (require 'wl-vars) ;; for 'wl-cs-local - (or (file-newer-than-file-p (expand-file-name infofile DOCDIR) - (expand-file-name texifile DOCDIR)) - (let (obuf beg) - ;; Support old texinfmt.el - (require 'ptexinfmt (expand-file-name "ptexinfmt.el" UTILSDIR)) - (find-file (expand-file-name texifile DOCDIR)) - (setq obuf (current-buffer)) - ;; We can't know file names if splitted. - (texinfo-format-buffer t) - ;; Emacs20.2's default is 'raw-text-unix. - (and (fboundp 'set-buffer-file-coding-system) - (set-buffer-file-coding-system wl-cs-local)) - (save-buffer) - (kill-buffer (current-buffer)) ;; info - (kill-buffer obuf)) ;; texi - ))) + (require 'wl-vars) ;; for 'wl-cs-local + (or (wl-texinfo-check-newer lang) + (let (obuf) + ;; Support old texinfmt.el + (require 'ptexinfmt (expand-file-name "ptexinfmt.el" UTILSDIR)) + (find-file (expand-file-name (wl-texinfo-texi-file lang) DOCDIR)) + (setq obuf (current-buffer)) + ;; We can't know file names if splitted. + (texinfo-format-buffer t) + ;; Emacs20.2's default is 'raw-text-unix. + (and (fboundp 'set-buffer-file-coding-system) + (set-buffer-file-coding-system wl-cs-local)) + (save-buffer) + (kill-buffer (current-buffer)) ;; info + (kill-buffer obuf)) ;; texi + )) (defun wl-texinfo-format () (wl-detect-info-directory) @@ -405,7 +416,7 @@ (wl-texinfo-format-file wl-info-lang)))) (defun wl-texinfo-install-file (lang) - (let ((infofile (symbol-value (intern (format "wl-%s-info" lang))))) + (let ((infofile (wl-texinfo-info-file lang))) (install-file infofile DOCDIR INFODIR nil 'overwrite))) (defun wl-texinfo-install () @@ -422,7 +433,7 @@ (let ((wl-info-lang (car wl-info-lang))) (wl-primary-info-file))) ((stringp wl-info-lang) - (symbol-value (intern (format "wl-%s-info" wl-info-lang)))))) + (wl-texinfo-info-file wl-info-lang)))) (defun wl-detect-info-directory () (config-wl-package-subr) diff --git a/doc/TODO b/doc/TODO index ff68dd0..cf0931b 100644 --- a/doc/TODO +++ b/doc/TODO @@ -10,6 +10,7 @@ * other tasks +** use hash table for entries in .addresses ** mitigate special treatment of NNTP around wl-folder-check-entity-async ** organize variable like wl-summary-other-frame-list so as to open matched summary in the new frame diff --git a/doc/TODO.ja b/doc/TODO.ja index 203280d..d63471f 100644 --- a/doc/TODO.ja +++ b/doc/TODO.ja @@ -10,6 +10,7 @@ * $B$=$NB>$N(B TODO +** .addresses $B%(%s%H%j$K$D$$$F(B hash table $B$r;H$&(B ** wl-folder-check-entity-async $B$N$"$?$j$G(B NNTP $B$,FCJL07$$$K$J$C$F$$$k$N$r(B $B$I$&$K$+$9$k(B ** wl-summary-other-frame-list $B$N$h$&$JJQ?t$r@_$1!"%^%C%A$7$?%5%^%j$O(B diff --git a/doc/version.tex b/doc/version.tex index 8b37edd..84e7100 100644 --- a/doc/version.tex +++ b/doc/version.tex @@ -1 +1 @@ -\def\versionnumber{2.11.3} +\def\versionnumber{2.11.9} diff --git a/doc/version.texi b/doc/version.texi index 2d6094d..6b14f43 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1 +1 @@ -@set VERSION 2.11.3 +@set VERSION 2.11.9 diff --git a/doc/wl-ja.texi b/doc/wl-ja.texi index 9bd0a87..ff41c97 100644 --- a/doc/wl-ja.texi +++ b/doc/wl-ja.texi @@ -1925,7 +1925,8 @@ prefix argument $B$r$D$1$k$H!"%9%F%#%C%-!<%5%^%j$KF~$j$^$9!#(B @item V @kindex V (Folder) @findex wl-folder-virtual -$B;XDj$7$?>r7o$H9gCW$9$k%a%C%;!<%8$N$_$r4^$`2>A[%U%)%k%@$X0\F0$7$^$9!#(B +$B;XDj$7$?>r7o$H9gCW$9$k%a%C%;!<%8$N$_$r4^$`2>A[%U%)%k%@(B($B%U%#%k%?%U%)%k%@(B) +$B$X0\F0$7$^$9!#(B (@code{wl-folder-virtual}) @item ? @@ -2554,7 +2555,7 @@ News $B%U%)%k%@$G$O(B article $BHV9f!"(BIMAP $B%U%)%k%@$G$O(B UID$B!"(BM $B0l;~E*%^!<%/$O!"%a%C%;!<%8$rA`:n$9$k$?$a%^!<%/$G$9!#(B -$B0l;~E*%^!<%/$K$O!"(B@samp{*}, @samp{D}, @samp{o}, @samp{O} $B$,$"$j$^$9!#(B +$B0l;~E*%^!<%/$K$O!"(B@samp{*}, @samp{d}, @samp{o}, @samp{O} $B$,$"$j$^$9!#(B @table @samp @item * @@ -2562,8 +2563,8 @@ News $B%U%)%k%@$G$O(B article $BHV9f!"(BIMAP $B%U%)%k%@$G$O(B UID$B!"(BM @kbd{m} $B$G;O$^$k%3%^%s%I$G(B @samp{*}$B%^!<%/$N$D$$$?%a%C%;!<%8BP$7$F0l3g$7$?=hM}(B $B$,$G$-$^$9!#(B -@item D -$B:o=|$9$k%a%C%;!<%8$KIU$/%^!<%/$G$9!#(B@kbd{d} $B$r2!$9$HIU$-$^$9!#(B +@item d +$B=hJ,$9$k%a%C%;!<%8$KIU$/%^!<%/$G$9!#(B@kbd{d} $B$r2!$9$HIU$-$^$9!#(B @item o $B%j%U%!%$%k$9$k%a%C%;!<%8$KIU$/%^!<%/$G$9!#(B@kbd{o}$B$r2!$9$H!"%j%U%!%$%k@h(B @@ -2574,8 +2575,7 @@ News $B%U%)%k%@$G$O(B article $BHV9f!"(BIMAP $B%U%)%k%@$G$O(B UID$B!"(BM $BMh$^$9!#$=$l$KEz$($k$H!"%3%T!<@h$N%U%)%k%@>pJs$,IU$12C$o$j$^$9!#(B @end table -@kbd{x} $B$r2!$9$H!"(B@samp{D}, @samp{o}, @samp{O} $B$N%^!<%/$,IU$$$F$$$k(B -$B%a%C%;!<%8$N:o=|!"%j%U%!%$%k!"%3%T!<$r$l$N0l;~E*%^!<%/$KBP1~$7$?%"%/%7%g%s$r$7$^$9! @item $ @kindex $ (Summary) @findex wl-summary-mark-as-important -@samp{$} $B%^!<%/$r$D$1$^$9!#4{$K(B @samp{$} $B%^!<%/$,$"$l$P:o=|$7$^$9!#(B +@samp{$} $B%^!<%/$r$D$1$^$9!#4{$K(B @samp{$} $B%^!<%/$,$"$l$P%^!<%/$ruBV$r%^!<%/$KH?1G(B -first, last ...$B%U%#%k%?%U%)%k%@$K0\F0(B +all $B8=:_$N(B msgdb $B$NFbMF$rGK4~$7!"A4>pJs$r$7$^$9!#(B + killed $B%a%C%;!<%8$O$7$^$;$s!#(B +all-entirely $B8=:_$N(B msgdb $B$NFbMF$rGK4~$7!"A4>pJs$r$7$^$9!#(B + killed $B%a%C%;!<%8$b$7$^$9!#(B +update $BJ];}$7$F$$$k(B msgdb $B$N>pJs$H:G?7>pJs$N:9J,$r99?7$7$^$9!#(B + killed $B%a%C%;!<%8$O99?7$7$^$;$s!#(B +update-entirely $BJ];}$7$F$$$k(B msgdb $B$N>pJs$H:G?7>pJs$N:9J,$r99?7$7$^$9!#(B + killed $B%a%C%;!<%8$b99?7$7$^$9!#(B +rescan $B8=:_$N(B msgdb $B$K4p$E$$$F:FI=<($r9T$$$^$9!#(B +rescan-noscore $B8=:_$N(B msgdb $B$K4p$E$$$F:FI=<($r9T$$$^$9!#(B + $B%9%3%"$K$h$j>C$($?%a%C%;!<%8$bI=<($7$^$9!#(B +cache-status $B%-%c%C%7%e$N>uBV$r%^!<%/$KH?1G$7$^$9!#(B +mark $B%^!<%/$N>uBV$r:G?7$K$7$^$9!#(B +no-sync $B2?$b$7$^$;$s!#(B +first:$B?t;z(B $B%U%#%k%?%U%)%k%@$K0\F0$7$^$9!#(B +last:$B?t;z(B $B%U%#%k%?%U%)%k%@$K0\F0$7$^$9!#(B @end group @end example @@ -3308,8 +3317,8 @@ first, last ...$B%U%#%k%?%U%)%k%@$K0\F0(B @item V @kindex V (Summary) -$BM?$($i$l$?>r7o$r;}$D%a%C%;!<%8$N$_$r;}$D2>A[%U%)%k%@$X0\F0$7$^$9!#(B -prefix argument $B$D$-$GA[%U%)%k%@$+$iC&=P$7$^$9!#(B +$BM?$($i$l$?>r7o$r;}$D%a%C%;!<%8$N$_$r;}$D2>A[%U%)%k%@(B($B%U%#%k%?%U%)%k%@(B)$B$X(B +$B0\F0$7$^$9!#(Bprefix argument $B$D$-$GA[%U%)%k%@$+$iC&=P$7$^$9!#(B @findex wl-summary-virtual (@code{wl-summary-virtual}) @@ -3331,17 +3340,10 @@ prefix argument $B$D$-$GA[%U%)%k%@$+$iC&=P$7$^$9!#(B $B%+!<%=%k9T$N%a%C%;!<%8$rFI$s$@$3$H$K$7$^$9!#(B (@code{wl-summary-mark-as-read}) -@item i -@kindex i (Summary) -$B%+!<%=%k9T$N%a%C%;!<%8$r%W%j%U%'%C%A$7$^$9!#(B -prefix argument $B$D$-$J$i$P4{$K%-%c%C%7%e$5$l$F$$$k%a%C%;!<%8$b(B -$B:FEY%W%j%U%'%C%A$7$^$9!#(B -@findex wl-summary-prefetch -(@code{wl-summary-prefetch}) - @item x @kindex x (Summary) -$B$9$Y$F$N(B @samp{D}, @samp{o}, @samp{O} $B%^!<%/$r$N%W%m%;%9$K%Q%$%W7PM3$G0z$-EO$7$^$9!#(B (@code{wl-summary-target-mark-pipe}) -@item D -@kindex D (Summary) -@findex wl-summary-erase -$B$4$_H"$K0\F0$;$:$K!"$=$N>l$GH$7$F2<$5$$!#(B + @item wl-folder-sync-range-alist @vindex wl-folder-sync-range-alist $B=i4|@_Dj$O!"0J2<$NO"A[%j%9%H!#(B @@ -7379,11 +7409,11 @@ Non-nil $B$J$i$P!"%a!<%kAw?.;~$KK\Ev$KAw?.$7$FNI$$$+$r3NG'$7$^$9!#(B @end lisp @noindent -$B%U%)%k%@L>$N@55,I=8=$H%U%)%k%@0\F0;~$N%5%^%j99?7%l%s%8$H$NO"A[%j%9%H$G$9!#(B -$B99?7%l%s%8$K$O(B @code{wl-summary-sync} $B$GF~NO$G$-$kCM$N$$$:$l$+(B -(@samp{all}, @samp{update}, @samp{rescan}, @samp{rescan-noscore}, -@samp{first}, @samp{last}, @samp{no-sync}) $B$r;XDj$7$^$9!#%^%C%A$7$J$+$C$?>l9g$O!"(B -@samp{update} $B$H$J$j$^$9!#(B +$B%U%)%k%@L>$N@55,I=8=$H%5%^%j99?7%l%s%8$H$NO"A[%j%9%H$G$9!#(B +$B99?7%l%s%8$K$O(B @samp{all}, @samp{update}, @samp{rescan}, @samp{no-sync} +$B$N$$$:$l$+$r;XDj$7$^$9!#%^%C%A$7$J$+$C$?>l9g$O!"(B@code{wl-default-sync-range} +$B$NCM(B($B=i4|CM$O(B @samp{update})$B$r;H$$$^$9!#(B +$B%l%s%8$N0UL#$K$D$$$F$O(B @code{wl-summary-sync} $B$N@bL@$r;2>H$7$F2<$5$$!#(B @item wl-ask-range @vindex wl-ask-range diff --git a/doc/wl-refcard-ja.tex b/doc/wl-refcard-ja.tex index f3dbd7a..c09e8b6 100644 --- a/doc/wl-refcard-ja.tex +++ b/doc/wl-refcard-ja.tex @@ -326,9 +326,12 @@ are preserved on all copies. \section{mark command} +\key{$B=hJ,%^!<%/$rIU$1$k(B}{d} +\key{$B:o=|%^!<%/$rIU$1$k(B}{D} \key{$B%j%U%!%$%k%^!<%/$rIU$1$k(B}{o} \key{$B%3%T!<%^!<%/$rIU$1$k(B}{O} -\key{$B:o=|%^!<%/$rIU$1$k(B}{d} +\key{$B%W%j%U%'%C%A%^!<%/$rIU$1$k(B}{i} +\key{$B:FAw%^!<%/$rIU$1$k(B}{\~{}} \key{$B=EMW%^!<%/$rIU$1$k(B}{\$} \key{$BI8E*%^!<%/$rIU$1$k(B}{*} \key{$BA4$F$N%a%C%;!<%8$rI8E*$K$9$k(B}{m a} @@ -339,7 +342,7 @@ are preserved on all copies. \key{$BI8E*$r:o=|(B}{m d} \key{$BI8E*$r0u:~(B}{m \#} \key{$BI8E*$N3F!9$r%Q%$%W$KN.$9(B}{m |} -\key{$B%j%U%!%$%k(B/$B:o=|(B/$B%3%T!<(B $B$r + + * elmo-msgdb.el (elmo-msgdb-message-entity-field): Decode value + when field is from or subject. + +2003-08-23 Yuuichi Teranishi + + * elmo-multi.el (elmo-message-entity-parent): Define. + (elmo-folder-search): Rewrite. + +2003-08-22 Hiroya Murata + + * elmo-multi.el (elmo-message-cached-p): Define. + + * elmo.el (elmo-message-cached-p): New method. + (elmo-message-accessible-p): Use it instead of msgdb API directly. + (elmo-message-flags): New method. + (elmo-message-flagged-p): New function. + + * elmo-version.el (elmo-version): Up to 2.11.9. + +2003-08-20 Hiroya Murata + + * elmo-version.el (elmo-version): Up to 2.11.8. + + * elmo.el (elmo-folder-move-messages): Removed unused arguments. + + * elmo-pipe.el (elmo-pipe-drain): Follow the change above. + +2003-08-14 Yuuichi Teranishi + + * elmo.el (elmo-folder-detach-messages): Undo last change. + +2003-08-13 Yuuichi Teranishi + + * elmo.el (elmo-folder-detach-messages): Don't load msgdb if empty. + + * elmo-pipe.el (elmo-pipe-drain): Bind elmo-inhibit-number-mapping + only when src folder type is pop3. + +2003-08-12 Yuuichi Teranishi + + * elmo-msgdb.el (elmo-msgdb-make-index): Use + elmo-msgdb-overview-entity-get-number instead of + elmo-message-entity-number. + +2003-08-09 Hiroya Murata + + * elmo-version.el (elmo-version): Up to 2.11.7. + +2003-08-07 Yuuichi Teranishi + + * elmo.el (elmo-folder-append-msgdb): Rewrite and define as an inline + function. + + * elmo-msgdb.el (elmo-msgdb-append): Use elmo-msgdb-make-index-return. + (elmo-msgdb-merge): New function. + (elmo-msgdb-make-index-return): Renamed from elmo-msgdb-make-index. + (elmo-msgdb-make-index): Rewrite. + + * elmo-version.el (elmo-version): Up to 2.11.6. + + * elmo-msgdb.el (elmo-msgdb-list-messages): If argument is a string, + use it as a the path for loading message entities. + + * elmo-dop.el (elmo-folder-status-dop): Use elmo-msgdb-list-messages. + +2003-08-05 Yuuichi Teranishi + + * elmo-filter.el (elmo-folder-set-message-modified): Set + message-modified slot of itself if it does not require target msgdb. + + * elmo-mime.el (elmo-mime-message-display): Display message entirely + if folder length is zero. + (elmo-mime-display-as-is): Ditto. + + * elmo-filter.el (elmo-folder-set-message-modified): Define. + + * elmo-multi.el (elmo-folder-set-message-modified): Ditto. + +2003-08-03 Hiroya Murata + + * elmo.el (elmo-folder-set-message-modified): New method. + (elmo-generic-folder-commit): Use it. + (elmo-folder-synchronize): Ditto. + + * elmo-pipe.el (elmo-folder-set-message-modified): Define. + (elmo-folder-commit): Remove duplicate definition. + +2003-08-02 Yuuichi Teranishi + + * elmo.el (elmo-folder-list-message-entities): Ignore killed-list. + +2003-08-02 Hiroya Murata + + * elmo.el (elmo-msgdb-load): Use elmo-msgdb-list-messages. + (elmo-strict-folder-diff): Ditto. + (elmo-folder-set-info-max-by-numdb): Simplify. + + * elmo-nntp.el (elmo-nntp-folder-msgdb-create): Use + elmo-msgdb-list-messages. + + * elmo-msgdb.el (elmo-msgdb-seen-save): Abolish. + (elmo-msgdb-list-flagged): Fixed problem when `flag' is `read'. + +2003-08-02 Yuuichi Teranishi + + * elmo.el (elmo-folder-list-messages): Treat killed-list only when + visible-only is non-nil. + (elmo-folder-confirm-appends): Changed message. + (elmo-folder-synchronize): Added argument disable-killed. + + * elmo-multi.el (elmo-folder-synchronize): Added argument + disable-killed. + + * elmo-pipe.el (elmo-folder-synchronize): Ditto. + + * elmo-version.el (elmo-version): Up to 2.11.5. + + * elmo-multi.el (elmo-folder-search): Use nil for 1st argument of + elmo-list-filter. + + * elmo-util.el (elmo-list-filter): Simplify. + + * elmo.el (elmo-generic-folder-commit): Use elmo-folder-list-messages. + (elmo-folder-set-info-max-by-numdb): Changed argument to number list. + (elmo-generic-folder-diff): Abolish argument. + (elmo-msgdb-load): Don't use number-alist. + + * elmo-filter.el (elmo-folder-diff): Abolish argument. + + * elmo-pipe.el (elmo-folder-diff): Ditto. + + * elmo-nmz.el (elmo-folder-diff): Ditto. + + * elmo-net.el (elmo-folder-diff): Ditto. + + * elmo-maildir.el (elmo-folder-diff): Ditto. + + * elmo-imap4.el (elmo-folder-diff-async): Ditto. + + * elmo-multi.el (elmo-folder-diff): Ditto + (elmo-multi-folder-diff): Rewrite. + +2003-08-02 Hiroya Murata + + * elmo-pipe.el (elmo-folder-msgdb): Define. + +2003-08-01 Yuuichi Teranishi + + * elmo.el (elmo-message-set-cached): Define as a method. + + * elmo-pipe.el (elmo-message-set-cached): Define. + (elmo-find-fetch-strategy): Ditto. + + * elmo-multi.el (elmo-message-set-cached): Define. + (elmo-find-fetch-strategy): Rewrite. + + * elmo-mime.el (elmo-mime-message-display): Use elmo-message-entity. + + * elmo-pipe.el (elmo-message-folder): Fixed definition. + +2003-07-30 Yuuichi Teranishi + + * elmo-msgdb.el (elmo-msgdb-list-messages): Use number of overviews + instead of number-alist. + + * elmo-localdir.el (elmo-folder-append-messages): Don't refer + mark nor message-id when msgdb of source folder is not loaded. + + * elmo.el (elmo-generic-folder-append-messages): Ditto. + + * elmo-maildir.el (elmo-folder-append-messages): Ditto. + +2003-07-29 Yuuichi Teranishi + + * elmo.el (elmo-folder-length): Don't require msgdb. + +2003-07-28 Yuuichi Teranishi + + * elmo.el (elmo-message-mark): Cause an error when empty folder. + (elmo-message-field): Ditto. + + * elmo-maildir.el (luna-define-class): Added slot `answered-locations'. + (elmo-map-folder-list-message-locations): Setup `answered-locations' + slot. + (elmo-map-folder-list-answereds): Define. + (elmo-maildir-list-location): Treat 'R' info. + (elmo-folder-msgdb-create): Treat flag-table. + (elmo-folder-append-messages): Save flag-table. + +2002-05-05 David Smith + + * elmo-imap4.el (elmo-imap4-folder-diff-plugged): + Use SELECT when elmo-imap4-use-select-to-update-status is t. + +2003-07-24 Hiroya Murata + + * elmo.el (elmo-generic-folder-append-messages): Fixed last change. + + * elmo-localdir.el (elmo-folder-append-messages): Set flag as + 'read when mark is null. + +2003-07-24 Yuuichi Teranishi + + * elmo-version.el (elmo-version): Up to 2.11.4. + 2003-07-23 Hiroya Murata * elmo-pipe.el (elmo-folder-unmark-answered): Define. diff --git a/elmo/elmo-dop.el b/elmo/elmo-dop.el index fda2f92..bbacd0a 100644 --- a/elmo/elmo-dop.el +++ b/elmo/elmo-dop.el @@ -286,13 +286,12 @@ FOLDER is the folder structure." ;;; Execute as subsutitute for plugged operation. (defun elmo-folder-status-dop (folder) - (let* ((number-alist (elmo-msgdb-number-load - (elmo-folder-msgdb-path folder))) - (number-list (mapcar 'car number-alist)) - (spool-folder (elmo-dop-spool-folder folder)) - spool-length - (i 0) - max-num) + (let ((number-list (elmo-msgdb-list-messages + (elmo-folder-msgdb-path folder))) + (spool-folder (elmo-dop-spool-folder folder)) + spool-length + (i 0) + max-num) (setq spool-length (or (car (if (elmo-folder-exists-p spool-folder) (elmo-folder-status spool-folder))) 0)) (setq max-num diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 296efb9..2ce03c0 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -77,6 +77,14 @@ (elmo-folder-set-msgdb-internal (elmo-filter-folder-target-internal folder) nil))) +(luna-define-method elmo-folder-set-message-modified ((folder + elmo-filter-folder) + modified) + (if (elmo-filter-folder-require-msgdb-internal folder) + (elmo-folder-set-message-modified-internal + (elmo-filter-folder-target-internal folder) modified) + (elmo-folder-set-message-modified-internal folder modified))) + (luna-define-method elmo-folder-commit :around ((folder elmo-filter-folder)) ;; Save target msgdb if it is used. (if (elmo-filter-folder-require-msgdb-internal folder) @@ -210,8 +218,7 @@ (lambda (x) (concat prefix x)) (elmo-folder-list-subfolders target one-level)))) -(luna-define-method elmo-folder-diff :around ((folder elmo-filter-folder) - &optional numbers) +(luna-define-method elmo-folder-diff :around ((folder elmo-filter-folder)) (let ((condition (elmo-filter-folder-condition-internal folder)) diff) (if (vectorp condition) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 3ab05a3..0a8c707 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -2370,6 +2370,10 @@ If optional argument REMOVE is non-nil, remove FLAG." (with-current-buffer (elmo-network-session-buffer session) (setq elmo-imap4-status-callback nil) (setq elmo-imap4-status-callback-data nil)) + (if elmo-imap4-use-select-to-update-status + (elmo-imap4-session-select-mailbox + session + (elmo-imap4-folder-mailbox-internal folder))) (setq response (elmo-imap4-send-command-wait session (list @@ -2397,8 +2401,7 @@ If optional argument REMOVE is non-nil, remove FLAG." (luna-define-method elmo-folder-diff-plugged ((folder elmo-imap4-folder)) (elmo-imap4-folder-diff-plugged folder)) -(luna-define-method elmo-folder-diff-async ((folder elmo-imap4-folder) - &optional number-alist) +(luna-define-method elmo-folder-diff-async ((folder elmo-imap4-folder)) (setq elmo-imap4-server-diff-async-callback elmo-folder-diff-async-callback) (setq elmo-imap4-server-diff-async-callback-data diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 4ed3d22..7deaf26 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -228,15 +228,17 @@ ((folder elmo-localdir-folder) src-folder numbers &optional same-number) (if (elmo-folder-message-file-p src-folder) - (let ((dir (elmo-localdir-folder-directory-internal folder)) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + (dir (elmo-localdir-folder-directory-internal folder)) (table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (succeeds numbers) (next-num (1+ (car (elmo-folder-status folder)))) mark flag id) (while numbers - (setq mark (elmo-message-mark src-folder (car numbers)) + (setq mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) flag (cond - ((null mark) nil) + ((null mark) 'read) ((member mark (elmo-msgdb-answered-marks)) 'answered) ;; @@ -248,9 +250,10 @@ (int-to-string (if same-number (car numbers) next-num)) dir)) - ;; src folder's msgdb is loaded. - (when (setq id (elmo-message-field src-folder (car numbers) - 'message-id)) + ;; save flag-table only when src folder's msgdb is loaded. + (when (setq id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id))) (elmo-flag-table-set table id flag)) (elmo-progress-notify 'elmo-folder-move-messages) (if (and (setq numbers (cdr numbers)) diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 151a232..8f61227 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -44,7 +44,9 @@ (eval-and-compile (luna-define-class elmo-maildir-folder (elmo-map-folder) - (directory unread-locations flagged-locations)) + (directory unread-locations + flagged-locations + answered-locations)) (luna-define-internal-accessors 'elmo-maildir-folder)) (luna-define-method elmo-folder-initialize ((folder @@ -89,38 +91,45 @@ LOCATION." (let* ((cur-dir (expand-file-name (or child-dir "cur") dir)) (cur (directory-files cur-dir nil "^[^.].*$" t)) - unread-locations flagged-locations seen flagged sym - locations) + unread-locations flagged-locations answered-locations + seen flagged answered sym locations) (setq locations (mapcar (lambda (x) (if (string-match "^\\([^:]+\\):\\([^:]+\\)$" x) (progn - (setq seen nil) + (setq seen nil answered nil flagged nil) (save-match-data (cond - ((string-match "S" (elmo-match-string 2 x)) - (setq seen t)) ((string-match "F" (elmo-match-string 2 x)) - (setq flagged t)))) + (setq flagged t)) + ((string-match "R" (elmo-match-string 2 x)) + (setq answered t)) + ((string-match "S" (elmo-match-string 2 x)) + (setq seen t)))) (setq sym (elmo-match-string 1 x)) - (unless seen (setq unread-locations - (cons sym unread-locations))) - (if flagged (setq flagged-locations - (cons sym flagged-locations))) + (cond + (flagged (setq flagged-locations + (cons sym flagged-locations))) + (answered (setq answered-locations + (cons sym answered-locations))) + (seen) + (t + (setq unread-locations (cons sym unread-locations)))) sym) x)) cur)) - (list locations unread-locations flagged-locations))) + (list locations unread-locations flagged-locations answered-locations))) (luna-define-method elmo-map-folder-list-message-locations ((folder elmo-maildir-folder)) (elmo-maildir-update-current folder) (let ((locs (elmo-maildir-list-location (elmo-maildir-folder-directory-internal folder)))) - ;; 0: locations, 1: unread-locations, 2: flagged-locations + ;; 0: locations, 1: unread-locs, 2: flagged-locs 3: answered-locs (elmo-maildir-folder-set-unread-locations-internal folder (nth 1 locs)) (elmo-maildir-folder-set-flagged-locations-internal folder (nth 2 locs)) + (elmo-maildir-folder-set-answered-locations-internal folder (nth 3 locs)) (nth 0 locs))) (luna-define-method elmo-map-folder-list-unreads @@ -131,40 +140,106 @@ LOCATION." ((folder elmo-maildir-folder)) (elmo-maildir-folder-flagged-locations-internal folder)) +(luna-define-method elmo-map-folder-list-answereds + ((folder elmo-maildir-folder)) + (elmo-maildir-folder-answered-locations-internal folder)) + (luna-define-method elmo-folder-msgdb-create ((folder elmo-maildir-folder) numbers flag-table) (let* ((unread-list (elmo-maildir-folder-unread-locations-internal folder)) (flagged-list (elmo-maildir-folder-flagged-locations-internal folder)) + (answered-list (elmo-maildir-folder-answered-locations-internal + folder)) (len (length numbers)) (i 0) - overview number-alist mark-alist entity - location pair mark) + overview number-alist mark-alist entity message-id flag + file location pair mark cache-status file-flag) (message "Creating msgdb...") - (dolist - (number numbers) + (dolist (number numbers) (setq location (elmo-map-message-location folder number)) (setq entity (elmo-msgdb-create-overview-entity-from-file number - (elmo-maildir-message-file-name folder location))) + (setq file + (elmo-maildir-message-file-name folder location)))) (when entity (setq overview - (elmo-msgdb-append-element overview entity)) - (setq number-alist + (elmo-msgdb-append-element overview entity) + number-alist (elmo-msgdb-number-add number-alist - (elmo-msgdb-overview-entity-get-number - entity) - (elmo-msgdb-overview-entity-get-id - entity))) - (cond - ((member location unread-list) - (setq mark elmo-msgdb-new-mark)) ; unread! + (elmo-message-entity-number entity) + (setq message-id + (elmo-message-entity-field + entity 'message-id))) + ;; Precede flag-table to file-info. + flag (elmo-flag-table-get flag-table message-id) + file-flag nil + mark nil) + (setq cache-status + (elmo-file-cache-status (elmo-file-cache-get message-id))) + + ;; Already flagged on filename (precede it to flag-table). + (cond ((member location flagged-list) - (setq mark elmo-msgdb-important-mark))) - (if (setq mark (or (elmo-msgdb-global-mark-get - (elmo-msgdb-overview-entity-get-id - entity)) - mark)) + (setq file-flag 'important + mark elmo-msgdb-important-mark)) + ((member location answered-list) + (setq file-flag 'answered + mark (elmo-msgdb-mark 'answered cache-status))) + ((member location unread-list) + (setq file-flag 'unread + mark (elmo-msgdb-mark 'unread cache-status))) + (t (setq file-flag 'read))) + + ;; Set mark according to flag-table if file status is unread or read. + (when (or (eq file-flag 'read) + (eq file-flag 'unread)) + ;; + (unless (eq 'read flag) + (setq mark (elmo-msgdb-mark flag cache-status 'new))) + ;; Update filename's info portion according to the flag-table. + (cond + ((and (or (eq flag 'important) + (setq mark (elmo-msgdb-global-mark-get + (elmo-message-entity-field + entity 'message-id)))) + (not (eq file-flag 'important))) + (elmo-maildir-set-mark file ?F) + ;; Delete from unread location list. + (elmo-maildir-folder-set-unread-locations-internal + folder + (delete location + (elmo-maildir-folder-unread-locations-internal + folder))) + ;; Append to flagged location list. + (elmo-maildir-folder-set-flagged-locations-internal + folder + (cons location + (elmo-maildir-folder-flagged-locations-internal + folder)))) + ((and (eq flag 'answered) + (not (eq file-flag 'answered))) + (elmo-maildir-set-mark file ?R) + ;; Delete from unread locations. + (elmo-maildir-folder-set-unread-locations-internal + folder + (delete location + (elmo-maildir-folder-unread-locations-internal folder))) + ;; Append to answered location list. + (elmo-maildir-folder-set-answered-locations-internal + folder + (cons location + (elmo-maildir-folder-answered-locations-internal folder)))) + ((and (eq flag 'read) + (not (eq file-flag 'read))) + (elmo-maildir-set-mark file ?S) + ;; Delete from unread locations. + (elmo-maildir-folder-set-unread-locations-internal + folder + (delete location + (elmo-maildir-folder-unread-locations-internal + folder)))))) + (if mark (setq mark-alist (elmo-msgdb-mark-append mark-alist @@ -408,11 +483,21 @@ file name for maildir directories." ((folder elmo-maildir-folder) src-folder numbers &optional same-number) (if (elmo-folder-message-file-p src-folder) - (let ((dir (elmo-maildir-folder-directory-internal folder)) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + (dir (elmo-maildir-folder-directory-internal folder)) + (table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (succeeds numbers) - filename) + filename mark flag id) (dolist (number numbers) - (setq filename (elmo-maildir-temporal-filename dir)) + (setq mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) + flag (cond + ((null mark) 'read) + ((member mark (elmo-msgdb-answered-marks)) + 'answered) + ((not (member mark (elmo-msgdb-unread-marks))) + 'read)) + filename (elmo-maildir-temporal-filename dir)) (elmo-copy-file (elmo-message-file-name src-folder number) filename) @@ -421,7 +506,14 @@ file name for maildir directories." (expand-file-name (concat "new/" (file-name-nondirectory filename)) dir)) + ;; src folder's msgdb is loaded. + (when (setq id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id))) + (elmo-flag-table-set table id flag)) (elmo-progress-notify 'elmo-folder-move-messages)) + (when (elmo-folder-persistent-p folder) + (elmo-flag-table-save (elmo-folder-msgdb-path folder) table)) succeeds) (luna-call-next-method))) @@ -448,8 +540,7 @@ file name for maildir directories." (file-directory-p (expand-file-name "cur" basedir)) (file-directory-p (expand-file-name "tmp" basedir))))) -(luna-define-method elmo-folder-diff ((folder elmo-maildir-folder) - &optional numbers) +(luna-define-method elmo-folder-diff ((folder elmo-maildir-folder)) (let* ((dir (elmo-maildir-folder-directory-internal folder)) (new-len (length (car (elmo-maildir-list-location dir "new")))) (cur-len (length (car (elmo-maildir-list-location dir "cur"))))) diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index 9efb463..0fa6fa0 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -224,11 +224,11 @@ Return non-nil if not entire message was fetched." (let (mime-display-header-hook ; Do nothing. (elmo-message-displaying t) entity strategy) - (setq entity (elmo-msgdb-overview-get-entity number - (elmo-folder-msgdb - folder))) - (setq strategy (elmo-find-fetch-strategy folder entity - ignore-cache)) + (unless (zerop (elmo-folder-length folder)) + (setq entity (elmo-message-entity folder number))) + (setq strategy (if entity (elmo-find-fetch-strategy folder entity + ignore-cache) + (elmo-make-fetch-strategy 'entire))) (mime-display-message (mime-open-entity (if (and strategy @@ -258,21 +258,23 @@ Return non-nil if cache is used." (elmo-folder-msgdb folder))) mime-display-header-hook ; Do nothing. cache-file strategy use-cache) - (setq cache-file (elmo-file-cache-get - (elmo-msgdb-overview-entity-get-id entity))) - (setq use-cache (and (elmo-message-use-cache-p folder number) - (eq (elmo-file-cache-status cache-file) 'entire))) + (when entity + (setq cache-file (elmo-file-cache-get + (elmo-msgdb-overview-entity-get-id entity))) + (setq use-cache (and (elmo-message-use-cache-p folder number) + (eq (elmo-file-cache-status cache-file) 'entire)))) (setq strategy (elmo-make-fetch-strategy - 'entire use-cache (elmo-message-use-cache-p folder number) - (elmo-file-cache-path - cache-file))) + 'entire use-cache + (elmo-message-use-cache-p folder number) + (elmo-file-cache-path cache-file))) (elmo-mime-display-as-is-internal (mime-open-entity 'elmo-buffer (elmo-make-mime-message-location folder number strategy rawbuf unread)) viewbuf nil keymap original-mode) - (elmo-fetch-strategy-use-cache strategy))) + (when strategy + (elmo-fetch-strategy-use-cache strategy)))) ;; Replacement of mime-display-message. (defun elmo-mime-display-as-is-internal (message diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 49f1b45..782215d 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -58,7 +58,6 @@ :type '(string :tag "Mark") :group 'elmo) -;; Not implemented yet. (defcustom elmo-msgdb-answered-cached-mark "&" "Mark for answered and cached message." :type '(string :tag "Mark") @@ -69,7 +68,7 @@ :type '(string :tag "Mark") :group 'elmo) -(defcustom elmo-msgdb-important-mark"$" +(defcustom elmo-msgdb-important-mark "$" "Mark for important message." :type '(string :tag "Mark") :group 'elmo) @@ -116,7 +115,6 @@ ;; LIST-OF-MARKS elmo-msgdb-unread-marks ;; LIST-OF-MARKS elmo-msgdb-answered-marks ;; LIST-OF-MARKS elmo-msgdb-uncached-marks -;; elmo-msgdb-seen-save DIR OBJ ;; elmo-msgdb-overview-save DIR OBJ ;; elmo-msgdb-message-entity MSGDB KEY @@ -182,9 +180,14 @@ (elmo-msgdb-make-index msgdb) msgdb)) -(defun elmo-msgdb-list-messages (msgdb) - "List message numbers in the MSGDB." - (mapcar 'car (elmo-msgdb-get-number-alist msgdb))) +(defun elmo-msgdb-list-messages (msgdb-or-path) + "Return a list of message numbers in the msgdb. +If MSGDB-OR-PATH is a msgdb structure, use it as a msgdb. +If argument is a string, use it as a path to load message entities." + (mapcar 'elmo-msgdb-overview-entity-get-number + (if (stringp msgdb-or-path) + (elmo-msgdb-overview-load msgdb-or-path) + (elmo-msgdb-get-overview msgdb-or-path)))) (defsubst elmo-msgdb-get-mark (msgdb number) "Get mark string from MSGDB which corresponds to the message with NUMBER." @@ -395,12 +398,41 @@ FLAG is a symbol which is one of the following: (nconc (car msgdb) (car msgdb-append)) (nconc (cadr msgdb) (cadr msgdb-append)) (nconc (caddr msgdb) (caddr msgdb-append)) - (elmo-msgdb-make-index + (elmo-msgdb-make-index-return msgdb (elmo-msgdb-get-overview msgdb-append) (elmo-msgdb-get-mark-alist msgdb-append)) (nth 4 msgdb))) +(defun elmo-msgdb-merge (folder msgdb-merge) + "Return a list of messages which have duplicated message-id." + (let (msgdb duplicates) + (setq msgdb (or (elmo-folder-msgdb-internal folder) + (elmo-make-msgdb nil nil nil + (elmo-folder-msgdb-path folder)))) + (elmo-msgdb-set-overview + msgdb + (nconc (elmo-msgdb-get-overview msgdb) + (elmo-msgdb-get-overview msgdb-merge))) + (elmo-msgdb-set-number-alist + msgdb + (nconc (elmo-msgdb-get-number-alist msgdb) + (elmo-msgdb-get-number-alist msgdb-merge))) + (elmo-msgdb-set-mark-alist + msgdb + (nconc (elmo-msgdb-get-mark-alist msgdb) + (elmo-msgdb-get-mark-alist msgdb-merge))) + (setq duplicates (elmo-msgdb-make-index + msgdb + (elmo-msgdb-get-overview msgdb-merge) + (elmo-msgdb-get-mark-alist msgdb-merge))) + (elmo-msgdb-set-path + msgdb + (or (elmo-msgdb-get-path msgdb) + (elmo-msgdb-get-path msgdb-merge))) + (elmo-folder-set-msgdb-internal folder msgdb) + duplicates)) + (defsubst elmo-msgdb-clear (&optional msgdb) (if msgdb (list @@ -702,11 +734,6 @@ header separator." elmo-msgdb-answered-cached-mark elmo-msgdb-answered-uncached-mark))))) -(defsubst elmo-msgdb-seen-save (dir obj) - (elmo-object-save - (expand-file-name elmo-msgdb-seen-filename dir) - obj)) - (defsubst elmo-msgdb-overview-save (dir overview) (elmo-object-save (expand-file-name elmo-msgdb-overview-filename dir) @@ -989,7 +1016,7 @@ Return CONDITION itself if no entity exists in msgdb." (references (aref (cdr entity) 1)) (size (aref (cdr entity) 7)) (t (cdr (assoc (symbol-name field) (aref (cdr entity) 8))))))) - (if decode + (if (and decode (memq field '(from subject))) (elmo-msgdb-get-decoded-cache field-value) field-value)))) @@ -1237,7 +1264,7 @@ Header region is supposed to be narrowed." (and (setq number (elmo-msgdb-overview-entity-get-number entity)) (elmo-clear-hash-val (format "#%d" number) mhash))))) -(defun elmo-msgdb-make-index (msgdb &optional overview mark-alist) +(defun elmo-msgdb-make-index-return (msgdb &optional overview mark-alist) "Append OVERVIEW and MARK-ALIST to the index of MSGDB. If OVERVIEW and MARK-ALIST are nil, make index for current MSGDB. Return the updated INDEX." @@ -1269,6 +1296,44 @@ Return the updated INDEX." (elmo-msgdb-set-index msgdb index) index))) +(defun elmo-msgdb-make-index (msgdb &optional overview mark-alist) + "Append OVERVIEW and MARK-ALIST to the index of MSGDB. +If OVERVIEW and MARK-ALIST are nil, make index for current MSGDB. +Return a list of message numbers which have duplicated message-ids." + (when msgdb + (let* ((overview (or overview (elmo-msgdb-get-overview msgdb))) + (mark-alist (or mark-alist (elmo-msgdb-get-mark-alist msgdb))) + (index (elmo-msgdb-get-index msgdb)) + (ehash (or (car index) ;; append + (elmo-make-hash (length overview)))) + (mhash (or (cdr index) ;; append + (elmo-make-hash (length overview)))) + duplicates) + (while overview + ;; key is message-id + (if (elmo-get-hash-val (caar overview) ehash) ; duplicated. + (setq duplicates (cons + (elmo-msgdb-overview-entity-get-number + (car overview)) + duplicates))) + (if (caar overview) + (elmo-set-hash-val (caar overview) (car overview) ehash)) + ;; key is number + (elmo-set-hash-val + (format "#%d" + (elmo-msgdb-overview-entity-get-number (car overview))) + (car overview) ehash) + (setq overview (cdr overview))) + (while mark-alist + ;; key is number + (elmo-set-hash-val + (format "#%d" (car (car mark-alist))) + (car mark-alist) mhash) + (setq mark-alist (cdr mark-alist))) + (setq index (or index (cons ehash mhash))) + (elmo-msgdb-set-index msgdb index) + duplicates))) + (defsubst elmo-folder-get-info (folder &optional hashtb) (elmo-get-hash-val folder (or hashtb elmo-folder-info-hashtb))) @@ -1327,10 +1392,10 @@ Return the updated INDEX." (list elmo-msgdb-important-mark)))))) (when mark-regexp (if (eq flag 'read) - (dolist (number (elmo-msgdb-get-number-alist msgdb)) - (unless (string-match mark-regexp (elmo-msgdb-get-mark - msgdb number)) - (setq matched (cons number matched)))) + (dolist (number (elmo-msgdb-list-messages msgdb)) + (let ((mark (elmo-msgdb-get-mark msgdb number))) + (unless (and mark (string-match mark-regexp mark)) + (setq matched (cons number matched))))) (dolist (elem (elmo-msgdb-get-mark-alist msgdb)) (if (string-match mark-regexp (cadr elem)) (setq matched (cons (car elem) matched)))))) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 55a6caf..78c5d84 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -43,7 +43,7 @@ (defmacro elmo-multi-real-folder-number (folder number) "Returns a cons cell of real FOLDER and NUMBER." - (` (cons (nth (- + (` (cons (nth (- (/ (, number) (elmo-multi-folder-divide-number-internal (, folder))) 1) (elmo-multi-folder-children-internal (, folder))) @@ -85,10 +85,12 @@ (elmo-folder-set-msgdb-internal fld nil))) (luna-define-method elmo-folder-synchronize ((folder elmo-multi-folder) - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) (dolist (fld (elmo-multi-folder-children-internal folder)) - (elmo-folder-synchronize fld ignore-msgdb no-check)) + (elmo-folder-synchronize fld disable-killed ignore-msgdb no-check)) 0) (luna-define-method elmo-folder-expand-msgdb-path ((folder @@ -129,6 +131,24 @@ (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1) (elmo-multi-folder-children-internal folder))) +(luna-define-method elmo-message-cached-p ((folder elmo-multi-folder) number) + (let ((pair (elmo-multi-real-folder-number folder number))) + (elmo-message-cached-p (car pair) (cdr pair)))) + +(luna-define-method elmo-message-set-cached ((folder elmo-multi-folder) + number cached) + (let ((pair (elmo-multi-real-folder-number folder number))) + (elmo-message-set-cached (car pair) (cdr pair) cached))) + +(luna-define-method elmo-find-fetch-strategy + ((folder elmo-multi-folder) entity &optional ignore-cache) + (let ((pair (elmo-multi-real-folder-number + folder + (elmo-message-entity-number entity)))) + (elmo-find-fetch-strategy + (car pair) + (elmo-message-entity (car pair) (cdr pair)) ignore-cache))) + (luna-define-method elmo-message-entity ((folder elmo-multi-folder) key) (cond ((numberp key) @@ -154,6 +174,12 @@ (setq children (cdr children))) match)))) +(luna-define-method elmo-message-entity-parent ((folder + elmo-multi-folder) entity) + (elmo-message-entity + folder + (elmo-message-entity-field entity 'references))) + (luna-define-method elmo-message-field ((folder elmo-multi-folder) number field) (let ((pair (elmo-multi-real-folder-number folder number))) @@ -191,22 +217,6 @@ (dolist (child (elmo-multi-folder-children-internal folder)) (elmo-folder-process-crosspost child))) -(defsubst elmo-multi-find-fetch-strategy (folder entity ignore-cache) - (if entity - (let ((pair (elmo-multi-real-folder-number - folder - (elmo-msgdb-overview-entity-get-number entity))) - (new-entity (elmo-msgdb-copy-overview-entity entity))) - (setq new-entity - (elmo-msgdb-overview-entity-set-number new-entity (cdr pair))) - (elmo-find-fetch-strategy (car pair) new-entity ignore-cache)) - (elmo-make-fetch-strategy 'entire))) - -(luna-define-method elmo-find-fetch-strategy - ((folder elmo-multi-folder) - entity &optional ignore-cache) - (elmo-multi-find-fetch-strategy folder entity ignore-cache)) - (luna-define-method elmo-message-fetch ((folder elmo-multi-folder) number strategy &optional section outbuf unseen) @@ -237,27 +247,30 @@ (setq cur-number (+ 1 cur-number))) t)) -(luna-define-method elmo-folder-diff ((folder elmo-multi-folder) - &optional numbers) - (elmo-multi-folder-diff folder numbers)) +(luna-define-method elmo-folder-diff ((folder elmo-multi-folder)) + (elmo-multi-folder-diff folder)) -(defun elmo-multi-folder-diff (folder numbers) +(defun elmo-multi-folder-diff (folder) (let ((flds (elmo-multi-folder-children-internal folder)) - (num-list (and numbers (elmo-multi-split-numbers folder numbers))) - (unsync 0) - (messages 0) - diffs) + (news 0) + (unreads 0) + (alls 0) + no-unreads diff) (while flds - (setq diffs (nconc diffs (list (elmo-folder-diff (car flds) - (car num-list))))) + (setq diff (elmo-folder-diff (car flds))) + (cond + ((consp (cdr diff)) ; (new unread all) + (setq news (+ news (nth 0 diff)) + unreads (+ unreads (nth 1 diff)) + alls (+ alls (nth 2 diff)))) + (t + (setq no-unreads t) + (setq news (+ news (car diff)) + alls (+ alls (cdr diff))))) (setq flds (cdr flds))) - (while diffs - (and (car (car diffs)) - (setq unsync (+ unsync (car (car diffs))))) - (setq messages (+ messages (cdr (car diffs)))) - (setq diffs (cdr diffs))) - (elmo-folder-set-info-hashtb folder nil messages) - (cons unsync messages))) + (if no-unreads + (cons news alls) + (list news unreads alls)))) (luna-define-method elmo-folder-list-unreads ((folder elmo-multi-folder)) (let ((cur-number 0) @@ -360,37 +373,28 @@ t))) (luna-define-method elmo-folder-search ((folder elmo-multi-folder) - condition &optional numlist) + condition &optional numbers) (let* ((flds (elmo-multi-folder-children-internal folder)) (cur-number 0) - numlist-list cur-numlist ; for filtered search. - ret-val) - (if numlist - (setq numlist-list - (elmo-multi-split-numbers folder numlist t))) + numlist + matches) + (setq numbers (or numbers + (elmo-folder-list-messages folder))) (while flds (setq cur-number (+ cur-number 1)) - (when numlist - (setq cur-numlist (car numlist-list)) - (if (null cur-numlist) - ;; t means filter all. - (setq cur-numlist t))) - (setq ret-val (append - ret-val - (elmo-list-filter - cur-numlist - (mapcar - (function - (lambda (x) - (+ - (* (elmo-multi-folder-divide-number-internal - folder) cur-number) x))) - (elmo-folder-search - (car flds) condition))))) - (when numlist - (setq numlist-list (cdr numlist-list))) + (setq matches (append matches + (mapcar + (function + (lambda (x) + (+ + (* (elmo-multi-folder-divide-number-internal + folder) + cur-number) + x))) + (elmo-folder-search + (car flds) condition)))) (setq flds (cdr flds))) - ret-val)) + (elmo-list-filter numbers matches))) (luna-define-method elmo-message-use-cache-p ((folder elmo-multi-folder) number) @@ -517,6 +521,12 @@ (elmo-folder-list-flagged child flag in-msgdb))))) numbers)) +(luna-define-method elmo-folder-set-message-modified ((folder + elmo-multi-folder) + modified) + (dolist (child (elmo-multi-folder-children-internal folder)) + (elmo-folder-set-message-modified child modified))) + (luna-define-method elmo-folder-commit ((folder elmo-multi-folder)) (dolist (child (elmo-multi-folder-children-internal folder)) (elmo-folder-commit child))) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index 06c661e..b8c8577 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -385,9 +385,7 @@ Returned value is searched from `elmo-network-stream-type-alist'." (elmo-delete-if (lambda (number) (memq number deleting)) ;; current number-list. - (mapcar - 'car - (elmo-msgdb-get-number-alist (elmo-folder-msgdb folder)))) + (elmo-msgdb-list-messages (elmo-folder-msgdb folder))) ;; append appending messages (mapcar (lambda (x) (* -1 x)) (elmo-dop-spool-folder-list-messages folder)))) @@ -598,8 +596,7 @@ Returned value is searched from `elmo-network-stream-type-alist'." (if (elmo-folder-plugged-p folder) (elmo-folder-send folder 'elmo-folder-check-plugged))) -(luna-define-method elmo-folder-diff :around ((folder elmo-net-folder) - &optional numbers) +(luna-define-method elmo-folder-diff :around ((folder elmo-net-folder)) (if (and (elmo-folder-use-flag-p folder) (elmo-folder-plugged-p folder)) (elmo-folder-send folder 'elmo-folder-diff-plugged) diff --git a/elmo/elmo-nmz.el b/elmo/elmo-nmz.el index 59fe128..4469b7f 100644 --- a/elmo/elmo-nmz.el +++ b/elmo/elmo-nmz.el @@ -167,8 +167,7 @@ If the value is a list, all elements are used as index paths for namazu." ((folder elmo-nmz-folder)) t) -(luna-define-method elmo-folder-diff ((folder elmo-nmz-folder) - &optional numbers) +(luna-define-method elmo-folder-diff ((folder elmo-nmz-folder)) (cons nil nil)) (luna-define-method elmo-folder-message-make-temp-files ((folder diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index f4fecd5..810da85 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -871,9 +871,7 @@ Don't cache if nil.") (elmo-folder-killed-list-internal folder) (car (elmo-list-diff numbers - (mapcar 'car - (elmo-msgdb-get-number-alist - ret-val)))))) + (elmo-msgdb-list-messages ret-val))))) ;; If there are canceled messages, overviews are not obtained ;; to max-number(inn 2.3?). (when (and (elmo-nntp-max-number-precedes-list-active-p) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 8c3aa2e..8b645c8 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -105,11 +105,13 @@ (defun elmo-pipe-drain (src dst &optional copy ignore-list) "Move or copy all messages of SRC to DST." - (let ((elmo-inhibit-number-mapping (not copy)) ; No need to use UIDL + (let ((elmo-inhibit-number-mapping (and (eq (elmo-folder-type-internal + src) 'pop3) + (not copy))) ; No need to use UIDL msgs len) (message "Checking %s..." (elmo-folder-name-internal src)) ;; Warnnig: some function requires msgdb - ;; but elmo-folder-open-internal do not load msgdb. + ;; but elmo-folder-open-internal do not load msgdb. (elmo-folder-open-internal src) (setq msgs (elmo-pipe-folder-list-target-messages src ignore-list) len (length msgs)) @@ -120,8 +122,7 @@ "Copying messages..." "Moving messages..."))) (unwind-protect - (elmo-folder-move-messages src msgs dst - nil nil copy) + (elmo-folder-move-messages src msgs dst copy) (elmo-progress-clear 'elmo-folder-move-messages)) (when (and copy msgs) (setq ignore-list (elmo-number-set-append-list ignore-list @@ -148,12 +149,20 @@ (expand-file-name "pipe" elmo-msgdb-directory))) copied-list)) +(luna-define-method elmo-folder-msgdb ((folder elmo-pipe-folder)) + (elmo-folder-msgdb (elmo-pipe-folder-dst-internal folder))) + (luna-define-method elmo-folder-open-internal ((folder elmo-pipe-folder)) (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder))) (luna-define-method elmo-folder-close-internal ((folder elmo-pipe-folder)) (elmo-folder-close-internal(elmo-pipe-folder-dst-internal folder))) +(luna-define-method elmo-folder-set-message-modified + ((folder elmo-pipe-folder) modified) + (elmo-folder-set-message-modified-internal + (elmo-pipe-folder-dst-internal folder) modified)) + (luna-define-method elmo-folder-list-messages ((folder elmo-pipe-folder) &optional visible-only in-msgdb) ;; Use target folder's killed-list in the pipe folder. @@ -169,7 +178,7 @@ (luna-define-method elmo-folder-list-answereds ((folder elmo-pipe-folder)) (elmo-folder-list-answereds (elmo-pipe-folder-dst-internal folder))) -(luna-define-method elmo-folder-status ((folder elmo-pipe-folder)) +(luna-define-method elmo-folder-diff ((folder elmo-pipe-folder)) (elmo-folder-open-internal (elmo-pipe-folder-src-internal folder)) (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder)) (let* ((elmo-inhibit-number-mapping @@ -177,10 +186,14 @@ (src-length (length (elmo-pipe-folder-list-target-messages (elmo-pipe-folder-src-internal folder) (elmo-pipe-folder-copied-list-load folder)))) - (dst-list (elmo-folder-list-messages - (elmo-pipe-folder-dst-internal folder)))) - (prog1 (cons (+ src-length (elmo-max-of-list dst-list)) - (+ src-length (length dst-list))) + (dst-diff (elmo-folder-diff (elmo-pipe-folder-dst-internal folder)))) + (prog1 + (cond + ((consp (cdr dst-diff)) ; new unread all + (mapcar (lambda (number) (+ number src-length)) dst-diff)) + (t + (cons (+ (car dst-diff) src-length) + (+ (cdr dst-diff) src-length)))) ;; No save. (elmo-folder-close-internal (elmo-pipe-folder-src-internal folder)) (elmo-folder-close-internal (elmo-pipe-folder-dst-internal folder))))) @@ -320,12 +333,10 @@ (elmo-pipe-folder-dst-internal new-folder)) (elmo-msgdb-rename-path folder new-folder))) -(luna-define-method elmo-folder-commit ((folder elmo-pipe-folder)) - (elmo-folder-commit - (elmo-pipe-folder-dst-internal folder))) - (luna-define-method elmo-folder-synchronize ((folder elmo-pipe-folder) - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) (let ((src-folder (elmo-pipe-folder-src-internal folder)) (dst-folder (elmo-pipe-folder-dst-internal folder))) @@ -340,7 +351,8 @@ (elmo-pipe-folder-copied-list-load folder))) (elmo-pipe-drain src-folder dst-folder)))) (elmo-folder-synchronize - (elmo-pipe-folder-dst-internal folder) ignore-msgdb no-check)) + (elmo-pipe-folder-dst-internal folder) + disable-killed ignore-msgdb no-check)) (luna-define-method elmo-folder-list-flagged ((folder elmo-pipe-folder) flag @@ -366,10 +378,23 @@ number field)) +(luna-define-method elmo-message-set-cached ((folder elmo-pipe-folder) + number cached) + (elmo-message-set-cached (elmo-pipe-folder-dst-internal folder) + number cached)) + +(luna-define-method elmo-find-fetch-strategy + ((folder elmo-pipe-folder) entity &optional ignore-cache) + (elmo-find-fetch-strategy (elmo-pipe-folder-dst-internal folder) + (elmo-message-entity + (elmo-pipe-folder-dst-internal folder) + (elmo-message-entity-number entity)) + ignore-cache)) + (luna-define-method elmo-message-entity ((folder elmo-pipe-folder) key) (elmo-message-entity (elmo-pipe-folder-dst-internal folder) key)) -(luna-define-method elmo-message-folder ((folder elmo-multi-folder) +(luna-define-method elmo-message-folder ((folder elmo-pipe-folder) number) (elmo-pipe-folder-dst-internal folder)) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 201c670..8345095 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -914,13 +914,13 @@ If IF-EXISTS is `any-exists', get BIFF session or normal session if exists." (error "Deleting message failed"))) (error "Deleting message failed"))))) -(luna-define-method elmo-folder-delete-messages-plugged - ((folder elmo-pop3-folder) msgs) +(luna-define-method elmo-folder-delete-messages-plugged ((folder + elmo-pop3-folder) + msgs) (let ((loc-alist (elmo-pop3-folder-location-alist-internal folder)) (process (elmo-network-session-process-internal (elmo-pop3-get-session folder)))) - (mapcar '(lambda (msg) (elmo-pop3-delete-msg - process msg loc-alist)) + (mapcar '(lambda (msg) (elmo-pop3-delete-msg process msg loc-alist)) msgs))) (luna-define-method elmo-message-use-cache-p ((folder elmo-pop3-folder) number) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 413aaa9..d63c538 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -755,14 +755,8 @@ the directory becomes empty after deletion." )))) (defun elmo-list-filter (l1 l2) - "L1 is filter." - (if (eq l1 t) - ;; t means filter all. - nil - (if l1 - (elmo-delete-if (lambda (x) (not (memq x l1))) l2) - ;; filter is nil - l2))) + "Rerurn a list from L2 in which each element is a member of L1." + (elmo-delete-if (lambda (x) (not (memq x l1))) l2)) (defsubst elmo-list-delete-if-smaller (list number) (let ((ret-val (copy-sequence list))) diff --git a/elmo/elmo-version.el b/elmo/elmo-version.el index 391984c..8aab3fe 100644 --- a/elmo/elmo-version.el +++ b/elmo/elmo-version.el @@ -40,7 +40,7 @@ ;; product-define in the first place (product-provide 'elmo-version ;; Don't forget to check `wl-version.el' and Info. - (product-define "ELMO" nil '(2 11 3))) + (product-define "ELMO" nil '(2 11 9))) ;; set version-string (product-version-as-string 'elmo-version) diff --git a/elmo/elmo.el b/elmo/elmo.el index 7392cdb..241cfdd 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -156,6 +156,7 @@ If optional argument NON-PERSISTENT is non-nil, the folder msgdb is not saved." (or (elmo-folder-msgdb-internal folder) (elmo-folder-set-msgdb-internal folder (elmo-msgdb-load folder)))) + (luna-define-generic elmo-folder-open (folder &optional load-msgdb) "Open and setup (load saved status) FOLDER. If optional LOAD-MSGDB is non-nil, msgdb is loaded. @@ -192,10 +193,8 @@ If optional KEEP-KILLED is non-nil, killed-list is not cleared.") (luna-define-generic elmo-folder-use-flag-p (folder) "Returns t if FOLDER treats unread/important flag itself.") -(luna-define-generic elmo-folder-diff (folder &optional numbers) +(luna-define-generic elmo-folder-diff (folder) "Get diff of FOLDER. -If optional NUMBERS is set, it is used as current NUMBERS. -Otherwise, saved status for folder is used for comparison. Return value is cons cell or list: - a cons cell (new . all) - a list (new unread all)") @@ -206,6 +205,12 @@ Return value is cons cell or list: (luna-define-generic elmo-folder-reserve-status-p (folder) "If non-nil, the folder should not close folder after `elmo-folder-status'.") +(luna-define-generic elmo-folder-set-message-modified (folder modified) + "Set FOLDER as modified.") +(luna-define-method elmo-folder-set-message-modified ((folder elmo-folder) + modified) + (elmo-folder-set-message-modified-internal folder modified)) + (luna-define-generic elmo-folder-list-messages (folder &optional visible-only in-msgdb) "Return a list of message numbers contained in FOLDER. @@ -216,12 +221,14 @@ If second optional IN-MSGDB is non-nil, only messages in the msgdb are listed.") (let ((list (if in-msgdb t (elmo-folder-list-messages-internal folder visible-only)))) - (elmo-living-messages - (if (listp list) - list - ;; Use current list. - (elmo-msgdb-list-messages (elmo-folder-msgdb folder))) - (elmo-folder-killed-list-internal folder)))) + (setq list + (if (listp list) + list + ;; Use current list. + (elmo-msgdb-list-messages (elmo-folder-msgdb folder)))) + (if visible-only + (elmo-living-messages list (elmo-folder-killed-list-internal folder)) + list))) (luna-define-generic elmo-folder-list-unreads (folder) "Return a list of unread message numbers contained in FOLDER.") @@ -620,12 +627,8 @@ FIELD is a symbol of the field name.") (luna-define-generic elmo-folder-process-crosspost (folder) "Process crosspost for FOLDER. -If NUMBER-ALIST is set, it is used as number-alist. Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") -(luna-define-generic elmo-folder-append-msgdb (folder append-msgdb) - "Append APPEND-MSGDB to the current msgdb of the folder.") - (luna-define-generic elmo-folder-newsgroups (folder) "Return list of newsgroup name of FOLDER.") @@ -681,9 +684,8 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") (elmo-msgdb-get-number-alist (elmo-folder-msgdb folder))) (elmo-folder-set-info-max-by-numdb folder - (elmo-msgdb-get-number-alist - (elmo-folder-msgdb folder))) - (elmo-folder-set-message-modified-internal folder nil) + (elmo-folder-list-messages folder nil 'in-msgdb)) + (elmo-folder-set-message-modified folder nil) (elmo-msgdb-killed-list-save (elmo-folder-msgdb-path folder) (elmo-folder-killed-list-internal folder))) @@ -886,14 +888,13 @@ NUMBERS is a list of message numbers, messages are searched from the list." (list new unread numbers max) elmo-folder-info-hashtb))) -(defun elmo-folder-set-info-max-by-numdb (folder msgdb-number) +(defun elmo-folder-set-info-max-by-numdb (folder numbers) "Set FOLDER info by MSGDB-NUMBER in msgdb." - (let ((num-db (sort (mapcar 'car msgdb-number) '<))) - (elmo-folder-set-info-hashtb - folder - (or (nth (max 0 (1- (length num-db))) num-db) 0) - nil ;;(length num-db) - ))) + (elmo-folder-set-info-hashtb + folder + (or (car (sort numbers '>)) 0) + nil ;;(length num-db) + )) (defun elmo-folder-get-info-max (folder) "Return max number of FODLER from folder info." @@ -938,17 +939,13 @@ NUMBERS is a list of message numbers, messages are searched from the list." (defsubst elmo-strict-folder-diff (folder) "Return folder diff information strictly from FOLDER." - (let* ((dir (elmo-folder-msgdb-path folder)) - (nalist (elmo-msgdb-get-number-alist (elmo-folder-msgdb folder))) - (in-db (sort (mapcar 'car nalist) '<)) - (in-folder (elmo-folder-list-messages folder)) - append-list delete-list diff) + (let ((in-db (sort (elmo-msgdb-list-messages (elmo-folder-msgdb folder)) + '<)) + (in-folder (elmo-folder-list-messages folder)) + append-list delete-list diff) (cons (if (equal in-folder in-db) 0 - (setq diff (elmo-list-diff - in-folder in-db - nil - )) + (setq diff (elmo-list-diff in-folder in-db nil)) (setq append-list (car diff)) (setq delete-list (cadr diff)) (if append-list @@ -958,11 +955,10 @@ NUMBERS is a list of message numbers, messages are searched from the list." 0))) (length in-folder)))) -(luna-define-method elmo-folder-diff ((folder elmo-folder) - &optional numbers) - (elmo-generic-folder-diff folder numbers)) +(luna-define-method elmo-folder-diff ((folder elmo-folder)) + (elmo-generic-folder-diff folder)) -(defun elmo-generic-folder-diff (folder numbers) +(defun elmo-generic-folder-diff (folder) (if (elmo-string-match-member (elmo-folder-name-internal folder) elmo-strict-diff-folder-list) (elmo-strict-folder-diff folder) @@ -971,19 +967,15 @@ NUMBERS is a list of message numbers, messages are searched from the list." (in-db t) unsync messages in-db-max) - (if numbers - (setq in-db-max (or (nth (max 0 (1- (length numbers))) numbers) - 0)) - (if (not cached-in-db-max) - (let ((number-list (mapcar 'car - (elmo-msgdb-number-load - (elmo-folder-msgdb-path folder))))) - ;; No info-cache. - (setq in-db (sort number-list '<)) - (setq in-db-max (or (nth (max 0 (1- (length in-db))) in-db) - 0)) - (elmo-folder-set-info-hashtb folder in-db-max nil)) - (setq in-db-max cached-in-db-max))) + (if (not cached-in-db-max) + (let ((number-list (elmo-folder-list-messages folder + nil 'in-msgdb))) + ;; No info-cache. + (setq in-db (sort number-list '<)) + (setq in-db-max (or (nth (max 0 (1- (length in-db))) in-db) + 0)) + (elmo-folder-set-info-hashtb folder in-db-max nil)) + (setq in-db-max cached-in-db-max)) (setq unsync (if (and in-db (car in-folder)) (- (car in-folder) in-db-max) (if (and in-folder (null in-db)) @@ -1019,26 +1011,29 @@ NUMBERS is a list of message numbers, messages are searched from the list." (defun elmo-generic-folder-append-messages (folder src-folder numbers same-number) - (let (unseen table flag mark - succeed-numbers failure cache) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + unseen table flag mark + succeed-numbers failure cache id) (setq table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (with-temp-buffer (set-buffer-multibyte nil) (while numbers (setq failure nil - mark (elmo-message-mark src-folder (car numbers)) - flag (cond - ((null mark) nil) - ((member mark (elmo-msgdb-answered-marks)) - 'answered) - ;; - ((not (member mark (elmo-msgdb-unread-marks))) - 'read))) + id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id)) + mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) + flag (and id + (cond + ((null mark) 'read) + ((member mark (elmo-msgdb-answered-marks)) + 'answered) + ;; + ((not (member mark (elmo-msgdb-unread-marks))) + 'read)))) (condition-case nil - (setq cache (elmo-file-cache-get - (elmo-message-field src-folder - (car numbers) - 'message-id)) + (setq cache (elmo-file-cache-get id) failure (not (and @@ -1065,12 +1060,8 @@ NUMBERS is a list of message numbers, messages are searched from the list." (error (setq failure t))) ;; FETCH & APPEND finished (unless failure - (when flag - (elmo-flag-table-set table - (elmo-message-field - src-folder (car numbers) - 'message-id) - flag)) + (when id + (elmo-flag-table-set table id flag)) (setq succeed-numbers (cons (car numbers) succeed-numbers))) (elmo-progress-notify 'elmo-folder-move-messages) (setq numbers (cdr numbers))) @@ -1080,11 +1071,9 @@ NUMBERS is a list of message numbers, messages are searched from the list." ;; Arguments should be reduced. (defun elmo-folder-move-messages (src-folder msgs dst-folder - &optional msgdb - no-delete-info + &optional no-delete - same-number - save-unread) + same-number) (save-excursion (let* ((messages msgs) (elmo-inhibit-display-retrieval-progress t) @@ -1131,18 +1120,27 @@ NUMBERS is a list of message numbers, messages are searched from the list." folder (elmo-folder-expand-msgdb-path folder)))) +(luna-define-generic elmo-message-cached-p (folder number) + "Return non-nil if the message is cached.") + +(luna-define-method elmo-message-cached-p ((folder elmo-folder) number) + (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number)) + (defun elmo-message-accessible-p (folder number) "Get accessibility of the message. Return non-nil when message is accessible." (or (elmo-folder-plugged-p folder) (elmo-folder-local-p folder) - (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number))) + (elmo-message-cached-p folder number))) -(defun elmo-message-set-cached (folder number cached) +(luna-define-generic elmo-message-set-cached (folder number cached) "Set cache status of the message in the msgdb. FOLDER is the ELMO folder structure. NUMBER is a number of the message. -If CACHED is t, message is set as cached." +If CACHED is t, message is set as cached.") + +(luna-define-method elmo-message-set-cached ((folder elmo-folder) + number cached) (when (elmo-msgdb-set-cached (elmo-folder-msgdb folder) number cached @@ -1180,7 +1178,7 @@ ENTITY is the message-entity to get the parent.") ;; List all message entities in the FOLDER. (mapcar (lambda (number) (elmo-message-entity folder number)) - (elmo-folder-list-messages folder t t))) + (elmo-folder-list-messages folder nil t))) ; XXX killed-list is not used. (defmacro elmo-folder-do-each-message-entity (spec &rest form) "Iterator for message entity in the folder. @@ -1225,6 +1223,35 @@ Return a list of numbers (`new' `unread' `answered')") (incf answered)))) (list new unreads answered))) +(luna-define-generic elmo-message-flags (folder number) + "Return a list of flags. +FOLDER is a ELMO folder structure. +NUMBER is a number of the message.") + +(luna-define-method elmo-message-flags ((folder elmo-folder) number) + ;; This is a provisional implement. + (let ((mark (elmo-message-mark folder number))) + (append + (and (string= mark elmo-msgdb-new-mark) + '(new)) + (and (string= mark elmo-msgdb-important-mark) + '(important)) + (and (member mark (elmo-msgdb-unread-marks)) + '(unread)) + (and (member mark (elmo-msgdb-answered-marks)) + '(answered))))) + +(defsubst elmo-message-flagged-p (folder number flag) + "Return non-nil if the message is set FLAG. +FOLDER is a ELMO folder structure. +NUMBER is a message number to test." + (let ((cur-flags (elmo-message-flags folder number))) + (case flag + (read + (not (memq 'unread cur-flags))) + (t + (memq flag cur-flags))))) + (defun elmo-message-set-flag (folder number flag) "Set message flag. FOLDER is a ELMO folder structure. @@ -1255,6 +1282,8 @@ FOLDER is the ELMO folder structure. NUMBER is a number of the message.") (luna-define-method elmo-message-mark ((folder elmo-folder) number) + (when (zerop (elmo-folder-length folder)) + (error "Cannot treat this folder correctly.")) (elmo-msgdb-get-mark (elmo-folder-msgdb folder) number)) (luna-define-generic elmo-message-field (folder number field) @@ -1264,6 +1293,8 @@ NUMBER is a number of the message. FIELD is a symbol of the field.") (luna-define-method elmo-message-field ((folder elmo-folder) number field) + (when (zerop (elmo-folder-length folder)) + (error "Cannot treat this folder correctly.")) (elmo-msgdb-get-field (elmo-folder-msgdb folder) number field)) (luna-define-method elmo-message-use-cache-p ((folder elmo-folder) number) @@ -1337,53 +1368,25 @@ FIELD is a symbol of the field.") ;; flag-table) ;; "Append ENTITY to the folder.") -(defun elmo-generic-folder-append-msgdb (folder append-msgdb) +(defsubst elmo-folder-append-msgdb (folder append-msgdb) (if append-msgdb - (let* ((number-alist (elmo-msgdb-get-number-alist append-msgdb)) - (all-alist (copy-sequence (append - (elmo-msgdb-get-number-alist - (elmo-folder-msgdb folder)) - number-alist))) - (cur number-alist) - pair overview - to-be-deleted - mark-alist) - (elmo-folder-set-msgdb-internal folder - (elmo-msgdb-append - (elmo-folder-msgdb folder) - append-msgdb)) - (while cur - (setq all-alist (delq (car cur) all-alist)) - ;; same message id exists. - (if (setq pair (rassoc (cdr (car cur)) all-alist)) - (setq to-be-deleted (nconc to-be-deleted (list (car pair))))) - (setq cur (cdr cur))) + (let ((duplicates (elmo-msgdb-merge folder append-msgdb))) (cond ((eq (elmo-folder-process-duplicates-internal folder) 'hide) - ;; Hide duplicates. - (setq overview (elmo-delete-if - (lambda (x) - (memq (elmo-msgdb-overview-entity-get-number - x) - to-be-deleted)) - (elmo-msgdb-get-overview append-msgdb))) + ;; Let duplicates be a temporary killed message. + (elmo-folder-kill-messages folder duplicates) ;; Should be mark as read. - (elmo-folder-mark-as-read folder to-be-deleted) - (elmo-msgdb-set-overview append-msgdb overview)) + (elmo-folder-mark-as-read folder duplicates)) ((eq (elmo-folder-process-duplicates-internal folder) 'read) ;; Mark as read duplicates. - (elmo-folder-mark-as-read folder to-be-deleted)) + (elmo-folder-mark-as-read folder duplicates)) (t ;; Do nothing. - (setq to-be-deleted nil))) - (length to-be-deleted)) + (setq duplicates nil))) + (length duplicates)) 0)) -(luna-define-method elmo-folder-append-msgdb ((folder elmo-folder) - append-msgdb) - (elmo-generic-folder-append-msgdb folder append-msgdb)) - (defun elmo-folder-confirm-appends (appends) (let ((len (length appends)) in) @@ -1400,8 +1403,9 @@ FIELD is a symbol of the field.") in (string-to-int in)) (if (< len in) (throw 'end len)) - (if (y-or-n-p (format "%d messages are not appeared. OK? " - (max (- len in) 0))) + (if (y-or-n-p (format + "%d messages are killed (not appeared). OK? " + (max (- len in) 0))) (throw 'end in)))) (nthcdr (max (- len in) 0) appends)) (if (and elmo-folder-update-threshold @@ -1482,40 +1486,45 @@ FIELD is a symbol of the field.") (elmo-folder-set-msgdb-internal folder (elmo-msgdb-clear))) (luna-define-generic elmo-folder-synchronize (folder - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) "Synchronize the folder data to the newest status. FOLDER is the ELMO folder structure. +If optional DISABLE-KILLED is non-nil, killed messages are also synchronized. If optional IGNORE-MSGDB is non-nil, current msgdb is thrown away except -flag status. If IGNORE-MSGDB is 'visible-only, only visible messages -\(the messages which are not in the killed-list\) are thrown away and -synchronized. +flag status. If NO-CHECK is non-nil, rechecking folder is skipped. Return a list of a cross-posted message number. If update process is interrupted, return nil.") (luna-define-method elmo-folder-synchronize ((folder elmo-folder) - &optional ignore-msgdb no-check) + &optional + disable-killed + ignore-msgdb + no-check) (let ((killed-list (elmo-folder-killed-list-internal folder)) (before-append t) - number-alist old-msgdb diff diff-2 delete-list new-list new-msgdb mark - flag-table crossed after-append numbers) + flag-table crossed after-append) (setq old-msgdb (elmo-folder-msgdb folder)) (setq flag-table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (when ignore-msgdb (elmo-msgdb-flag-table (elmo-folder-msgdb folder) flag-table) - (elmo-folder-clear folder (eq ignore-msgdb 'visible-only))) - (setq numbers (sort (elmo-folder-list-messages folder nil t) '<)) + (elmo-folder-clear folder (not disable-killed))) (unless no-check (elmo-folder-check folder)) (condition-case nil (progn (message "Checking folder diff...") (setq diff (elmo-list-diff (elmo-folder-list-messages folder - (eq 'visible-only ignore-msgdb)) - numbers)) + (not disable-killed)) + (elmo-folder-list-messages + folder + (not disable-killed) + 'in-msgdb))) (message "Checking folder diff...done") (setq new-list (elmo-folder-confirm-appends (car diff))) ;; Set killed list as ((1 . MAX-OF-DISAPPEARED)) @@ -1552,7 +1561,7 @@ If update process is interrupted, return nil.") ;; process crosspost. ;; Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST). (elmo-folder-process-crosspost folder) - (elmo-folder-set-message-modified-internal folder t) + (elmo-folder-set-message-modified folder t) (elmo-folder-set-mark-modified-internal folder t)) ;; return value. (or crossed 0))) @@ -1573,15 +1582,17 @@ If update process is interrupted, return nil.") "Return number of messages in the FOLDER.") (luna-define-method elmo-folder-length ((folder elmo-folder)) - (elmo-msgdb-length (elmo-folder-msgdb folder))) + (if (elmo-folder-msgdb-internal folder) + (elmo-msgdb-length (elmo-folder-msgdb folder)) + 0)) (defun elmo-msgdb-load (folder &optional silent) (unless silent (message "Loading msgdb for %s..." (elmo-folder-name-internal folder))) (let ((msgdb (elmo-load-msgdb (elmo-folder-msgdb-path folder)))) - (elmo-folder-set-info-max-by-numdb folder - (elmo-msgdb-get-number-alist msgdb)) - + (elmo-folder-set-info-max-by-numdb + folder + (elmo-msgdb-list-messages msgdb)) (unless silent (message "Loading msgdb for %s...done" (elmo-folder-name-internal folder))) @@ -1678,7 +1689,6 @@ Return a hashtable for newsgroups." (error "Cannot rename %s folder" (symbol-name (elmo-folder-type-internal folder)))) - ;;; Define folders. (elmo-define-folder ?% 'imap4) (elmo-define-folder ?- 'nntp) diff --git a/etc/VERSION b/etc/VERSION index 1808c6a..d34dd22 100644 --- a/etc/VERSION +++ b/etc/VERSION @@ -121,11 +121,10 @@ 2.8.0 Something 2.8.1 Something -2.9.x Unchained Melody -2.9.15 Undercover Of The Night +2.9.x Unchained Melody 2.10.0 Venus 2.10.1 Watching The Wheels -2.11.x Wonderwall +2.11.x Wonderwall 2.11.3 Wanted Dead Or Alive diff --git a/samples/en/dot.wl b/samples/en/dot.wl index cedef09..b59ea0a 100644 --- a/samples/en/dot.wl +++ b/samples/en/dot.wl @@ -168,12 +168,6 @@ ;;; [[ Special Setting ]] -;; bind "b" in Summary to resend-message (ala mutt's "b"ounce) -;(add-hook 'wl-summary-mode-hook -; '(lambda () -; (define-key wl-summary-mode-map "b" 'wl-summary-resend-message) -; )) - ;; open unread group folder after checking. ;(add-hook 'wl-folder-check-entity-hook ; '(lambda () diff --git a/samples/ja/dot.wl b/samples/ja/dot.wl index dd262c2..65b2372 100644 --- a/samples/ja/dot.wl +++ b/samples/ja/dot.wl @@ -167,12 +167,6 @@ ;;; [[ $BFC + + * check-modules.el (test-shimbun): Check `shimbun-server'. + 2003-02-10 TAKAHASHI Kaoru * check-modules.el (test-semi-mime-edit): Check diff --git a/tests/check-modules.el b/tests/check-modules.el index 17898c0..9f4104d 100644 --- a/tests/check-modules.el +++ b/tests/check-modules.el @@ -142,3 +142,9 @@ (luna-define-method test-semi-mime-play ((case check-modules)) (require 'mime-play) (lunit-assert (fboundp 'mime-store-message/partial-piece))) + +;; emacs-w3m >= 1.3.4 +(luna-define-method test-shimbun ((case check-modules)) + (when (locate-library "shimbun") + (require 'shimbun) + (lunit-assert (fboundp 'shimbun-server)))) diff --git a/wl/ChangeLog b/wl/ChangeLog index 913d1b7..8b03a16 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,353 @@ +2003-08-28 Hiroya Murata + + * wl-refile.el (wl-refile-get-field-value): Call + `elmo-message-entity-field' with 3rd argument is non-nil. + +2003-08-26 Yuuichi Teranishi + + * wl-vars.el (wl-draft-preview-attributes): New user option. + (wl-draft-preview-attributes-list): Ditto. + (wl-draft-preview-attributes-buffer-lines): Ditto. + (wl-draft-preview-attributes-buffer-name): Ditto. + + * wl-mime.el (wl-draft-preview-message): Display attributes. + +2003-08-26 Hiroya Murata + + * wl-summary.el (wl-summary-detect-mark-position): Bind + wl-summary-flag-priority-list to '(new). + +2003-08-23 Hiroya Murata + + * wl-highlight.el (wl-highlight-summary-line-face-spec): New + funtion. + (wl-highlight-summary-line-string): Use it. + (wl-highlight-summary-current-line): Ditto. + +2003-08-23 Yuuichi Teranishi + + * wl-summary.el (wl-summary-update-persistent-mark): Highlight the + line even when the mark string is not changed. + + * wl-thread.el (wl-thread-update-line-on-buffer-sub): Follow the + argument change in the wl-summary-create-line. + (wl-thread-insert-entity-sub): Ditto. + + * wl-summary.el (wl-summary-detect-mark-position): Follow the + argument change in the wl-summary-create-line. + (wl-summary-insert-sequential): Ditto. + (wl-summary-update-thread): Ditto. + (wl-summary-persistent-mark-string): New inline function. + (wl-summary-message-mark): Use it. + (wl-summary-create-line): Abolish argument wl-persistent-mark + and added wl-flags, wl-cached. + + * wl-highlight.el (wl-highlight-summary-line-string): Changed argument + mark to flags. + (wl-highlight-summary-current-line): Decide the face not by the + persistent mark but flags. + +2003-08-22 Hiroya Murata + + * wl-vars.el (wl-summary-new-mark, wl-summary-important-mark, + wl-summary-unread-uncached-mark, wl-summary-unread-cached-mark, + wl-summary-read-uncached-mark): Revive. + (wl-summary-answered-cached-mark, + wl-summary-answered-uncached-mark): New user option. + (wl-summary-score-marks): Follow the change above. + (wl-summary-auto-refile-skip-marks): Ditto. + (wl-summary-incorporate-marks): Ditto. + (wl-summary-expire-reserve-marks): Ditto. + (wl-summary-flag-priority-list): New user option. + + * wl-summary.el (wl-summary-sync-marks): Follow the variable name + changes. + (wl-summary-auto-select-msg-p): Use elmo-message-flagged-p instead + of elmo-message-mark. + (wl-summary-mark-as-read-internal): Ditto. + (wl-summary-mark-as-answered): Ditto. + (wl-summary-mark-as-important): Ditto. + (wl-summary-redisplay-internal): Ditto. + (wl-summary-redisplay-no-mime-internal): Ditto. + (wl-summary-message-mark): New function. + (wl-summary-insert-sequential): Use wl-summary-message-mark + instead of elmo-message-mark. + (wl-summary-update-thread): Ditto. + (wl-summary-persistent-mark): Ditto. + (wl-summary-cursor-move-surface): Use elmo-message-accessible-p + instead of elmo-message-mark. + + * wl-thread.el (wl-thread-update-line-on-buffer-sub): Use + wl-summary-message-mark instead of elmo-message-mark. + (wl-thread-insert-entity-sub): Ditto. + (wl-thread-get-children-msgs-uncached): Ditto. + + * wl-highlight.el (wl-highlight-summary-line-string): Follow the + variable name changes. + (wl-highlight-summary-current-line): Ditto. + + * wl-action.el (wl-summary-no-auto-refile-message-p): Use + wl-summary-message-mark instead of elmo-message-mark. + + * wl-expire.el (wl-expire-message-p): Ditto. + + * wl-score.el (wl-score-headers): Ditto. + + * Version number is increased to 2.11.9. + + * wl-summary.el (wl-summary-buffer-msgdb): Abolish. + (wl-summary-sync-update): Follow the change above. + (wl-summary-switch-to-clone-buffer): Ditto. + (wl-summary-open-folder): Ditto. + +2003-08-20 Hiroya Murata + + * wl-summary.el (wl-summary-cursor-move-surface): Don't skip + `elmo-msgdb-answered-cached-mark' when the folder is unplugged. + + * Version number is increased to 2.11.8. + + * wl-summary.el (wl-summary-buffer-msgdb): Abolish. + + * wl-expire.el (wl-expire-refile): Follow the API change on + `elmo-folder-move-messages'. + (wl-expire-refile-with-copy-reserve-msg): Ditto. + + * wl-action.el (wl-summary-move-mark-list-messages): Ditto. + (wl-summary-exec-action-refile): Ditto. + (wl-summary-exec-action-copy): Ditto. + (wl-summary-no-auto-refile-message-p): No use + `wl-summary-buffer-msgdb'. + (wl-summary-auto-refile): Ditto. + +2003-08-19 Yoichi NAKAYAMA + + * wl-summary.el (wl-summary-sync): Fix regexp for last: and first:. + +2003-08-19 Yuuichi Teranishi + + * wl-summary.el (wl-summary-sync): Treat no-sync. + + * wl-vars.el (wl-folder-sync-range-alist): Removed first: and last:. + (wl-default-sync-range): Ditto. + +2003-08-18 Hiroya Murata + + * wl-refile.el (wl-refile-subject-learn): Call + `elmo-message-entity-field' with 3rd argument is non-nil. + (wl-refile-guess-by-subject): Use `elmo-message-entity-field' + instead of `elmo-msgdb-overview-entity-get-subject'. + +2003-08-12 Yuuichi Teranishi + + * wl-summary.el (wl-summary-goto-folder-subr): Rescan if + scan-type is rescan. + (wl-summary-delete-all-temp-marks): Remove scored mark too when + new optional argument force is non-nil. + (wl-summary-save-view-cache): Call it with force argument non-nil. + + * wl-action.el (wl-summary-unset-mark): Added optional argument FORCE. + +2003-08-12 Hiroya Murata + + * wl-action.el (wl-summary-print-argument): Fixed last change. + +2003-08-11 Hiroya Murata + + * wl-summary.el (wl-summary-target-mark-mark-as-read): Fixed and + simplified. + (wl-summary-target-mark-mark-as-unread): Likewise. + (wl-summary-target-mark-mark-as-important): Likewise. + +2003-08-11 Yoichi NAKAYAMA + + * wl-thread.el (wl-thread-msg-mark-as-important): Abolished. + * wl-summary.el (wl-summary-mark-as-important): Arranged. + (wl-summary-mark-as-important-region): Change accordingly. + (wl-summary-target-mark-mark-as-important): Ditto. + +2003-08-09 Hiroya Murata + + * wl-vars.el (wl-summary-print-argument-within-window): New variable. + + * wl-action.el (wl-summary-print-argument): Print argument to + right side of window if `wl-summary-print-argument-within-window' + is non-nil. + +2003-08-09 Yuuichi Teranishi + + * wl-action.el (wl-summary-set-mark): Use + `wl-summary-message-visible-p' to check visibility of the message + and jump to message only when the message line is visible and have + different number; Call wl-summary-unset-mark with number argument. + (wl-summary-unset-mark): + Use `wl-summary-message-visible-p' + to check visibility of the message and jump to message only when + the message line is visible and have different number; + +2003-08-09 Hiroya Murata + + * Version number is increased to 2.11.7. + + * wl.el (wl-check-variables-2): Don't check wl-summary-line-format + and wl-folder-summary-line-format. + + * wl-summary.el (wl-summary-message-visible-p): New inline function. + (wl-summary-put-temp-mark): Rename from wl-summary-mark-line. + (wl-summary-set-score-mark): Use it. + (wl-summary-target-mark-mark-as-read): Ditto. + (wl-summary-target-mark-mark-as-unread): Ditto. + (wl-summary-target-mark-mark-as-important): Ditto. + (wl-summary-target-mark-msgs): Simplified. + (wl-summary-detect-mark-position): Fixed problem when + summary-line-format no contain persisten/temp mark spec. + (wl-summary-temp-mark): Ditto. + (wl-summary-persistent-mark): Ditto. + (wl-summary-update-persistent-mark): Ditto. + + * wl-action.el (wl-summary-set-mark): Ditto. + (wl-summary-unset-mark): Ditto. + All other related portions are changed. + +2003-08-07 Yuuichi Teranishi + + * Version number is increased to 2.11.6. + +2003-08-05 Yuuichi Teranishi + + * wl-util.el (wl-current-message-buffer): Define as function; + Don't use the value of wl-messge-buffer. + + * wl-summary.el (wl-summary-redisplay-no-mime-internal): Update + persistent mark. + + * wl-mime.el (wl-draft-yank-current-message-entity): If there's + no current message, cause an error. + +2003-08-03 Hiroya Murata + + * wl-summary.el (wl-summary-set-message-modified): Use + elmo-folder-set-message-modified instead of + elmo-folder-set-message-modified-internal. + +2003-08-03 Yuuichi Teranishi + + * wl-summary.el (wl-summary-sync): Call wl-summary-sync-marks + interactively. + (wl-summary-sync): nokill->entirely. + (wl-summary-sync-marks): Fixed message. + (wl-summary-input-range): Added mark, nokill->entirely. + + * wl-score.el (wl-summary-score-update-all-lines): Set expunged + messages as read. + +2003-08-02 Yuuichi Teranishi + + * wl-summary.el (wl-summary-input-range): Abolish all-noscore and + update-noscore. + (wl-summary-sync): Follow the change above. + +2003-08-02 Hiroya Murata + + * wl-action.el (wl-summary-target-mark-all): Use + elmo-folder-list-messages. + +2003-08-02 Yuuichi Teranishi + + * wl-summary.el (wl-summary-rescan): Added argument disable-kill + (wl-summary-rescan): Set wl-summary-scored as nil. + (wl-summary-sync-force-update): Follow the change above. + (wl-summary-sync): Ditto. + (wl-summary-sync-update): Added argument disable-killed. + (wl-summary-insert-headers): Set visible-only argument for + elmo-folder-list-messages. + (wl-summary-input-range): Added update-nokill, update-noscore, + all-nokill, all-noscore and mark. + + * Version number is increased to 2.11.5. + + * wl-draft.el (wl-draft): Set buffer-undo-list as nil. + +2003-08-01 Yoichi NAKAYAMA + + * wl-summary.el (wl-summary-prefetch-msg): Update persistent mark. + (wl-summary-prefetch-region-no-mark): Change accordingly. + * wl-action.el (wl-summary-exec-action-prefetch): Ditto. + +2003-07-31 Yoichi NAKAYAMA + + * wl-address.el (wl-complete-field-to): Abolished. + (wl-complete-address): Completion function for completing-read. + * wl-action.el (wl-summary-get-resend-address): Use it. + + * wl-summary.el (wl-summary-update-persistent-mark): Renamed from + wl-summary-update-mark and abolish unused argument. + (wl-summary-prefetch-region-no-mark, wl-summary-mark-as-read-all) + (wl-summary-delete-cache, wl-summary-resume-cache-status) + (wl-summary-update-status-marks, wl-summary-mark-as-read-internal) + (wl-summary-mark-as-important, wl-summary-redisplay-internal) + (wl-summary-mark-as-answered-internal, wl-summary-reply): Use it. + * wl-draft.el (wl-draft-kill): Ditto. + + * wl-summary.el: Remove unused binding of case-fold-search. + (wl-summary-replace-status-marks): Abolished. + +2003-07-29 Yuuichi Teranishi + + * wl-action.el (wl-summary-set-mark): Cause an error when no message + is specified or folder length is zero. + +2003-07-29 Hiroya Murata + + * wl-expire.el (wl-folder-expire-current-entity): Specify folder type. + (wl-folder-archive-current-entity): Ditto. + +2003-07-28 Yuuichi Teranishi + + * wl-summary.el (wl-summary-update-mark): Ignore errors while + retrieving message mark. + (wl-summary-redisplay-internal): Ditto. + + * wl-message.el (wl-message-buffer-display): Ignore errors while + retrieving message-id field. + + * wl-expire.el (wl-summary-expire): Fixed 2nd argument for `wl-append'. + (Reported by Shinichiro HIDA ) + (wl-expire-refile-with-copy-reserve-msg): Follow the change in the + order of the arguments for `wl-expire-message-p'. + (Reported by Shinichiro HIDA ) + + * wl-summary.el (wl-summary-target-mark-reply-with-citation): + Check return value of wl-summary-reply. + (wl-summary-reply): Recover window configuration when an error occured. + +2003-07-27 Yoichi NAKAYAMA + + * wl-summary.el (wl-summary-resend-message): Abolished, the + feature is inherited by wl-summary-resend (put resend mark). + +2003-07-27 Hiroya Murata + + * wl-summary.el (wl-summary-toggle-disp-msg): Set + wl-message-buffer to nil when the message is hide. + +2003-07-26 Hiroya Murata + + * .cvsignore: New file. + +2003-07-26 Yoichi NAKAYAMA + + * wl-action.el (wl-summary-action-docstring): Add more info. + (wl-summary-target-mark, wl-summary-target-mark-region): Remove + duplicate definition. + (wl-summary-define-mark-action): Functions wl-summary-*-region + keep current position. + (wl-summary-unregister-target-mark): Store result to the variable. + +2003-07-24 Yuuichi Teranishi + + * Version number is increased to 2.11.4. + 2003-07-24 Yuuichi Teranishi * wl-summary.el (wl-summary-cleanup-temp-marks): Use diff --git a/wl/wl-action.el b/wl/wl-action.el index e954bf3..5a5ad78 100644 --- a/wl/wl-action.el +++ b/wl/wl-action.el @@ -31,6 +31,10 @@ (require 'wl-summary) +(eval-when-compile + (defalias-maybe 'wl-summary-target-mark 'ignore) + (defalias-maybe 'wl-summary-target-mark-region 'ignore)) + (defsubst wl-summary-action-mark (action) (nth 0 action)) (defsubst wl-summary-action-symbol (action) @@ -44,7 +48,8 @@ (defsubst wl-summary-action-face (action) (nth 5 action)) (defsubst wl-summary-action-docstring (action) - (nth 6 action)) + (concat (nth 6 action) + "\nThis function is defined by `wl-summary-define-mark-action'.")) ;; Set mark (defun wl-summary-set-mark (&optional set-mark number interactive data) @@ -59,16 +64,21 @@ Return number if put mark succeed" (current (wl-summary-message-number)) (action (assoc set-mark wl-summary-mark-action-list)) visible mark cur-mark) + (when (zerop (elmo-folder-length wl-summary-buffer-elmo-folder)) + (error "Set mark failed")) (prog1 (save-excursion ;; Put mark - (setq visible (or - ;; not-interactive and visible - (and number (wl-summary-jump-to-msg number)) - ;; interactive - (and (null number) current)) - number (or number current) - cur-mark (nth 1 (wl-summary-registered-temp-mark number))) + (if number + ;; Jump to message if cursor is not on the message. + (when (and (setq visible (wl-summary-message-visible-p number)) + (not (eq number current))) + (wl-summary-jump-to-msg number)) + (setq visible t + number current)) + (setq cur-mark (nth 1 (wl-summary-registered-temp-mark number))) + (unless number + (error "No message")) (if (wl-summary-reserve-temp-mark-p cur-mark) (when interactive (error "Already marked as `%s'" cur-mark)) @@ -78,18 +88,19 @@ Return number if put mark succeed" (setq data (funcall (wl-summary-action-argument-function action) (wl-summary-action-symbol action) number))) + ;; Unset the current mark. (wl-summary-unset-mark number) - (when visible - (wl-summary-mark-line set-mark) - (when wl-summary-highlight - (wl-highlight-summary-current-line)) - (when data - (wl-summary-print-argument number data))) ;; Set action. (funcall (wl-summary-action-set-function action) number (wl-summary-action-mark action) data) + (when visible + (wl-summary-put-temp-mark set-mark) + (when wl-summary-highlight + (wl-highlight-summary-current-line)) + (when data + (wl-summary-print-argument number data))) (set-buffer-modified-p nil) ;; Return value. number)) @@ -105,7 +116,8 @@ Return number if put mark succeed" (cons number wl-summary-buffer-target-mark-list)))) (defun wl-summary-unregister-target-mark (number) - (delq number wl-summary-buffer-target-mark-list)) + (setq wl-summary-buffer-target-mark-list + (delq number wl-summary-buffer-target-mark-list))) (defun wl-summary-have-target-mark-p (number) (memq number wl-summary-buffer-target-mark-list)) @@ -131,7 +143,7 @@ Return number if put mark succeed" (let (wl-summary-buffer-disp-msg) (when (setq number (wl-summary-message-number)) (wl-summary-set-mark (wl-summary-action-mark action) - number nil data) + nil nil data) (setq wl-summary-buffer-target-mark-list (delq number wl-summary-buffer-target-mark-list))))) (forward-line 1)) @@ -200,11 +212,12 @@ Return number if put mark succeed" mark-list))) ;; Unset mark -(defun wl-summary-unset-mark (&optional number interactive) +(defun wl-summary-unset-mark (&optional number interactive force) "Unset temporary mark of the message with NUMBER. NUMBER is the message number to unset the mark. If not specified, the message on the cursor position is treated. Optional INTERACTIVE is non-nil when it should be called interactively. +If optional FORCE is non-nil, remove scored mark too. Return number if put mark succeed" (interactive) (save-excursion @@ -212,25 +225,28 @@ Return number if put mark succeed" (let ((buffer-read-only nil) visible mark action) (if number - (setq visible (wl-summary-jump-to-msg number)) - (setq visible t)) - (setq number (or number (wl-summary-message-number))) + ;; Jump to message + (when (and (setq visible (wl-summary-message-visible-p number)) + (not (eq number (wl-summary-message-number)))) + (wl-summary-jump-to-msg number)) + (setq visible t + number (wl-summary-message-number))) + (setq mark (wl-summary-temp-mark)) + ;; Remove from temporal mark structure. + (wl-summary-unregister-target-mark number) + (wl-summary-unregister-temp-mark number) ;; Delete mark on buffer. (when visible - (setq mark (wl-summary-temp-mark)) (unless (string= mark " ") - (delete-backward-char 1) - (insert (or (wl-summary-get-score-mark number) - " ")) + (wl-summary-put-temp-mark + (or (unless force (wl-summary-get-score-mark number)) + " ")) (setq action (assoc mark wl-summary-mark-action-list)) (when wl-summary-highlight (wl-highlight-summary-current-line)) (when (wl-summary-action-argument-function action) (wl-summary-remove-argument))) - (set-buffer-modified-p nil)) - ;; Remove from temporal mark structure. - (wl-summary-unregister-target-mark number) - (wl-summary-unregister-temp-mark number))) + (set-buffer-modified-p nil)))) ;; Move the cursor. ;; (if (or interactive (interactive-p)) ;; (if (eq wl-summary-move-direction-downward nil) @@ -276,12 +292,7 @@ Return number if put mark succeed" refiles (if (eq folder-name 'null) 'null - (wl-folder-get-elmo-folder folder-name)) - (wl-summary-buffer-msgdb) - (not (null (cdr dst-msgs))) - nil ; no-delete - nil ; same-number - t)) + (wl-folder-get-elmo-folder folder-name)))) (error nil)) (when result ; succeeded. ;; update buffer. @@ -354,16 +365,17 @@ Return number if put mark succeed" `(lambda (beg end) ,(wl-summary-action-docstring action) (interactive "r") - (goto-char beg) - (wl-summary-mark-region-subr - (quote ,(intern (format "wl-summary-%s" - (wl-summary-action-symbol action)))) - beg end - (if (quote ,(wl-summary-action-argument-function action)) - (funcall (function - ,(wl-summary-action-argument-function action)) - (quote ,(wl-summary-action-symbol action)) - (wl-summary-message-number)))))) + (save-excursion + (goto-char beg) + (wl-summary-mark-region-subr + (quote ,(intern (format "wl-summary-%s" + (wl-summary-action-symbol action)))) + beg end + (if (quote ,(wl-summary-action-argument-function action)) + (funcall (function + ,(wl-summary-action-argument-function action)) + (quote ,(wl-summary-action-symbol action)) + (wl-summary-message-number))))))) (fset (intern (format "wl-summary-target-mark-%s" (wl-summary-action-symbol action))) `(lambda () @@ -459,13 +471,7 @@ Return number if put mark succeed" (setq result (elmo-folder-move-messages wl-summary-buffer-elmo-folder (cdr (car dst-msgs)) - (wl-folder-get-elmo-folder - (car (car dst-msgs))) - (wl-summary-buffer-msgdb) - (not (null (cdr dst-msgs))) - nil ; no-delete - nil ; same-number - t)) + (wl-folder-get-elmo-folder (car (car dst-msgs))))) (error nil)) (if result ; succeeded. (progn @@ -503,15 +509,10 @@ Return number if put mark succeed" (setq result nil) (condition-case nil (setq result (elmo-folder-move-messages - wl-summary-buffer-elmo-folder - (cdr (car dst-msgs)) - (wl-folder-get-elmo-folder - (car (car dst-msgs))) - (wl-summary-buffer-msgdb) - (not (null (cdr dst-msgs))) - t ; t is no-delete (copy) - nil ; same-number - t)) + wl-summary-buffer-elmo-folder + (cdr (car dst-msgs)) + (wl-folder-get-elmo-folder (car (car dst-msgs))) + 'no-delete)) (error nil)) (if result ; succeeded. (progn @@ -530,29 +531,18 @@ Return number if put mark succeed" ;; Prefetch. (defun wl-summary-exec-action-prefetch (mark-list) (save-excursion - (let* ((buffer-read-only nil) - (count 0) + (let* ((count 0) (length (length mark-list)) (mark-list-copy (copy-sequence mark-list)) (pos (point)) - (failures 0) - new-mark) + (failures 0)) (dolist (mark-info mark-list-copy) (message "Prefetching...(%d/%d)" (setq count (+ 1 count)) length) - (setq new-mark (wl-summary-prefetch-msg (car mark-info))) - (if new-mark + (if (wl-summary-prefetch-msg (car mark-info)) (progn (wl-summary-unset-mark (car mark-info)) - (when (wl-summary-jump-to-msg (car mark-info)) - (wl-summary-persistent-mark) ; move - (delete-backward-char 1) - (insert new-mark) - (when wl-summary-highlight - (wl-highlight-summary-current-line)) - (save-excursion - (goto-char pos) - (sit-for 0)))) + (sit-for 0)) (incf failures))) (message "Prefetching...done") 0))) @@ -560,7 +550,7 @@ Return number if put mark succeed" ;; Resend. (defun wl-summary-get-resend-address (action number) "Decide resend address." - (wl-complete-field-to "Resend message to: ")) + (completing-read "Resend message to: " 'wl-complete-address)) (defun wl-summary-exec-action-resend (mark-list) (let ((failure 0)) @@ -755,14 +745,28 @@ Return number if put mark succeed" (search-forward "\r") (forward-char -1) (setq re (point)) - (setq c 0) - (while (< c len) - (forward-char -1) - (setq c (+ c (char-width (following-char))))) - (and (> c len) (setq folder (concat " " folder))) - (setq rs (point)) - (when wl-summary-width - (put-text-property rs re 'invisible t)) + (let ((width (cond (wl-summary-width + (1- wl-summary-width)) + (wl-summary-print-argument-within-window + (1- (window-width))))) + (c (current-column)) + (padding 0)) + (if (and width (> (+ c len) width)) + (progn + (move-to-column width) + (setq c (current-column)) + (while (> (+ c len) width) + (forward-char -1) + (setq c (current-column))) + (when (< (+ c len) width) + (setq folder (concat " " folder))) + (setq rs (point)) + (put-text-property rs re 'invisible t)) + (when (and width + (> (setq padding (- width len c)) 0)) + (setq folder (concat (make-string padding ?\ ) + folder))) + (setq rs (1- re)))) (put-text-property rs re 'wl-summary-action-argument t) (goto-char re) (wl-highlight-action-argument-string folder) @@ -777,14 +781,13 @@ Return number if put mark succeed" "Refile message to previously refiled destination." (interactive) (funcall (symbol-function 'wl-summary-refile) - wl-summary-buffer-prev-refile-destination - (wl-summary-message-number)) + wl-summary-buffer-prev-refile-destination) (if (eq wl-summary-move-direction-downward nil) (wl-summary-prev) (wl-summary-next))) -(defsubst wl-summary-no-auto-refile-message-p (msg) - (member (elmo-msgdb-get-mark (wl-summary-buffer-msgdb) msg) +(defsubst wl-summary-no-auto-refile-message-p (number) + (member (wl-summary-message-mark wl-summary-buffer-elmo-folder number) wl-summary-auto-refile-skip-marks)) (defun wl-summary-auto-refile (&optional open-all) @@ -815,8 +818,8 @@ Return number if put mark succeed" (setq dst (wl-folder-get-realname (wl-refile-guess-by-rule - (elmo-msgdb-overview-get-entity - number (wl-summary-buffer-msgdb))))) + (elmo-message-entity wl-summary-buffer-elmo-folder + number)))) (not (equal dst spec)) (let ((pair (assoc dst checked-dsts)) ret) @@ -845,12 +848,6 @@ If optional argument NUMBER is specified, unmark message specified by NUMBER." (interactive) (wl-summary-unset-mark number (interactive-p))) -(defun wl-summary-target-mark (&optional number) - "Put target mark '*' on current message. -If optional argument NUMBER is specified, mark message specified by NUMBER." - (interactive) - (wl-summary-set-mark "*" number (interactive-p))) - (defun wl-summary-unmark-region (beg end) (interactive "r") (save-excursion @@ -887,26 +884,22 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." children) (if (wl-thread-entity-get-opened entity) ;; opened...delete line. - (funcall function number data) + (funcall function nil data) ;; closed (setq children (wl-thread-get-children-msgs number)) (while children (funcall function (pop children) data))) (forward-line 1)))) (while (not (eobp)) - (funcall function (wl-summary-message-number) data) + (funcall function nil data) (forward-line 1)))))) -(defun wl-summary-target-mark-region (beg end) - (interactive "r") - (wl-summary-mark-region-subr 'wl-summary-target-mark beg end nil)) - (defun wl-summary-target-mark-all () (interactive) (wl-summary-target-mark-region (point-min) (point-max)) (setq wl-summary-buffer-target-mark-list - (mapcar 'car - (elmo-msgdb-get-number-alist (wl-summary-buffer-msgdb))))) + (elmo-folder-list-messages wl-summary-buffer-elmo-folder + nil 'in-msgdb))) (defun wl-summary-delete-all-mark (mark) (goto-char (point-min)) diff --git a/wl/wl-address.el b/wl/wl-address.el index a7d0125..16082f9 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -274,12 +274,18 @@ Matched address lists are append to CL." (setq entries (cdr entries))) (append result cl))) -(defun wl-complete-field-to (prompt) - (interactive) - (let ((cl wl-address-completion-list)) - (if cl - (completing-read (or prompt "To: ") cl) - (read-string (or prompt "To: "))))) +(defun wl-complete-address (string predicate flag) + "Completion function for completing-read (comma separated addresses)." + (if (string-match "^\\(.*,\\)\\(.*\\)$" string) + (let* ((str1 (match-string 1 string)) + (str2 (match-string 2 string)) + (str2-comp (wl-complete-address str2 predicate flag))) + (if (and (not flag) (stringp str2-comp)) + (concat str1 str2-comp) + str2-comp)) + (if (not flag) + (try-completion string wl-address-list) + (all-completions string wl-address-list)))) (defalias 'wl-address-quote-specials 'elmo-address-quote-specials) diff --git a/wl/wl-draft.el b/wl/wl-draft.el index b75cccf..8c5a236 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -772,8 +772,8 @@ Reply to author if WITH-ARG is non-nil." folder-name))) (with-current-buffer buffer (elmo-folder-unmark-answered folder (list number)) - (wl-summary-jump-to-msg number) - (wl-summary-update-mark number)) + (when (wl-summary-jump-to-msg number) + (wl-summary-update-persistent-mark))) (elmo-folder-open folder 'load-msgdb) (elmo-folder-unmark-answered folder (list number)) (elmo-folder-close folder)))) @@ -1644,6 +1644,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (if (interactive-p) (run-hooks 'wl-mail-setup-hook)) (goto-char (point-min)) + (setq buffer-undo-list nil) (wl-user-agent-compose-internal) ;; user-agent (cond ((and (interactive-p) diff --git a/wl/wl-expire.el b/wl/wl-expire.el index 588249e..79e7038 100644 --- a/wl/wl-expire.el +++ b/wl/wl-expire.el @@ -92,12 +92,12 @@ (defsubst wl-expire-message-p (folder number) "Return non-nil when a message in the FOLDER with NUMBER can be expired." (cond ((consp wl-summary-expire-reserve-marks) - (let ((mark (elmo-message-mark folder number))) + (let ((mark (wl-summary-message-mark folder number))) (not (or (member mark wl-summary-expire-reserve-marks) (and wl-summary-buffer-disp-msg (eq number wl-summary-buffer-current-msg)))))) ((eq wl-summary-expire-reserve-marks 'all) - (not (or (elmo-message-mark folder number) + (not (or (wl-summary-message-mark folder number) (and wl-summary-buffer-disp-msg (eq number wl-summary-buffer-current-msg))))) ((eq wl-summary-expire-reserve-marks 'none) @@ -160,11 +160,8 @@ (if (elmo-folder-move-messages folder refile-list dst-folder - nil ; XXX - t copy - preserve-number - wl-expire-add-seen-list) + preserve-number) (progn (wl-expire-append-log (elmo-folder-name-internal folder) @@ -196,7 +193,7 @@ If REFILE-LIST includes reserve mark message, so copy." (error "%s: create folder failed" (elmo-folder-name-internal dst-folder))) (while (setq msg (wl-pop msglist)) - (unless (wl-expire-message-p msg folder) + (unless (wl-expire-message-p folder msg) (setq msg-id (elmo-message-field folder msg 'message-id)) (if (assoc msg-id wl-expired-alist) ;; reserve mark message already refiled or expired @@ -213,11 +210,8 @@ If REFILE-LIST includes reserve mark message, so copy." (elmo-folder-move-messages folder refile-list dst-folder - nil ; - t copy-reserve-message - preserve-number - wl-expire-add-seen-list)) + preserve-number)) (error "Expire: move msgs to %s failed" (elmo-folder-name-internal dst-folder))) (wl-expire-append-log (elmo-folder-name-internal folder) @@ -661,7 +655,7 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." key-date (elmo-message-entity-field entity 'date)) (wl-append delete-list - (elmo-message-entity-number entity)))))) + (list (elmo-message-entity-number entity))))))) (t (error "%s: not supported" val-type))) (when delete-list @@ -749,16 +743,17 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (defun wl-folder-expire-current-entity () (interactive) - (let ((entity-name - (or (wl-folder-get-folder-name-by-id - (get-text-property (point) 'wl-folder-entity-id)) - (wl-folder-get-entity-from-buffer)))) + (let ((entity-name (wl-folder-get-entity-from-buffer)) + (type (if (wl-folder-buffer-group-p) + 'group + 'folder))) (when (and entity-name (or (not (interactive-p)) (y-or-n-p (format "Expire %s? " entity-name)))) (wl-folder-expire-entity (wl-folder-search-entity-by-name entity-name - wl-folder-entity)) + wl-folder-entity + type)) (if (get-buffer wl-summary-buffer-name) (kill-buffer wl-summary-buffer-name)) (message "Expiring %s is done" entity-name)))) @@ -767,16 +762,17 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (defun wl-folder-archive-current-entity () (interactive) - (let ((entity-name - (or (wl-folder-get-folder-name-by-id - (get-text-property (point) 'wl-folder-entity-id)) - (wl-folder-get-entity-from-buffer)))) + (let ((entity-name (wl-folder-get-entity-from-buffer)) + (type (if (wl-folder-buffer-group-p) + 'group + 'folder))) (when (and entity-name (or (not (interactive-p)) (y-or-n-p (format "Archive %s? " entity-name)))) (wl-folder-archive-entity (wl-folder-search-entity-by-name entity-name - wl-folder-entity)) + wl-folder-entity + type)) (message "Archiving %s is done" entity-name)))) (defun wl-archive-number1 (folder archive-list &optional dst-folder-arg) diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index ef60fbf..ff027e0 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -820,37 +820,47 @@ (put-text-property bol (match-end 0) 'face face))) (put-text-property bol eol 'face text-face))))) -(defun wl-highlight-summary-line-string (line mark temp-mark indent) - (let (fsymbol action) - (cond ((and (string= temp-mark wl-summary-score-over-mark) - (member mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-new-mark))) - (setq fsymbol 'wl-highlight-summary-high-unread-face)) - ((and (string= temp-mark wl-summary-score-below-mark) - (member mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-new-mark))) - (setq fsymbol 'wl-highlight-summary-low-unread-face)) - ((setq action (assoc temp-mark wl-summary-mark-action-list)) - (setq fsymbol (nth 5 action))) - ((string= mark elmo-msgdb-new-mark) - (setq fsymbol 'wl-highlight-summary-new-face)) - ((member mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark)) - (setq fsymbol 'wl-highlight-summary-unread-face)) - ((member mark (list elmo-msgdb-answered-cached-mark - elmo-msgdb-answered-uncached-mark)) - (setq fsymbol 'wl-highlight-summary-answered-face)) - ((or (string= mark elmo-msgdb-important-mark)) - (setq fsymbol 'wl-highlight-summary-important-face)) - ((string= temp-mark wl-summary-score-below-mark) - (setq fsymbol 'wl-highlight-summary-low-read-face)) - ((string= temp-mark wl-summary-score-over-mark) - (setq fsymbol 'wl-highlight-summary-high-read-face)) - (t (if (zerop (length indent)) - (setq fsymbol 'wl-highlight-summary-thread-top-face) - (setq fsymbol 'wl-highlight-summary-normal-face)))) +(defsubst wl-highlight-summary-line-face-spec (flags temp-mark indent) + "Return a cons cell of (face . argument)." + (let (action) + (if (setq action (assoc temp-mark wl-summary-mark-action-list)) + (cons (nth 5 action) (nth 2 action)) + (cond + ((and (string= temp-mark wl-summary-score-over-mark) + (or (memq 'new flags) (memq 'unread flags))) + '(wl-highlight-summary-high-unread-face)) + ((and (string= temp-mark wl-summary-score-below-mark) + (or (memq 'new flags) (memq 'unread flags))) + '(wl-highlight-summary-low-unread-face)) + ((let ((priorities wl-summary-flag-priority-list) + result) + (while (and (null result) priorities) + (when (memq (car priorities) flags) + (setq result + (case (car priorities) + (new + '(wl-highlight-summary-new-face)) + (important + '(wl-highlight-summary-important-face)) + (answered + '(wl-highlight-summary-answered-face)) + (unread + '(wl-highlight-summary-unread-face))))) + (setq priorities (cdr priorities))) + result)) + ((string= temp-mark wl-summary-score-below-mark) + '(wl-highlight-summary-low-read-face)) + ((string= temp-mark wl-summary-score-over-mark) + '(wl-highlight-summary-high-read-face)) + (t (if indent + '(wl-highlight-summary-normal-face) + '(wl-highlight-summary-thread-top-face))))))) + +(defun wl-highlight-summary-line-string (line flags temp-mark indent) + (let ((fsymbol (car (wl-highlight-summary-line-face-spec + flags + temp-mark + (> (length indent) 0))))) (put-text-property 0 (length line) 'face fsymbol line)) (if wl-use-highlight-mouse-line (put-text-property 0 (length line) 'mouse-face 'highlight line))) @@ -859,53 +869,23 @@ (interactive) (save-excursion (let ((inhibit-read-only t) - (case-fold-search nil) temp-mark status-mark + (case-fold-search nil) (deactivate-mark nil) - fsymbol action bol eol matched thread-top looked-at dest ds) + (number (wl-summary-message-number)) + bol eol spec) (end-of-line) (setq eol (point)) (beginning-of-line) (setq bol (point)) - (setq status-mark (wl-summary-persistent-mark)) - (setq temp-mark (wl-summary-temp-mark)) - (when (setq action (assoc temp-mark wl-summary-mark-action-list)) - (setq fsymbol (nth 5 action)) - (setq dest (nth 2 action))) - (if (not fsymbol) - (cond - ((and (string= temp-mark wl-summary-score-over-mark) - (member status-mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-new-mark))) - (setq fsymbol 'wl-highlight-summary-high-unread-face)) - ((and (string= temp-mark wl-summary-score-below-mark) - (member status-mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-new-mark))) - (setq fsymbol 'wl-highlight-summary-low-unread-face)) - ((string= status-mark elmo-msgdb-new-mark) - (setq fsymbol 'wl-highlight-summary-new-face)) - ((member status-mark (list elmo-msgdb-unread-cached-mark - elmo-msgdb-unread-uncached-mark)) - (setq fsymbol 'wl-highlight-summary-unread-face)) - ((member status-mark (list elmo-msgdb-answered-cached-mark - elmo-msgdb-answered-uncached-mark)) - (setq fsymbol 'wl-highlight-summary-answered-face)) - ((string= status-mark elmo-msgdb-important-mark) - (setq fsymbol 'wl-highlight-summary-important-face)) - ;; score mark - ((string= temp-mark wl-summary-score-below-mark) - (setq fsymbol 'wl-highlight-summary-low-read-face)) - ((string= temp-mark wl-summary-score-over-mark) - (setq fsymbol 'wl-highlight-summary-high-read-face)) - ;; - (t (if (null - (wl-thread-entity-get-parent-entity - (wl-thread-get-entity (wl-summary-message-number)))) - (setq fsymbol 'wl-highlight-summary-thread-top-face) - (setq fsymbol 'wl-highlight-summary-normal-face))))) - (put-text-property bol eol 'face fsymbol) - (when dest + (setq spec (wl-highlight-summary-line-face-spec + (elmo-message-flags wl-summary-buffer-elmo-folder + number) + (wl-summary-temp-mark) + (wl-thread-entity-get-parent-entity + (wl-thread-get-entity number)))) + (when (car spec) + (put-text-property bol eol 'face (car spec))) + (when (cdr spec) (put-text-property (next-single-property-change (next-single-property-change bol 'wl-summary-action-argument @@ -914,11 +894,10 @@ eol 'face 'wl-highlight-action-argument-face)) - (if wl-use-highlight-mouse-line - (put-text-property bol - eol 'mouse-face 'highlight)) - (if wl-use-dnd - (wl-dnd-set-drag-starter bol eol))))) + (when wl-use-highlight-mouse-line + (put-text-property bol eol 'mouse-face 'highlight)) + (when wl-use-dnd + (wl-dnd-set-drag-starter bol eol))))) (defun wl-highlight-folder (start end) "Highlight folder between start and end. diff --git a/wl/wl-message.el b/wl/wl-message.el index 4a243eb..ba7d3c6 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -468,7 +468,8 @@ Returns non-nil if bottom of message." ;; Use message buffer cache. (defun wl-message-buffer-display (folder number flag &optional force-reload unread) - (let* ((msg-id (elmo-message-field folder number 'message-id)) + (let* ((msg-id (ignore-errors (elmo-message-field folder number + 'message-id))) (fname (elmo-folder-name-internal folder)) (hit (wl-message-buffer-cache-hit (list fname number msg-id))) (read nil) diff --git a/wl/wl-mime.el b/wl/wl-mime.el index d6f467b..ef80d00 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -59,8 +59,11 @@ has Non-nil value\)" (function wl-draft-yank-to-draft-buffer)))) (mime-preview-following-method-alist (list (cons 'wl-original-message-mode - (function wl-draft-yank-to-draft-buffer))))) - (if (get-buffer (wl-current-message-buffer)) + (function wl-draft-yank-to-draft-buffer)))) + (message-buffer (wl-current-message-buffer))) + (unless message-buffer + (error "No message.")) + (if (get-buffer message-buffer) (save-excursion (set-buffer (wl-current-message-buffer)) (save-restriction @@ -143,7 +146,8 @@ It calls following-method selected from variable (defun wl-draft-preview-message () "Preview editing message." (interactive) - (let* (recipients-message + (let* (wl-recipients + (orig-buffer (current-buffer)) (current-point (point)) (config-exec-flag wl-draft-config-exec-flag) (parent-folder wl-draft-parent-folder) @@ -164,10 +168,9 @@ It calls following-method selected from variable (wl-draft-parent-folder parent-folder)) (goto-char current-point) (run-hooks 'wl-draft-send-hook) - (setq recipients-message + (setq wl-recipients (condition-case err - (concat "Recipients: " - (mapconcat + (concat (mapconcat 'identity (wl-draft-deduce-address-list (current-buffer) @@ -191,7 +194,51 @@ It calls following-method selected from variable (when wl-highlight-body-too (wl-highlight-body)) (run-hooks 'wl-draft-preview-message-hook)) - (message "%s" recipients-message))) + (make-local-variable 'kill-buffer-hook) + (add-hook 'kill-buffer-hook + (lambda () + (when (get-buffer-window + wl-draft-preview-attributes-buffer-name) + (select-window (get-buffer-window + wl-draft-preview-attributes-buffer-name)) + (delete-window)) + (when (get-buffer wl-draft-preview-attributes-buffer-name) + (kill-buffer (get-buffer + wl-draft-preview-attributes-buffer-name))))) + (if (not wl-draft-preview-attributes) + (message (concat "Recipients: " wl-recipients)) +; (ignore-errors ; in case when the window is too small + (let* ((cur-win (selected-window)) + (size (min + (- (window-height cur-win) + window-min-height 1) + (- (window-height cur-win) + (max + window-min-height + (1+ wl-draft-preview-attributes-buffer-lines)))))) + (split-window cur-win (if (> size 0) size window-min-height)) + (select-window (next-window)) + (let ((pop-up-windows nil)) + (switch-to-buffer (get-buffer-create + wl-draft-preview-attributes-buffer-name))) + (with-current-buffer + (get-buffer wl-draft-preview-attributes-buffer-name) + (setq buffer-read-only t) + (let (buffer-read-only) + (erase-buffer) + (dolist (attr wl-draft-preview-attributes-list) + (insert (capitalize (symbol-name attr)) ": " + (or + (with-current-buffer orig-buffer + (format "%s" + (symbol-value + (intern + (concat "wl-" (symbol-name attr)))))) + "") + "\n")) + (goto-char (point-min)) + (wl-highlight-headers))) + (select-window cur-win)))));) (defalias 'wl-draft-caesar-region 'mule-caesar-region) diff --git a/wl/wl-refile.el b/wl/wl-refile.el index 9d78fb6..feb8282 100644 --- a/wl/wl-refile.el +++ b/wl/wl-refile.el @@ -132,7 +132,7 @@ (defun wl-refile-subject-learn (entity dst) (let ((subject (funcall wl-summary-subject-filter-function - (elmo-message-entity-field entity 'subject))) + (elmo-message-entity-field entity 'subject 'decode))) hit) (setq dst (elmo-string dst)) (if (and subject (not (string= subject ""))) @@ -198,7 +198,7 @@ If RULE does not match ENTITY, returns nil." (defun wl-refile-get-field-value (entity field) "Get FIELD value from ENTITY." - (elmo-message-entity-field entity (intern (downcase field)))) + (elmo-message-entity-field entity (intern (downcase field)) 'decode)) (defun wl-refile-guess-by-rule (entity) (let ((rules wl-refile-rule-alist) @@ -250,7 +250,7 @@ If RULE does not match ENTITY, returns nil." (defun wl-refile-guess-by-subject (entity) (cdr (assoc (funcall wl-summary-subject-filter-function - (elmo-msgdb-overview-entity-get-subject entity)) + (elmo-message-entity-field entity 'subject 'decode)) wl-refile-subject-alist))) (require 'product) diff --git a/wl/wl-score.el b/wl/wl-score.el index 8fc34a5..20dd43c 100644 --- a/wl/wl-score.el +++ b/wl/wl-score.el @@ -407,7 +407,7 @@ Set `wl-score-cache' nil." (setq num (elmo-message-entity-number entity)) (when (and (not (assq num wl-summary-scored)) (or (memq num force-msgs) - (member (elmo-message-mark folder num) + (member (wl-summary-message-mark folder num) wl-summary-score-marks))) (setq wl-scores-messages (cons (cons entity (or wl-summary-default-score 0)) @@ -1233,16 +1233,15 @@ Set `wl-score-cache' nil." 'wl-summary-score-update-all-lines "Updating score..." (/ (* i 100) count)))) (when dels - ;;(let ((marks dels)) - ;;(while marks - ;;(elmo-message-set-flag wl-summary-buffer-elmo-folder - ;; (pop marks) 'read))) + (dolist (del dels) + (elmo-message-set-flag wl-summary-buffer-elmo-folder + del 'read)) (elmo-folder-kill-messages wl-summary-buffer-elmo-folder dels) (wl-summary-delete-messages-on-buffer dels)) (when (and update update-unread) ;; Update Folder mode (wl-folder-set-folder-updated (wl-summary-buffer-folder-name) - (list + (list 0 (let ((pair (wl-summary-count-unread))) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 17370cd..5b0f82f 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -71,10 +71,6 @@ (` (and wl-summary-buffer-elmo-folder (elmo-folder-name-internal wl-summary-buffer-elmo-folder)))) -(defmacro wl-summary-buffer-msgdb () - (` (and wl-summary-buffer-elmo-folder - (elmo-folder-msgdb wl-summary-buffer-elmo-folder)))) - (defvar wl-summary-buffer-disp-msg nil) (defvar wl-summary-buffer-disp-folder nil) (defvar wl-summary-buffer-temp-mark-list nil) @@ -105,7 +101,6 @@ (defvar wl-summary-buffer-exit-function nil) (defvar wl-summary-buffer-next-message-function nil) (defvar wl-summary-buffer-number-list nil) -(defvar wl-summary-buffer-msgdb nil) (defvar wl-summary-buffer-folder-name nil) (defvar wl-summary-buffer-line-formatter nil) (defvar wl-summary-buffer-line-format nil) @@ -175,7 +170,6 @@ (make-variable-buffer-local 'wl-summary-buffer-exit-function) (make-variable-buffer-local 'wl-summary-buffer-next-message-function) (make-variable-buffer-local 'wl-summary-buffer-number-list) -(make-variable-buffer-local 'wl-summary-buffer-msgdb) (make-variable-buffer-local 'wl-summary-buffer-folder-name) (make-variable-buffer-local 'wl-summary-buffer-line-formatter) (make-variable-buffer-local 'wl-summary-buffer-line-format) @@ -290,6 +284,7 @@ See also variable `wl-use-petname'." ["Set dispose mark" wl-summary-dispose t] ["Set refile mark" wl-summary-refile t] ["Set copy mark" wl-summary-copy t] + ["Set resend mark" wl-summary-resend t] ["Prefetch" wl-summary-prefetch t] ["Set target mark" wl-summary-target-mark t] ["Unmark" wl-summary-unmark t] @@ -297,7 +292,6 @@ See also variable `wl-use-petname'." ["Cancel posted news" wl-summary-cancel-message t] ["Supersedes message" wl-summary-supersedes-message t] ["Resend bounced mail" wl-summary-resend-bounced-mail t] - ["Resend message" wl-summary-resend-message t] ["Enter the message" wl-summary-jump-to-current-message t] ["Pipe message" wl-summary-pipe-message t] ["Print message" wl-summary-print-message t]) @@ -550,6 +544,12 @@ See also variable `wl-use-petname'." "Menu used in Summary mode." wl-summary-mode-menu-spec)) +(defsubst wl-summary-message-visible-p (number) + "Return non-nil if the message with NUMBER is visible." + (or (eq wl-summary-buffer-view 'sequence) + (not (wl-thread-entity-parent-invisible-p + (wl-thread-get-entity number))))) + (defun wl-status-update () (interactive) (wl-address-init)) @@ -659,60 +659,12 @@ you." (t (message "Does not appear to be a rejected letter.")))))) -(defun wl-summary-resend-message (address) - "Resend the current message to ADDRESS." - (interactive "sResend message to: ") - (if (or (null address) (string-match "^[ \t]*$" address)) - (message "No address specified.") - (message "Resending message to %s..." address) - (save-excursion - (let ((original (wl-summary-get-original-buffer))) - ;; We first set up a normal mail buffer. - (set-buffer (get-buffer-create " *wl-draft-resend*")) - (buffer-disable-undo (current-buffer)) - (erase-buffer) - (setq wl-sent-message-via nil) - ;; Insert our usual headers. - (wl-draft-insert-from-field) - (wl-draft-insert-date-field) - (insert "to: " address "\n") - (goto-char (point-min)) - ;; Rename them all to "Resent-*". - (while (re-search-forward "^[A-Za-z]" nil t) - (forward-char -1) - (insert "Resent-")) - (widen) - (forward-line) - (delete-region (point) (point-max)) - (let ((beg (point))) - ;; Insert the message to be resent. - (insert-buffer-substring original) - (goto-char (point-min)) - (search-forward "\n\n") - (forward-char -1) - (save-restriction - (narrow-to-region beg (point)) - (wl-draft-delete-fields wl-ignored-resent-headers) - (goto-char (point-max))) - (insert mail-header-separator) - ;; Rename all old ("Previous-")Resent headers. - (while (re-search-backward "^\\(Previous-\\)*Resent-" beg t) - (beginning-of-line) - (insert "Previous-")) - ;; Quote any "From " lines at the beginning. - (goto-char beg) - (when (looking-at "From ") - (replace-match "X-From-Line: "))) - ;; Send it. - (wl-draft-dispatch-message) - (kill-buffer (current-buffer))) - (message "Resending message to %s...done" address)))) - (defun wl-summary-detect-mark-position () (let ((column wl-summary-buffer-number-column) (formatter wl-summary-buffer-line-formatter) (dummy-temp (char-to-string 200)) - (dummy-persistent (char-to-string 201)) + (wl-summary-new-mark (char-to-string 201)) ; bind only for the check. + (wl-summary-flag-priority-list '(new)) ; ditto. temp persistent) (with-temp-buffer (setq wl-summary-buffer-number-column column @@ -726,14 +678,15 @@ you." :size 100) nil dummy-temp - dummy-persistent)) + '(new) + nil)) (goto-char (point-min)) (setq temp (save-excursion - (search-forward dummy-temp nil t) - (current-column)) + (when (search-forward dummy-temp nil t) + (current-column))) persistent (save-excursion - (search-forward dummy-persistent nil t) - (current-column)))) + (when (search-forward wl-summary-new-mark nil t) + (current-column))))) (setq wl-summary-buffer-temp-mark-column temp wl-summary-buffer-persistent-mark-column persistent))) @@ -896,7 +849,8 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (or ml-name (setq ml-name (match-string 1 delivered-to)))) (and (setq mailing-list (elmo-message-entity-field entity 'mailing-list)) - (string-match "\\(^\\|; \\)contact \\([^@]+\\)-[^-@]+@" mailing-list) ; *-help@, *-owner@, etc. + ;; *-help@, *-owner@, etc. + (string-match "\\(^\\|; \\)contact \\([^@]+\\)-[^-@]+@" mailing-list) (or ml-name (setq ml-name (match-string 2 mailing-list)))) (cons (and ml-name (car (split-string ml-name " "))) (and ml-count (string-to-int ml-count))))) @@ -929,7 +883,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (interactive) (wl-summary-rescan "list-info")) -(defun wl-summary-rescan (&optional sort-by) +(defun wl-summary-rescan (&optional sort-by disable-killed) "Rescan current folder without updating." (interactive) (let ((elmo-mime-charset wl-summary-buffer-mime-charset) @@ -939,7 +893,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (inhibit-read-only t) (buffer-read-only nil) (numbers (elmo-folder-list-messages wl-summary-buffer-elmo-folder - nil t)) ; in-msgdb + (not disable-killed) t)) ; in-msgdb expunged) (erase-buffer) (message "Re-scanning...") @@ -959,6 +913,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (setq wl-thread-entity-hashtb (elmo-make-hash (* num 2)) wl-thread-entity-list nil wl-thread-entities nil + wl-summary-scored nil wl-summary-buffer-number-list nil wl-summary-buffer-target-mark-list nil wl-summary-buffer-temp-mark-list nil @@ -994,7 +949,6 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (wl-thread-insert-top) (message "Inserting thread...done"))) (when wl-use-scoring - (setq wl-summary-scored nil) (wl-summary-score-headers (wl-summary-rescore-msgs wl-summary-buffer-number-list) t) @@ -1050,7 +1004,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." "folder mode")) (defun wl-summary-set-message-modified () - (elmo-folder-set-message-modified-internal + (elmo-folder-set-message-modified wl-summary-buffer-elmo-folder t) (setq wl-summary-buffer-message-modified t) (wl-summary-set-mark-modified)) @@ -1182,7 +1136,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (defun wl-summary-sync-force-update (&optional unset-cursor no-check) (interactive) - (wl-summary-sync-update unset-cursor nil no-check)) + (wl-summary-sync-update unset-cursor nil nil no-check)) (defsubst wl-summary-sync-all-init () (wl-summary-cleanup-temp-marks) @@ -1206,30 +1160,33 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (msgdb-dir (elmo-folder-msgdb-path folder)) (range (or force-range (wl-summary-input-range (elmo-folder-name-internal folder))))) - (cond ((string= range "rescan") - (let ((msg (wl-summary-message-number))) - (wl-summary-rescan) - (and msg (wl-summary-jump-to-msg msg)))) - ((string= range "rescan-noscore") + (cond ((string-match "rescan" range) (let ((msg (wl-summary-message-number)) - wl-use-scoring) - (wl-summary-rescan) + (wl-use-scoring (if (string-match "noscore" range) + nil + wl-use-scoring))) + (wl-summary-rescan nil + (string-match "noscore" range)) + (and msg (wl-summary-jump-to-msg msg)))) + ((string= range "mark") + (let ((msg (wl-summary-message-number))) + (call-interactively 'wl-summary-sync-marks) (and msg (wl-summary-jump-to-msg msg)))) ((string= range "cache-status") (let ((msg (wl-summary-message-number))) (wl-summary-resume-cache-status) (and msg (wl-summary-jump-to-msg msg)))) - ((or (string-match "last:" range) - (string-match "first:" range)) + ((string= range "no-sync")) + ((or (string-match "^last:" range) + (string-match "^first:" range)) (wl-summary-goto-folder-subr (concat "/" range "/" (elmo-folder-name-internal folder)) - 'force-update nil nil t)) + 'force-update nil nil t)) (t (wl-summary-sync-update unset-cursor - (cond ((string= range "all") 'all) - ((string= range "all-visible") - 'visible-only))))))) + (string-match "entirely" range) + (string-match "all" range)))))) (defvar wl-summary-edit-addresses-candidate-fields ;; First element becomes default. @@ -1358,13 +1315,11 @@ If ARG is non-nil, checking is omitted." wl-summary-incorporate-marks)) (defun wl-summary-prefetch-msg (number &optional arg) - "Returns status-mark. if skipped, returns nil." + "Prefetch message and return non-nil value. If skipped, return nil." ;; prefetching procedure. (save-excursion (let* ((size (elmo-message-field wl-summary-buffer-elmo-folder number 'size)) - (inhibit-read-only t) - (buffer-read-only nil) (file-cached (elmo-file-cache-exists-p (elmo-message-field wl-summary-buffer-elmo-folder number 'message-id))) @@ -1400,8 +1355,6 @@ If ARG is non-nil, checking is omitted." "??")))))) " ]") size)))) (message "")) ; flush. - (setq mark (or (elmo-message-mark wl-summary-buffer-elmo-folder - number) " ")) (if force-read (save-excursion (save-match-data @@ -1412,18 +1365,17 @@ If ARG is non-nil, checking is omitted." number)) (elmo-message-set-cached wl-summary-buffer-elmo-folder number t) - (setq new-mark - (or (elmo-message-mark wl-summary-buffer-elmo-folder - number) - " ")) - (unless (string= new-mark mark) + (when (and (wl-summary-jump-to-msg number) + (wl-summary-update-persistent-mark)) + (sit-for 0) (wl-summary-count-unread) (wl-summary-update-modeline) (wl-folder-update-unread (wl-summary-buffer-folder-name) (+ wl-summary-buffer-unread-count wl-summary-buffer-new-count)))) - new-mark))))))) + t) + nil)))))) (defun wl-summary-prefetch-region-no-mark (beg end &optional prefetch-marks) (interactive "r") @@ -1463,30 +1415,15 @@ If ARG is non-nil, checking is omitted." (setq length (length targets)) (message "Prefetching...") (while targets - (setq mark (if (not (wl-thread-entity-parent-invisible-p - (wl-thread-get-entity (car targets)))) - (progn - (wl-summary-jump-to-msg (car targets)) - (wl-summary-prefetch-msg - (wl-summary-message-number))) - (wl-summary-prefetch-msg (car targets)))) - (if (if prefetch-marks - (string= mark elmo-msgdb-unread-cached-mark) - (or (string= mark elmo-msgdb-unread-cached-mark) - (string= mark " "))) - (message "Prefetching... %d/%d message(s)" - (setq count (+ 1 count)) length)) - ;; redisplay! - (when mark - (save-excursion - (setq pos (point)) - (when (wl-summary-jump-to-msg (car targets)) - (wl-summary-update-mark (car targets))) - (goto-char start-pos) - (if (pos-visible-in-window-p pos) - (save-restriction - (widen) - (sit-for 0))))) + (when (if (not (wl-thread-entity-parent-invisible-p + (wl-thread-get-entity (car targets)))) + (progn + (wl-summary-jump-to-msg (car targets)) + (wl-summary-prefetch-msg + (wl-summary-message-number))) + (wl-summary-prefetch-msg (car targets))) + (message "Prefetching... %d/%d message(s)" + (setq count (+ 1 count)) length)) (setq targets (cdr targets))) (message "Prefetched %d/%d message(s)" count length) (cons count length))))) @@ -1574,7 +1511,7 @@ If ARG is non-nil, checking is omitted." (setq children (delq number (wl-thread-get-children-msgs number))) (while children - (wl-thread-msg-mark-as-important (car children)) + (wl-summary-mark-as-important (car children)) (setq children (cdr children)))) (forward-line 1)))) (while (not (eobp)) @@ -1587,12 +1524,8 @@ If ARG is non-nil, checking is omitted." (interactive) (if (or (not (interactive-p)) (y-or-n-p "Mark all messages as read? ")) - (let* ((folder wl-summary-buffer-elmo-folder) - (cur-buf (current-buffer)) - (inhibit-read-only t) - (buffer-read-only nil) - (case-fold-search nil) - msg mark new-mark) + (let ((folder wl-summary-buffer-elmo-folder) + (cur-buf (current-buffer))) (message "Setting all msgs as read...") (elmo-folder-mark-as-read folder (elmo-folder-list-unreads @@ -1600,80 +1533,47 @@ If ARG is non-nil, checking is omitted." (save-excursion (goto-char (point-min)) (while (not (eobp)) - (setq msg (wl-summary-message-number) - mark (wl-summary-persistent-mark) - new-mark (or (elmo-message-mark folder msg) " ")) - (unless (string= mark new-mark) - (delete-backward-char 1) - ;; New mark and unread-uncached mark - (insert new-mark) - (if wl-summary-highlight - (wl-highlight-summary-current-line))) + (wl-summary-update-persistent-mark) (forward-line 1))) (wl-folder-update-unread (wl-summary-buffer-folder-name) 0) (setq wl-summary-buffer-unread-count 0) (setq wl-summary-buffer-new-count 0) (wl-summary-update-modeline) - (message "Setting all msgs as read...done") - (set-buffer-modified-p nil)))) + (message "Setting all msgs as read...done")))) (defun wl-summary-delete-cache () "Delete cache of current message." (interactive) (save-excursion - (let* ((inhibit-read-only t) - (buffer-read-only nil) - (folder wl-summary-buffer-elmo-folder) - (case-fold-search nil) - new-mark mark number unread) + (let* ((folder wl-summary-buffer-elmo-folder) + number) (setq number (wl-summary-message-number)) (elmo-message-set-cached folder number nil) - (setq new-mark (elmo-message-mark folder number) - mark (wl-summary-persistent-mark)) - (unless (string= new-mark mark) - (delete-backward-char 1) - (insert new-mark) + (when (wl-summary-update-persistent-mark) (elmo-file-cache-delete (elmo-file-cache-get-path (elmo-message-field wl-summary-buffer-elmo-folder number - 'message-id))) - (if wl-summary-highlight - (wl-highlight-summary-current-line)) - (set-buffer-modified-p nil))))) + 'message-id))))))) (defun wl-summary-resume-cache-status () "Resume the cache status of all messages in the current folder." (interactive) (let ((folder wl-summary-buffer-elmo-folder) - (buffer-read-only nil) - (case-fold-search nil) - number msgid set-mark mark) + number msgid) (message "Resuming cache status...") (save-excursion (goto-char (point-min)) (while (not (eobp)) (setq number (wl-summary-message-number)) - (setq mark (wl-summary-persistent-mark)) (setq msgid (elmo-message-field folder number 'message-id)) - (setq set-mark nil) - (if (elmo-file-cache-exists-p msgid) - (when (member mark (elmo-msgdb-uncached-marks)) - (elmo-message-set-cached folder number t) - (setq set-mark (elmo-message-mark folder number))) - (unless (member mark (elmo-msgdb-uncached-marks)) - (elmo-message-set-cached folder number nil) - (setq set-mark (or (elmo-message-mark folder number) " ")))) - (when set-mark - (delete-backward-char 1) - (insert set-mark) - (if wl-summary-highlight - (wl-highlight-summary-current-line))) + (elmo-message-set-cached folder number + (elmo-file-cache-exists-p msgid)) + (wl-summary-update-persistent-mark) (forward-line 1)) (wl-summary-count-unread) (wl-summary-update-modeline) - (message "Resuming cache status...done") - (set-buffer-modified-p nil)))) + (message "Resuming cache status...done")))) (defun wl-summary-delete-messages-on-buffer (msgs &optional deleting-info) (interactive) @@ -1720,38 +1620,14 @@ If ARG is non-nil, checking is omitted." (+ wl-summary-buffer-unread-count wl-summary-buffer-new-count) (elmo-folder-length wl-summary-buffer-elmo-folder)))))) -(defun wl-summary-replace-status-marks (before after) - "Replace the status marks on buffer." - (save-excursion - (goto-char (point-min)) - (let ((inhibit-read-only t) - (buffer-read-only nil)) - (while (not (eobp)) - (when (string= (wl-summary-persistent-mark) before) - (delete-backward-char 1) - (insert after) - (if wl-summary-highlight - (wl-highlight-summary-current-line))) - (forward-line 1))))) - (defun wl-summary-update-status-marks () "Synchronize status marks on current buffer to the msgdb." (interactive) (save-excursion (goto-char (point-min)) - (let ((inhibit-read-only t) - (buffer-read-only nil) - mark) - (while (not (eobp)) - (unless (string= (wl-summary-persistent-mark) - (setq mark (or (elmo-message-mark - wl-summary-buffer-elmo-folder - (wl-summary-message-number)) - " "))) - (delete-backward-char 1) - (insert mark) - (if wl-summary-highlight (wl-highlight-summary-current-line))) - (forward-line 1))))) + (while (not (eobp)) + (wl-summary-update-persistent-mark) + (forward-line 1)))) (defun wl-summary-insert-message (&rest args) (if (eq wl-summary-buffer-view 'thread) @@ -1800,7 +1676,7 @@ If ARG is non-nil, checking is omitted." (setq mes (format "Updated (-%d" (length diffs))) (while diffs (wl-summary-mark-as-important (car diffs) - elmo-msgdb-important-mark + wl-summary-important-mark 'no-server) (setq diffs (cdr diffs))) (setq diffs (car diff)) ; important-appends @@ -1819,7 +1695,7 @@ If ARG is non-nil, checking is omitted." (wl-summary-mark-as-unanswered (car diffs) 'no-modeline) (setq diffs (cdr diffs))) (setq diffs (car diff)) ; unread-appends - (setq mes (concat mes (format "/+%d) answered mark(s)." (length diffs)))) + (setq mes (concat mes (format "/+%d) answered mark(s)," (length diffs)))) (while diffs (wl-summary-mark-as-answered (car diffs) 'no-modeline) (setq diffs (cdr diffs))) @@ -1840,11 +1716,13 @@ If ARG is non-nil, checking is omitted." (setq diffs (cdr diffs))) (if (interactive-p) (message "%s" mes))))) -(defun wl-summary-sync-update (&optional unset-cursor sync-all no-check) +(defun wl-summary-sync-update (&optional unset-cursor + disable-killed + sync-all + no-check) "Update the summary view to the newest folder status." (interactive) (let* ((folder wl-summary-buffer-elmo-folder) - (case-fold-search nil) (elmo-mime-charset wl-summary-buffer-mime-charset) (inhibit-read-only t) (buffer-read-only nil) @@ -1864,19 +1742,22 @@ If ARG is non-nil, checking is omitted." ;;(wl-summary-flush-pending-append-operations seen-list)) (goto-char (point-max)) (wl-folder-confirm-existence folder (elmo-folder-plugged-p folder)) - (setq crossed (elmo-folder-synchronize folder sync-all no-check)) + (setq crossed (elmo-folder-synchronize folder + disable-killed + sync-all + no-check)) (if crossed (progn ;; Setup sync-all (if sync-all (wl-summary-sync-all-init)) (setq diff (elmo-list-diff (elmo-folder-list-messages folder - 'visible-only + (not disable-killed) 'in-msgdb) wl-summary-buffer-number-list)) (setq append-list (car diff)) (setq delete-list (cadr diff)) - + (when delete-list (wl-summary-delete-messages-on-buffer delete-list)) (wl-summary-update-status-marks) @@ -1990,7 +1871,6 @@ If ARG is non-nil, checking is omitted." wl-summary-partial-highlight-above-lines wl-summary-highlight-partial-threshold))) (wl-highlight-summary (point) (point-max)))))) - (setq wl-summary-buffer-msgdb (elmo-folder-msgdb folder)) (wl-delete-all-overlays) (set-buffer-modified-p nil) (if mes (message "%s" mes))))) @@ -1998,17 +1878,11 @@ If ARG is non-nil, checking is omitted." (defun wl-summary-set-score-mark (mark) (save-excursion (beginning-of-line) - (let ((inhibit-read-only t) - (buffer-read-only nil) - msg-num - cur-mark) - (setq msg-num (wl-summary-message-number)) - (setq cur-mark (wl-summary-temp-mark)) + (let ((cur-mark (wl-summary-temp-mark))) (when (member cur-mark (list " " wl-summary-score-below-mark wl-summary-score-over-mark)) - (delete-backward-char 1) - (insert mark) + (wl-summary-put-temp-mark mark) (if wl-summary-highlight (wl-highlight-summary-current-line)) (set-buffer-modified-p nil))))) @@ -2076,8 +1950,7 @@ If ARG is non-nil, checking is omitted." (length dels))) (progn (message "Deleting...") - (elmo-folder-delete-messages - wl-summary-buffer-elmo-folder dels) + (elmo-folder-delete-messages wl-summary-buffer-elmo-folder dels) (elmo-folder-detach-messages wl-summary-buffer-elmo-folder dels) (wl-summary-set-message-modified) (wl-folder-set-folder-updated (wl-summary-buffer-folder-name) @@ -2190,7 +2063,6 @@ If ARG, without confirm." wl-summary-buffer-message-modified wl-summary-buffer-thread-modified wl-summary-buffer-number-list - wl-summary-buffer-msgdb wl-summary-buffer-folder-name wl-summary-buffer-line-formatter) (and (eq wl-summary-buffer-view 'thread) @@ -2256,11 +2128,9 @@ If ARG, without confirm." (defun wl-summary-auto-select-msg-p (unread-msg) (and unread-msg - (not (string= - (elmo-message-mark - wl-summary-buffer-elmo-folder - unread-msg) - elmo-msgdb-important-mark)))) + (not (elmo-message-flagged-p wl-summary-buffer-elmo-folder + unread-msg + 'important)))) (defsubst wl-summary-open-folder (folder) ;; Select folder @@ -2268,7 +2138,6 @@ If ARG, without confirm." (unwind-protect (elmo-folder-open folder 'load-msgdb) ;; For compatibility - (setq wl-summary-buffer-msgdb (elmo-folder-msgdb folder)) (setq wl-summary-buffer-folder-name (elmo-folder-name-internal folder))))) @@ -2319,8 +2188,7 @@ If ARG, without confirm." (setq wl-summary-buffer-disp-msg nil) (setq wl-summary-buffer-last-displayed-msg nil) (setq wl-summary-buffer-current-msg nil) - (let ((case-fold-search nil) - (inhibit-read-only t) + (let ((inhibit-read-only t) (buffer-read-only nil)) (erase-buffer) ;; Resume summary view @@ -2375,6 +2243,8 @@ If ARG, without confirm." ((eq scan-type 'all) (wl-summary-sync 'unset-cursor "all")) ((eq scan-type 'no-sync)) + ((eq scan-type 'rescan) + (wl-summary-rescan)) ((or (eq scan-type 'force-update) (eq scan-type 'update)) (setq mes (wl-summary-sync-force-update @@ -2496,24 +2366,26 @@ If ARG, without confirm." (defun wl-summary-insert-sequential (entity folder &rest args) (let ((inhibit-read-only t) + (number (elmo-message-entity-number entity)) buffer-read-only) (goto-char (point-max)) (wl-summary-insert-line (wl-summary-create-line entity nil nil - (elmo-message-mark - folder - (elmo-message-entity-number - entity)))) + (elmo-message-flags + wl-summary-buffer-elmo-folder + number) + (elmo-message-cached-p + wl-summary-buffer-elmo-folder + number))) (setq wl-summary-buffer-number-list (wl-append wl-summary-buffer-number-list (list (elmo-message-entity-number entity)))) nil)) (defun wl-summary-default-subject-filter (subject) - (let ((case-fold-search t)) - (setq subject (elmo-replace-in-string subject "[ \t]*\\(re\\|was\\)[:>]" "")) - (setq subject (elmo-replace-in-string subject "[ \t]" "")) - (elmo-replace-in-string subject "^\\[.*\\]" ""))) + (setq subject (elmo-replace-in-string subject "[ \t]*\\(re\\|was\\)[:>]" "")) + (setq subject (elmo-replace-in-string subject "[ \t]" "")) + (elmo-replace-in-string subject "^\\[.*\\]" "")) (defun wl-summary-subject-equal (subject1 subject2) (string= (funcall wl-summary-subject-filter-function subject1) @@ -2529,7 +2401,7 @@ If ARG, without confirm." wl-summary-alike-hashtb))) (defun wl-summary-insert-headers (folder func mime-decode) - (let ((numbers (elmo-folder-list-messages folder t t)) + (let ((numbers (elmo-folder-list-messages folder nil t)) ov this last alike) (buffer-disable-undo (current-buffer)) (make-local-variable 'wl-summary-alike-hashtb) @@ -2610,8 +2482,7 @@ If ARG, without confirm." (defun wl-summary-insert-thread (entity folder update &optional force-insert) - (let ((case-fold-search t) - (depth 0) + (let ((depth 0) this-id parent-entity parent-number relatives anumber cur number cur-entity linked retval delayed-entity update-list entity-stack) @@ -2705,23 +2576,18 @@ If ARG, without confirm." entity parent-entity nil - (elmo-message-mark wl-summary-buffer-elmo-folder number) + (elmo-message-flags wl-summary-buffer-elmo-folder number) + (elmo-message-cached-p wl-summary-buffer-elmo-folder number) (wl-thread-maybe-get-children-num number) (wl-thread-make-indent-string thr-entity) (wl-thread-entity-get-linked thr-entity))))))) (defun wl-summary-target-mark-msgs (msgs) "Return the number of marked messages." - (let ((i 0) num) - (while msgs - (if (eq wl-summary-buffer-view 'thread) - (wl-thread-jump-to-msg (car msgs)) - (wl-summary-jump-to-msg (car msgs))) - (setq num (wl-summary-message-number)) - (when (eq num (car msgs)) - (wl-summary-target-mark num) - (setq i (1+ i))) - (setq msgs (cdr msgs))) + (let ((i 0)) + (dolist (number msgs) + (when (wl-summary-target-mark number) + (setq i (1+ i)))) i)) (defun wl-summary-pick (&optional from-list delete-marks) @@ -2776,17 +2642,18 @@ If ARG, exit virtual folder." 'update nil nil t) (run-hooks 'wl-summary-virtual-hook))) -(defun wl-summary-delete-all-temp-marks (&optional no-msg) +(defun wl-summary-delete-all-temp-marks (&optional no-msg force) "Erase all temp marks from buffer." (interactive) (when (or wl-summary-buffer-target-mark-list - wl-summary-buffer-temp-mark-list) + wl-summary-buffer-temp-mark-list + wl-summary-scored) (save-excursion (goto-char (point-min)) (unless no-msg (message "Unmarking...")) (while (not (eobp)) - (wl-summary-unset-mark) + (wl-summary-unset-mark nil nil force) (forward-line 1)) (unless no-msg (message "Unmarking...done")) @@ -2794,24 +2661,67 @@ If ARG, exit virtual folder." (setq wl-summary-buffer-temp-mark-list nil)))) (defsubst wl-summary-temp-mark () - "Move to the temp-mark column and return mark string." - (move-to-column wl-summary-buffer-temp-mark-column) - (buffer-substring (- (point) 1) (point))) + "Return temp-mark string of current line." + (let ((number (wl-summary-message-number)) + info) + (or (and (wl-summary-have-target-mark-p number) + "*") + (and (setq info (wl-summary-registered-temp-mark number)) + (nth 1 info)) + (wl-summary-get-score-mark number) + " "))) + +(defsubst wl-summary-persistent-mark-string (folder flags cached) + "Return the persistent mark string. +The mark is decided according to the FOLDER, FLAGS and CACHED." + (let ((priorities wl-summary-flag-priority-list) + mark) + (while (and (null mark) priorities) + (when (memq (car priorities) flags) + (setq mark + (case (car priorities) + (new + wl-summary-new-mark) + (important + wl-summary-important-mark) + (answered + (if cached + wl-summary-answered-cached-mark + wl-summary-answered-uncached-mark)) + (unread + (if cached + wl-summary-unread-cached-mark + wl-summary-unread-uncached-mark))))) + (setq priorities (cdr priorities))) + (or mark + (if (or cached (elmo-folder-local-p folder)) + nil + wl-summary-read-uncached-mark)))) + +(defsubst wl-summary-message-mark (folder number) + "Return mark of the message." + (ignore-errors + (wl-summary-persistent-mark-string + folder + (elmo-message-flags folder number) + (elmo-message-cached-p folder number)))) (defsubst wl-summary-persistent-mark () - "Move to the persistent-mark column and return mark string." - (move-to-column wl-summary-buffer-persistent-mark-column) - (buffer-substring (- (point) 1) (point))) - -(defun wl-summary-mark-line (mark) - "Put MARK on current line." - (save-excursion - (beginning-of-line) - (let ((inhibit-read-only t) - (buffer-read-only nil)) - (wl-summary-temp-mark) ; mark - (delete-backward-char 1) - (insert mark)))) + "Return persistent-mark string of current line." + (or (wl-summary-message-mark wl-summary-buffer-elmo-folder + (wl-summary-message-number)) + " ")) + +(defun wl-summary-put-temp-mark (mark) + "Put temp MARK on current line." + (when wl-summary-buffer-temp-mark-column + (save-excursion + (beginning-of-line) + (let ((inhibit-read-only t) + (buffer-read-only nil)) + (move-to-column wl-summary-buffer-temp-mark-column) + (delete-backward-char 1) + (insert mark))))) (defun wl-summary-next-buffer () "Switch to next summary buffer." @@ -2842,28 +2752,10 @@ If ARG, exit virtual folder." (let ((inhibit-read-only t) (buffer-read-only nil) wl-summary-buffer-disp-msg - number mlist) - (while (not (eobp)) - (when (string= (wl-summary-temp-mark) "*") - ;; delete target-mark from buffer. - (delete-backward-char 1) - (insert " ") - (setq number (wl-summary-message-number)) - (setq mlist (append mlist (list number))) - (if wl-summary-highlight - (wl-highlight-summary-current-line)) - (if number - (setq wl-summary-buffer-target-mark-list - (delq number wl-summary-buffer-target-mark-list)))) - (forward-line 1)) - (wl-summary-mark-as-read mlist) - ;; closed - (when (setq mlist wl-summary-buffer-target-mark-list) - (wl-summary-mark-as-read mlist) - (while mlist - (setq wl-summary-buffer-target-mark-list - (delq (car mlist) wl-summary-buffer-target-mark-list)) - (setq mlist (cdr mlist))))))) + (mlist wl-summary-buffer-temp-mark-list)) + (dolist (number mlist) + (wl-summary-unset-mark number)) + (wl-summary-mark-as-read mlist)))) (defun wl-summary-target-mark-mark-as-unread () (interactive) @@ -2872,27 +2764,10 @@ If ARG, exit virtual folder." (let ((inhibit-read-only t) (buffer-read-only nil) wl-summary-buffer-disp-msg - number mlist) - (while (not (eobp)) - (when (string= (wl-summary-temp-mark) "*") - (delete-backward-char 1) - (insert " ") - (setq number (wl-summary-message-number)) - (setq mlist (append mlist (list number))) - (if wl-summary-highlight - (wl-highlight-summary-current-line)) - (if number - (setq wl-summary-buffer-target-mark-list - (delq number wl-summary-buffer-target-mark-list)))) - (forward-line 1)) - (wl-summary-mark-as-unread mlist) - ;; closed - (when (setq mlist wl-summary-buffer-target-mark-list) - (wl-summary-mark-as-unread mlist) - (while mlist - (setq wl-summary-buffer-target-mark-list - (delq (car mlist) wl-summary-buffer-target-mark-list)) - (setq mlist (cdr mlist))))))) + (mlist wl-summary-buffer-target-mark-list)) + (dolist (number mlist) + (wl-summary-unset-mark number)) + (wl-summary-mark-as-unread mlist)))) (defun wl-summary-target-mark-mark-as-important () (interactive) @@ -2901,26 +2776,10 @@ If ARG, exit virtual folder." (let ((inhibit-read-only t) (buffer-read-only nil) wl-summary-buffer-disp-msg - number mlist) - (while (not (eobp)) - (when (string= (wl-summary-temp-mark) "*") - ;; delete target-mark from buffer. - (delete-backward-char 1) - (insert " ") - (setq number (wl-summary-mark-as-important)) - (if wl-summary-highlight - (wl-highlight-summary-current-line)) - (if number - (setq wl-summary-buffer-target-mark-list - (delq number wl-summary-buffer-target-mark-list)))) - (forward-line 1)) - (setq mlist wl-summary-buffer-target-mark-list) - (while mlist - (wl-summary-mark-as-important (car mlist)) - (wl-thread-msg-mark-as-important (car mlist)) - (setq wl-summary-buffer-target-mark-list - (delq (car mlist) wl-summary-buffer-target-mark-list)) - (setq mlist (cdr mlist))) + (mlist wl-summary-buffer-target-mark-list)) + (dolist (number mlist) + (wl-summary-unset-mark number) + (wl-summary-mark-as-important number)) (wl-summary-count-unread) (wl-summary-update-modeline)))) @@ -2935,43 +2794,47 @@ If ARG, exit virtual folder." (while (setq number (car wl-summary-buffer-target-mark-list)) (wl-thread-jump-to-msg number) (wl-summary-save t wl-save-dir) - (wl-summary-unmark number)))) + (wl-summary-unmark)))) (defun wl-summary-target-mark-pick () (interactive) (wl-summary-pick wl-summary-buffer-target-mark-list 'delete)) -(defun wl-summary-update-mark (&optional number) - "Synch up persistent mark of current line with msgdb's." - (let ((number (or number (wl-summary-message-number))) - buffer-read-only cur-mark) - (setq cur-mark (elmo-message-mark wl-summary-buffer-elmo-folder number)) - (save-excursion - ;; set mark on buffer - (unless (string= (wl-summary-persistent-mark) cur-mark) - (delete-backward-char 1) - (insert (or cur-mark " "))) - (when wl-summary-highlight - (wl-highlight-summary-current-line)) - (set-buffer-modified-p nil)))) +(defun wl-summary-update-persistent-mark () + "Synch up persistent mark of current line with msgdb's. +Return non-nil if the mark is updated" + (if wl-summary-buffer-persistent-mark-column + (save-excursion + (move-to-column wl-summary-buffer-persistent-mark-column) + (let ((inhibit-read-only t) + (buffer-read-only nil) + (mark (buffer-substring (- (point) 1) (point))) + (new-mark (wl-summary-persistent-mark))) + (unless (string= new-mark mark) + (delete-backward-char 1) + (insert new-mark)) + (when wl-summary-highlight + (wl-highlight-summary-current-line)) + (set-buffer-modified-p nil) + t)) + (when wl-summary-highlight + (wl-highlight-summary-current-line)) + (set-buffer-modified-p nil))) (defsubst wl-summary-mark-as-read-internal (inverse number-or-numbers no-folder-mark no-modeline-update) (save-excursion - (let ((inhibit-read-only t) - (buffer-read-only nil) - (folder wl-summary-buffer-elmo-folder) - (case-fold-search nil) + (let ((folder wl-summary-buffer-elmo-folder) unread-message number - number-list mark visible new-mark) + number-list visible) (setq number-list (cond ((numberp number-or-numbers) (setq unread-message - (member (elmo-message-mark - folder - number-or-numbers) - (elmo-msgdb-unread-marks))) + (elmo-message-flagged-p + folder + number-or-numbers + 'unread)) (list number-or-numbers)) ((and (not (null number-or-numbers)) (listp number-or-numbers)) @@ -2979,8 +2842,10 @@ If ARG, exit virtual folder." ((setq number (wl-summary-message-number)) ;; interactive (setq unread-message - (member (elmo-message-mark folder number) - (elmo-msgdb-unread-marks))) + (elmo-message-flagged-p + folder + number + 'unread)) (list number)))) (if (null number-list) (message "No message.") @@ -2988,19 +2853,13 @@ If ARG, exit virtual folder." (elmo-folder-unmark-read folder number-list no-folder-mark) (elmo-folder-mark-as-read folder number-list no-folder-mark)) (dolist (number number-list) - (setq visible (wl-summary-jump-to-msg number) - new-mark (elmo-message-mark folder number)) + (setq visible (wl-summary-jump-to-msg number)) (unless inverse (when unread-message (run-hooks 'wl-summary-unread-message-hook))) ;; set mark on buffer (when visible - (unless (string= (wl-summary-persistent-mark) (or new-mark " ")) - (delete-backward-char 1) - (insert (or new-mark " "))) - (if (and visible wl-summary-highlight) - (wl-highlight-summary-current-line)) - (set-buffer-modified-p nil))) + (wl-summary-update-persistent-mark))) (unless no-modeline-update ;; Update unread numbers. ;; should elmo-folder-mark-as-read return unread numbers? @@ -3033,11 +2892,8 @@ If ARG, exit virtual folder." number-or-numbers no-modeline-update) (save-excursion - (let ((inhibit-read-only t) - (buffer-read-only nil) - (folder wl-summary-buffer-elmo-folder) - (case-fold-search nil) - number number-list mark visible new-mark) + (let ((folder wl-summary-buffer-elmo-folder) + number number-list visible) (setq number-list (cond ((numberp number-or-numbers) (list number-or-numbers)) ((and (not (null number-or-numbers)) @@ -3052,16 +2908,10 @@ If ARG, exit virtual folder." (elmo-folder-unmark-answered folder number-list) (elmo-folder-mark-as-answered folder number-list)) (dolist (number number-list) - (setq visible (wl-summary-jump-to-msg number) - new-mark (elmo-message-mark folder number)) + (setq visible (wl-summary-jump-to-msg number)) ;; set mark on buffer (when visible - (unless (string= (wl-summary-persistent-mark) (or new-mark " ")) - (delete-backward-char 1) - (insert (or new-mark " "))) - (if (and visible wl-summary-highlight) - (wl-highlight-summary-current-line)) - (set-buffer-modified-p nil))) + (wl-summary-update-persistent-mark))) (unless no-modeline-update ;; Update unread numbers. ;; should elmo-folder-mark-as-read return unread numbers? @@ -3077,9 +2927,9 @@ If ARG, exit virtual folder." (interactive) (wl-summary-mark-as-answered-internal (and (interactive-p) - (member (elmo-message-mark wl-summary-buffer-elmo-folder - (wl-summary-message-number)) - (elmo-msgdb-answered-marks))) + (elmo-message-flagged-p wl-summary-buffer-elmo-folder + (wl-summary-message-number) + 'answered)) number-or-numbers no-modeline-update)) @@ -3097,70 +2947,53 @@ If ARG, exit virtual folder." 'internal) (error "Cannot process mark in this folder")) (save-excursion - (let* (eol - (inhibit-read-only t) - (buffer-read-only nil) - (folder wl-summary-buffer-elmo-folder) - message-id visible cur-mark) - (if number - (progn - (setq visible (wl-summary-jump-to-msg number)) - (setq mark (or mark (elmo-message-mark - wl-summary-buffer-elmo-folder number)))) - (setq visible t)) - (when visible - (if (null (setq number (wl-summary-message-number))) + (let* ((folder wl-summary-buffer-elmo-folder) + message-id visible cur-mark) + (cond (number + (setq visible (wl-summary-jump-to-msg number)) + (setq cur-mark (or mark + (wl-summary-message-mark + wl-summary-buffer-elmo-folder number) + " "))) + ((setq number (wl-summary-message-number)) + (setq visible t) + (setq cur-mark (or mark (wl-summary-persistent-mark)))) + (t + (error "No message"))) + (when (or visible + ;; already exists in msgdb. + (elmo-message-entity wl-summary-buffer-elmo-folder + number)) + (setq message-id (elmo-message-field + wl-summary-buffer-elmo-folder + number + 'message-id)) + (if (string= cur-mark wl-summary-important-mark) (progn - (message "No message.") - (setq visible nil)) - (end-of-line) - (setq eol (point)) - (wl-summary-goto-previous-message-beginning))) - (if (or (and (not visible) - ;; already exists in msgdb. - (elmo-message-entity wl-summary-buffer-elmo-folder - number)) - (setq cur-mark (wl-summary-persistent-mark))) - (progn - (setq number (or number (wl-summary-message-number))) - (setq mark (or mark cur-mark)) - (setq message-id (elmo-message-field - wl-summary-buffer-elmo-folder - number - 'message-id)) - (if (string= mark elmo-msgdb-important-mark) - (progn - ;; server side mark - (save-match-data - (elmo-folder-unmark-important folder (list number) - no-server-update) - (unless no-server-update - (elmo-msgdb-global-mark-delete message-id)) - ;; Remove cache if local folder. - (if (and (elmo-folder-local-p folder) - (not (eq 'mark - (elmo-folder-type-internal folder)))) - (elmo-file-cache-delete - (elmo-file-cache-get-path message-id)))) - (when visible - (delete-backward-char 1) - (insert (or (elmo-message-mark folder number) " ")))) ;; server side mark - (elmo-folder-mark-as-important folder (list number) - no-server-update) - (when visible - (delete-backward-char 1) - (insert elmo-msgdb-important-mark)) - (if (eq (elmo-file-cache-exists-p message-id) 'entire) - (elmo-folder-mark-as-read folder (list number)) - ;; Force cache message. - (elmo-message-encache folder number 'read)) - (unless no-server-update - (elmo-msgdb-global-mark-set message-id - elmo-msgdb-important-mark))))) - (if (and visible wl-summary-highlight) - (wl-highlight-summary-current-line)))) - (set-buffer-modified-p nil) + (save-match-data + (elmo-folder-unmark-important folder (list number) + no-server-update) + (unless no-server-update + (elmo-msgdb-global-mark-delete message-id)) + ;; Remove cache if local folder. + (if (and (elmo-folder-local-p folder) + (not (eq 'mark + (elmo-folder-type-internal folder)))) + (elmo-file-cache-delete + (elmo-file-cache-get-path message-id))))) + ;; server side mark + (elmo-folder-mark-as-important folder (list number) + no-server-update) + (if (eq (elmo-file-cache-exists-p message-id) 'entire) + (elmo-folder-mark-as-read folder (list number)) + ;; Force cache message. + (elmo-message-encache folder number 'read)) + (unless no-server-update + (elmo-msgdb-global-mark-set message-id + elmo-msgdb-important-mark)))) + (when visible + (wl-summary-update-persistent-mark)))) number) ;;; Summary line. @@ -3279,17 +3112,22 @@ If ARG, exit virtual folder." (defun wl-summary-create-line (wl-message-entity wl-parent-message-entity wl-temp-mark - wl-persistent-mark + wl-flags + wl-cached &optional wl-thr-children-number wl-thr-indent-string wl-thr-linked) "Create a summary line." (let ((wl-mime-charset wl-summary-buffer-mime-charset) + (wl-persistent-mark (wl-summary-persistent-mark-string + wl-summary-buffer-elmo-folder + wl-flags + wl-cached)) (elmo-mime-charset wl-summary-buffer-mime-charset) (elmo-lang wl-summary-buffer-weekday-name-lang) (wl-datevec (or (ignore-errors (timezone-fix-time - (elmo-msgdb-overview-entity-get-date + (elmo-msgdb-overview-entity-get-date wl-message-entity) nil wl-summary-fix-timezone)) @@ -3311,11 +3149,11 @@ If ARG, exit virtual folder." (setq line (concat line "\r" (number-to-string - (elmo-msgdb-overview-entity-get-number + (elmo-msgdb-overview-entity-get-number wl-message-entity)))) (if wl-summary-highlight (wl-highlight-summary-line-string line - wl-persistent-mark + wl-flags wl-temp-mark wl-thr-indent-string)) line)) @@ -3425,10 +3263,11 @@ If ARG, exit virtual folder." wl-summary-buffer-target-mark-list mark-list wl-summary-buffer-temp-mark-list temp-list wl-summary-buffer-temp-mark-column temp-column) - (wl-summary-delete-all-temp-marks 'no-msg) + (wl-summary-delete-all-temp-marks 'no-msg 'force) (encode-coding-region (point-min) (point-max) - (or (and wl-on-mule ; one in mcs-ltn1(apel<10.4) cannot take 2 arg. + (or (and wl-on-mule + ;; one in mcs-ltn1(apel<10.4) cannot take 2 arg. (mime-charset-to-coding-system charset 'LF)) ;; Mule 2 doesn't have `*ctext*unix'. (mime-charset-to-coding-system charset))) @@ -3456,9 +3295,17 @@ If ARG, exit virtual folder." (defun wl-summary-input-range (folder) "returns update or all or rescan." ;; for the case when parts are expanded in the bottom of the folder - (let ((input-range-list '("update" "all" "rescan" "first:" "last:" + (let ((input-range-list '("no-sync" + "first:" + "last:" "cache-status" - "no-sync" "rescan-noscore" "all-visible")) + "mark" + "rescan" + "rescan-noscore" + "update" + "update-entirely" + "all" + "all-entirely")) (default (or (wl-get-assoc-list-value wl-folder-sync-range-alist folder) @@ -3600,6 +3447,7 @@ If ARG, exit virtual folder." (wl-message-select-buffer wl-message-buffer) (delete-window) (select-window (get-buffer-window cur-buf)) + (setq wl-message-buffer nil) (run-hooks 'wl-summary-toggle-disp-off-hook)) ;;; (switch-to-buffer cur-buf) ))) @@ -3705,26 +3553,26 @@ Return t if message exists." start-point draft-buf) (wl-summary-jump-to-msg (car mlist)) - (wl-summary-reply arg t) - (goto-char (point-max)) - (setq start-point (point-marker)) - (setq draft-buf (current-buffer)) - (save-window-excursion - (while mlist - (set-buffer summary-buf) - (delete-other-windows) - (wl-summary-jump-to-msg (car mlist)) - (wl-summary-redisplay) - (set-buffer draft-buf) - (goto-char (point-max)) - (wl-draft-yank-original) - (setq mlist (cdr mlist))) - (goto-char start-point) - (save-excursion - (set-buffer summary-buf) - (wl-summary-delete-all-temp-marks))) - (wl-draft-reply-position wl-draft-reply-default-position) - (run-hooks 'wl-mail-setup-hook))) + (when (wl-summary-reply arg t) + (goto-char (point-max)) + (setq start-point (point-marker)) + (setq draft-buf (current-buffer)) + (save-window-excursion + (while mlist + (set-buffer summary-buf) + (delete-other-windows) + (wl-summary-jump-to-msg (car mlist)) + (wl-summary-redisplay) + (set-buffer draft-buf) + (goto-char (point-max)) + (wl-draft-yank-original) + (setq mlist (cdr mlist))) + (goto-char start-point) + (save-excursion + (set-buffer summary-buf) + (wl-summary-delete-all-temp-marks))) + (wl-draft-reply-position wl-draft-reply-default-position) + (run-hooks 'wl-mail-setup-hook)))) (defun wl-summary-reply-with-citation (&optional arg) (interactive "P") @@ -3928,21 +3776,26 @@ Reply to author if invoked with ARG." (let ((folder wl-summary-buffer-elmo-folder) (number (wl-summary-message-number)) (summary-buf (current-buffer)) + (winconf (current-window-configuration)) mes-buf) (when number (save-excursion (wl-summary-redisplay-internal folder number)) - (elmo-folder-mark-as-answered folder (list number)) - (wl-summary-update-mark number) (setq mes-buf wl-message-buffer) (wl-message-select-buffer wl-message-buffer) (set-buffer mes-buf) (goto-char (point-min)) - (when (setq mes-buf (wl-message-get-original-buffer)) - (wl-draft-reply mes-buf arg summary-buf number) - (wl-draft-reply-position wl-draft-reply-default-position) - (unless without-setup-hook - (run-hooks 'wl-mail-setup-hook))) + (condition-case err + (when (setq mes-buf (wl-message-get-original-buffer)) + (wl-draft-reply mes-buf arg summary-buf number) + (wl-draft-reply-position wl-draft-reply-default-position) + (unless without-setup-hook + (run-hooks 'wl-mail-setup-hook))) + (error (set-window-configuration winconf) + (signal (car err)(cdr err)))) + (with-current-buffer summary-buf + (elmo-folder-mark-as-answered folder (list number)) + (wl-summary-update-persistent-mark)) t))) (defun wl-summary-write () @@ -4043,28 +3896,18 @@ Use function list is `wl-summary-write-current-folder-functions'." (skip-tmark-regexp (wl-regexp-opt wl-summary-skip-mark-list)) (skip t) (column (current-column)) - skip-pmark-regexp goto-next next-entity finfo) - (if (elmo-folder-plugged-p wl-summary-buffer-elmo-folder) - () - (setq skip-pmark-regexp - (wl-regexp-opt (list " " - elmo-msgdb-unread-cached-mark - elmo-msgdb-important-mark)))) + goto-next next-entity finfo) (beginning-of-line) - (let (case-fold-search) - (while (and skip - (not (if downward (eobp) (bobp)))) - (if downward - (forward-line 1) - (forward-line -1)) - (setq skip (or (string-match skip-tmark-regexp - (save-excursion - (wl-summary-temp-mark))) - (and skip-pmark-regexp - (not (string-match - skip-pmark-regexp - (save-excursion - (wl-summary-persistent-mark))))))))) + (while (and skip + (not (if downward (eobp) (bobp)))) + (if downward + (forward-line 1) + (forward-line -1)) + (setq skip (or (string-match skip-tmark-regexp + (wl-summary-temp-mark)) + (not (elmo-message-accessible-p + wl-summary-buffer-elmo-folder + (wl-summary-message-number)))))) (if (if downward (eobp) (and (bobp) skip)) (setq goto-next t)) (if (or (eobp) (and (bobp) skip)) (goto-char start)) @@ -4247,11 +4090,12 @@ Use function list is `wl-summary-write-current-folder-functions'." 'leave))) (when (elmo-message-use-cache-p folder num) (elmo-message-set-cached folder num t)) - (if (member (elmo-message-mark wl-summary-buffer-elmo-folder - num) - (elmo-msgdb-unread-marks)) - (wl-summary-mark-as-read num no-folder-mark) - (wl-summary-update-mark)) + (ignore-errors + (if (elmo-message-flagged-p wl-summary-buffer-elmo-folder + num + 'unread) + (wl-summary-mark-as-read num no-folder-mark) + (wl-summary-update-persistent-mark))) (setq wl-summary-buffer-current-msg num) (when wl-summary-recenter (recenter (/ (- (window-height) 2) 2)) @@ -4289,7 +4133,10 @@ If ASK-CODING is non-nil, coding-system for the message is asked." (wl-message-redisplay fld num 'as-is (string= (elmo-folder-name-internal fld) wl-draft-folder)) - (wl-summary-mark-as-read num) + (ignore-errors + (if (elmo-message-flagged-p fld num 'unread) + (wl-summary-mark-as-read num); no-folder-mark) + (wl-summary-update-persistent-mark))) (setq wl-summary-buffer-current-msg num) (when wl-summary-recenter (recenter (/ (- (window-height) 2) 2)) @@ -4496,7 +4343,7 @@ If ASK-CODING is non-nil, coding-system for the message is asked." (let ((num (car wl-summary-buffer-target-mark-list))) (wl-thread-jump-to-msg num) (wl-summary-pipe-message-subr prefix command) - (wl-summary-unmark num)))))) + (wl-summary-unmark)))))) (defun wl-summary-pipe-message-subr (prefix command) (save-excursion @@ -4583,7 +4430,7 @@ If ASK-CODING is non-nil, coding-system for the message is asked." (let ((num (car wl-summary-buffer-target-mark-list))) (wl-thread-jump-to-msg num) (wl-summary-print-message) - (wl-summary-unmark num)))))) + (wl-summary-unmark)))))) (defun wl-summary-folder-info-update () (wl-folder-set-folder-updated diff --git a/wl/wl-thread.el b/wl/wl-thread.el index 5fe83ab..d844991 100644 --- a/wl/wl-thread.el +++ b/wl/wl-thread.el @@ -389,13 +389,16 @@ ENTITY is returned." (when (setq message-entity (elmo-message-entity wl-summary-buffer-elmo-folder msg)) - (wl-summary-insert-line + (wl-summary-insert-line (wl-summary-create-line message-entity (elmo-message-entity wl-summary-buffer-elmo-folder parent-msg) temp-mark - (elmo-message-mark wl-summary-buffer-elmo-folder msg) + (elmo-message-flags wl-summary-buffer-elmo-folder + msg) + (elmo-message-cached-p wl-summary-buffer-elmo-folder + msg) (if wl-thread-insert-force-opened nil (wl-thread-maybe-get-children-num msg)) @@ -731,14 +734,6 @@ Message is inserted to the summary buffer." (interactive "P") (wl-thread-call-region-func 'wl-summary-prefetch-region arg)) -(defun wl-thread-msg-mark-as-important (msg) - "Set mark as important for invisible MSG. Modeline is not changed." - (let ((folder wl-summary-buffer-elmo-folder) - cur-mark) - (setq cur-mark (elmo-message-mark folder msg)) - (elmo-folder-mark-as-important folder (list msg)) - (wl-summary-set-mark-modified))) - (defun wl-thread-mark-as-read (&optional arg) (interactive "P") (wl-thread-call-region-func 'wl-summary-mark-as-read-region arg)) @@ -824,7 +819,10 @@ Message is inserted to the summary buffer." (elmo-message-entity wl-summary-buffer-elmo-folder (nth 0 parent-entity)) temp-mark - (elmo-message-mark wl-summary-buffer-elmo-folder msg-num) + (elmo-message-flags wl-summary-buffer-elmo-folder + msg-num) + (elmo-message-cached-p wl-summary-buffer-elmo-folder + msg-num) (if wl-thread-insert-force-opened nil (wl-thread-maybe-get-children-num msg-num)) @@ -938,7 +936,7 @@ Message is inserted to the summary buffer." (while children-msgs (if (and (not (eq msg (car children-msgs))) ; except itself (or (and uncached-marks - (setq mark (elmo-message-mark + (setq mark (wl-summary-message-mark wl-summary-buffer-elmo-folder (car children-msgs))) (member mark uncached-marks)) diff --git a/wl/wl-util.el b/wl/wl-util.el index 723874d..ebc1894 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -539,11 +539,12 @@ that `read' can handle, whenever this is possible." (defmacro wl-concat-list (list separator) (` (mapconcat 'identity (delete "" (delq nil (, list))) (, separator)))) -(defmacro wl-current-message-buffer () - (` (save-excursion - (if (buffer-live-p wl-current-summary-buffer) - (set-buffer wl-current-summary-buffer)) - wl-message-buffer))) +(defun wl-current-message-buffer () + (when (buffer-live-p wl-current-summary-buffer) + (with-current-buffer wl-current-summary-buffer + (car (wl-message-buffer-display wl-summary-buffer-elmo-folder + (wl-summary-message-number) + 'mime))))) (defmacro wl-kill-buffers (regexp) (` (mapcar (function diff --git a/wl/wl-vars.el b/wl/wl-vars.el index bbd4bf6..fe8b8a5 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -340,49 +340,49 @@ If nil, never search search parent by subject." wl-summary-register-target-mark nil wl-highlight-summary-temp-face - "put target mark.") + "Put target mark.") ("d" dispose nil wl-summary-register-temp-mark wl-summary-exec-action-dispose wl-highlight-summary-disposed-face - "dispose messages according to `wl-dispose-folder-alist'.") + "Dispose messages according to `wl-dispose-folder-alist'.") ("D" delete nil wl-summary-register-temp-mark wl-summary-exec-action-delete wl-highlight-summary-deleted-face - "delete messages immediately.") + "Delete messages immediately.") ("o" refile wl-summary-get-refile-destination wl-summary-set-action-refile wl-summary-exec-action-refile wl-highlight-summary-refiled-face - "refile messages to the other folder.") + "Refile messages to the other folder.") ("O" copy wl-summary-get-copy-destination wl-summary-register-temp-mark wl-summary-exec-action-copy wl-highlight-summary-copied-face - "copy messages to the other folder.") + "Copy messages to the other folder.") ("i" prefetch nil wl-summary-register-temp-mark wl-summary-exec-action-prefetch wl-highlight-summary-prefetch-face - "prefetch messages.") + "Prefetch messages.") ("~" resend wl-summary-get-resend-address wl-summary-register-temp-mark wl-summary-exec-action-resend wl-highlight-summary-resend-face - )) + "Resend messages.")) "A variable to define Mark & Action. Each element of the list should be a list of \(MARK @@ -390,7 +390,8 @@ Each element of the list should be a list of ARGUMENT-FUNCTION SET-MARK-FUNCTION EXEC-FUNCTION - FACE) + FACE + DOC-STRING) MARK is a temporal mark string to define. SYMBOL is an action name to define. @@ -955,6 +956,49 @@ cdr of each cons cell is used for draft message." :type 'boolean :group 'wl-folder) +(defcustom wl-summary-flag-priority-list '(new important answered unread) + "List of flags reflected with the priority to a persistent mark." + :type '(repeat (radio (const :format "%v " new) + (const :format "%v " important) + (const :format "%v " answered) + (const :format "%v " unread))) + :group 'wl-summary) + +(defcustom wl-summary-new-mark "N" + "Mark for new message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-unread-uncached-mark "U" + "Mark for unread and uncached message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-unread-cached-mark "!" + "Mark for unread but already cached message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-read-uncached-mark "u" + "Mark for read but uncached message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-answered-cached-mark "&" + "Mark for answered and cached message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-answered-uncached-mark "A" + "Mark for answered but cached message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + +(defcustom wl-summary-important-mark "$" + "Mark for important message." + :type '(string :tag "Mark") + :group 'wl-summary-marks) + (defcustom wl-summary-score-over-mark "+" "Score mark used for messages with high scores." :type '(string :tag "Mark") @@ -1015,7 +1059,7 @@ This variable is local to the summary buffers." :group 'wl-score) (defcustom wl-summary-score-marks - (list elmo-msgdb-new-mark) + (list wl-summary-new-mark) "Persistent marks to scoring." :type '(repeat (string :tag "Mark")) :group 'wl-score) @@ -1690,6 +1734,12 @@ with wl-highlight-folder-many-face." :group 'wl-summary :group 'wl-pref) +(defcustom wl-summary-print-argument-within-window nil + "*If non-nil, always print argument right side of window." + :type 'boolean + :group 'wl-summary + :group 'wl-pref) + (defcustom wl-summary-pick-field-default "Body" "*Default field for pick." :type '(radio (const "From") @@ -1760,15 +1810,48 @@ This wrapper is generated by the mail system when rejecting a letter." :type 'regexp :group 'wl-draft) +(defcustom wl-draft-preview-attributes t + "Non-nil forces to preview the attributes in the `wl-draft-preview-message'. +Attributes specified in the `wl-draft-preview-attributes-list' are displayed." + :type 'boolean + :group 'wl-draft) + +(defcustom wl-draft-preview-attributes-list '(recipients + envelope-from + smtp-posting-server + smtp-posting-port) + "*Attribute symbols to display in the draft preview. +Candidates are following: +`recipients' +`envelope-from' +`smtp-posting-server' +`smtp-posting-port' +`nntp-posting-server' +`nntp-posting-port' +Also variables which begin with `wl-' can be specified +\(`wl-' have to be removed\)" + :type '(repeat symbol) + :group 'wl-draft) + +(defcustom wl-draft-preview-attributes-buffer-lines 5 + "*Buffer height for the draft attribute preview." + :type 'integer + :group 'wl-draft) + +(defcustom wl-draft-preview-attributes-buffer-name "*Preview Attributes*" + "*Buffer name for the draft attribute preview." + :type 'string + :group 'wl-draft) + (defcustom wl-refile-default-from-folder "+from" "*Folder name to refile by `wl-refile-guess-by-from'." :type '(string :tag "Folder") :group 'wl-pref) (defcustom wl-summary-auto-refile-skip-marks - (list elmo-msgdb-new-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-unread-cached-mark) + (list wl-summary-new-mark + wl-summary-unread-uncached-mark + wl-summary-unread-cached-mark) "Persistent marks to skip auto-refiling." :type '(repeat (string :tag "Mark")) :group 'wl-summary) @@ -1788,8 +1871,8 @@ the message is skipped at cursor move." :group 'wl-summary) (defcustom wl-summary-incorporate-marks - (list elmo-msgdb-new-mark - elmo-msgdb-unread-uncached-mark) + (list wl-summary-new-mark + wl-summary-unread-uncached-mark) "Persistent marks to prefetch at `wl-summary-incorporate'." :type '(repeat (string :tag "Mark")) :group 'wl-summary) @@ -2104,8 +2187,6 @@ e.x. (choice (const "update") (const "all") (const "rescan") - (const "first:") - (const "last:") (const "no-sync") (const :tag "none" nil)))) :group 'wl-pref) @@ -2115,8 +2196,6 @@ e.x. :type '(choice (const "update") (const "all") (const "rescan") - (const "first:") - (const "last:") (const "no-sync") (const :tag "none" nil)) :group 'wl-pref) @@ -2381,10 +2460,10 @@ ex. :group 'wl-expire) (defcustom wl-summary-expire-reserve-marks - (list elmo-msgdb-important-mark - elmo-msgdb-new-mark - elmo-msgdb-unread-uncached-mark - elmo-msgdb-unread-cached-mark) + (list wl-summary-important-mark + wl-summary-new-mark + wl-summary-unread-uncached-mark + wl-summary-unread-cached-mark) "Permanent marks of reserved message when expire. Don't reserve temporary mark message. @@ -2715,6 +2794,10 @@ a symbol `bitmap', `xbm' or `xpm' in order to force the image format." ;;;; Obsolete variables. +;; 2003-07-15 delete -> dispose +(elmo-define-obsolete-variable 'wl-delete-folder-alist + 'wl-dispose-folder-alist) + ;; 2002-12-25 (elmo-define-obsolete-variable 'wl-draft-reply-myself-with-argument-list 'wl-draft-reply-with-argument-list) diff --git a/wl/wl.el b/wl/wl.el index e076fa3..1aea805 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -786,17 +786,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." wl-message-buffer-cache-size)) (error (concat "`wl-message-buffer-prefetch-depth' must be smaller than " - "`wl-message-buffer-cache-size' - 1.")))) - (let (case-fold-search) - (unless (string-match "%T" wl-summary-line-format) - (error "`wl-summary-line-format' must contain %%T and %%P")) - (unless (string-match "%P" wl-summary-line-format) - (error "`wl-summary-line-format' must contain %%T and %%P")) - (dolist (pair wl-folder-summary-line-format-alist) - (unless (string-match "%T" (cdr pair)) - (error "Format `%s' must contain %%T and %%P" (cdr pair))) - (unless (string-match "%P" (cdr pair)) - (error "Format `%s' must contain %%T and %%P" (cdr pair)))))) + "`wl-message-buffer-cache-size' - 1."))))) ;;;###autoload (defun wl (&optional arg) -- 1.7.10.4