From bd7b094aadfdb27f7fd1ada42d817678eb391a3a Mon Sep 17 00:00:00 2001 From: dmaus Date: Sun, 5 Sep 2010 12:55:41 +0000 Subject: [PATCH] Merged trunk to elmo-imap4-compliance --- ChangeLog | 15 ++++++ INSTALL | 8 +-- INSTALL.ja | 8 +-- WL-MK | 25 +++++---- doc/wl-ja.texi | 24 +++++++++ doc/wl.texi | 24 ++++++++- elmo/ChangeLog | 53 ++++++++++++++++++- elmo/acap.el | 2 +- elmo/elmo-archive.el | 136 ++++++++++++++++++++++++------------------------- elmo/elmo-filter.el | 3 ++ elmo/elmo-imap4.el | 20 ++++---- elmo/elmo-localdir.el | 9 ++-- elmo/elmo-map.el | 3 ++ elmo/elmo-multi.el | 5 ++ elmo/elmo-pipe.el | 3 ++ elmo/elmo-pop3.el | 3 +- elmo/elmo-util.el | 86 +++++++++++++++---------------- elmo/elmo.el | 10 +++- elmo/utf7.el | 4 +- tests/ChangeLog | 6 +++ tests/test-dist.el | 41 +++++++++++++++ utils/ChangeLog | 25 +++++++++ utils/ptexinfmt.el | 7 ++- utils/rfc2368.el | 2 +- utils/ssl.el | 19 ++++--- utils/wl-addrbook.el | 18 +++---- utils/wl-complete.el | 14 ++--- wl/ChangeLog | 47 +++++++++++++++++ wl/wl-address.el | 2 +- wl/wl-draft.el | 2 +- wl/wl-e21.el | 54 +++++++++++--------- wl/wl-spam.el | 34 +++++++++++++ wl/wl-summary.el | 17 ++++--- wl/wl-xmas.el | 29 ++++++----- 34 files changed, 529 insertions(+), 229 deletions(-) diff --git a/ChangeLog b/ChangeLog index da8f88f..22bc186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2010-07-19 TAKAHASHI Kaoru + + * INSTALL: Update recommended version of APEL. + * INSTALL.ja: Ditto. + +2010-07-11 David Maus + + * doc/wl.texi (Variables of Summary): Replace unicode character. + +2010-04-29 Tetsurou Okazaki + + * WL-MK (uninstall-wl-icons): New function. Uninstall *.img + files as well. + (uninstall-wl-package): Use `uninstall-wl-icons'. + 2010-03-03 TAKAHASHI Kaoru * etc/icons/unplugged.xpm: Change design. Use `unplugged' style diff --git a/INSTALL b/INSTALL index 6728742..7e6ba67 100644 --- a/INSTALL +++ b/INSTALL @@ -34,24 +34,24 @@ Select MIME Module (a) XEmacs 21.1 or later - APEL 10.7, FLIM 1.14.9, SEMI 1.14.6 + APEL 10.8, FLIM 1.14.9, SEMI 1.14.6 Installation as a XEmacs package, If possible. (b) Emacs 20.4 or later - APEL 10.7, FLIM 1.14.9, SEMI 1.14.6 + APEL 10.8, FLIM 1.14.9, SEMI 1.14.6 (c) Emacs 20.1 to 20.3 - APEL 10.7, CLIME 1.14.6, SEMI 1.14.6 + APEL 10.8, CLIME 1.14.6, SEMI 1.14.6 Use CLIME instead of FLIM. FLIM does not support Emacs 20.3 or earlier. (d) Emacs 19.34 (Mule 2.3) - APEL 10.7, CLIME 1.14.6, SEMI 1.14.6 + APEL 10.8, CLIME 1.14.6, SEMI 1.14.6 Mule based on Emacs 19.34 can also run SEMI. See the following web page to get more information (in Japanese). diff --git a/INSTALL.ja b/INSTALL.ja index b2ea832..bc97d27 100644 --- a/INSTALL.ja +++ b/INSTALL.ja @@ -33,23 +33,23 @@ MIME$BMQ%b%8%e!<%k$NA*Br(B (a) XEmacs 21.1 $B0J9_(B - APEL 10.7, FLIM 1.14.9, SEMI 1.14.6 + APEL 10.8, FLIM 1.14.9, SEMI 1.14.6 $B2DG=$J$i$P(B XEmacs $B$N%Q%C%1!<%8$H$7$F%$%s%9%H!<%k$9$k$3$H$r$*4+$a$7$^$9!#(B (b) Emacs 20.4 $B0J9_(B - APEL 10.7, FLIM 1.14.9, SEMI 1.14.6 + APEL 10.8, FLIM 1.14.9, SEMI 1.14.6 (c) Emacs 20.1$B!A(B20.3 - APEL 10.7, CLIME 1.14.6, SEMI 1.14.6 + APEL 10.8, CLIME 1.14.6, SEMI 1.14.6 FLIM $B$,F0$-$^$;$s$N$G!"Be$o$j$K(B CLIME $B$r%$%s%9%H!<%k$7$F$/$@$5$$!#(B (d) Emacs 19.34 (Mule 2.3) - APEL 10.7, CLIME 1.14.6, SEMI 1.14.6 + APEL 10.8, CLIME 1.14.6, SEMI 1.14.6 Emacs 19.34 $B%Y!<%9$N(B Mule $B$G$O(B SEMI $B$rF0:n$5$;$k$3$H$,2DG=$G$9!#2<5-(B $B$N%Z!<%8$,;29M$K$J$j$^$9!#(B diff --git a/WL-MK b/WL-MK index d7ab2d6..88f8dc8 100644 --- a/WL-MK +++ b/WL-MK @@ -265,6 +265,19 @@ "\\.img$\\|\\.xbm$"))))) (install-files icons ICONDIR PIXMAPDIR nil 'overwrite))) +(defun uninstall-wl-icons () + (let* ((case-fold-search t) + (icons (directory-files PIXMAPDIR t "\\.img$\\|\\.x[bp]m$")) + icon) + (while icons + (setq icon (car icons) + icons (cdr icons)) + (if (and (file-exists-p icon) + (file-writable-p icon)) + (progn + (princ (format "%s was uninstalled.\n" icon)) + (delete-file icon)))))) + (defun install-wl-package () (compile-wl-package) (let ((wl-install-dir (expand-file-name WL_PREFIX LISPDIR)) @@ -291,17 +304,7 @@ (wl-uninstall (wl-scan-source (list ELMODIR)) elmo-install-dir)) (if PIXMAPDIR - (let* ((case-fold-search t) - (icons (directory-files PIXMAPDIR t "\\.x[bp]m$")) - icon) - (while icons - (setq icon (car icons) - icons (cdr icons)) - (if (and (file-exists-p icon) - (file-writable-p icon)) - (progn - (princ (format "%s was uninstalled.\n" icon)) - (delete-file icon))))))) + (uninstall-wl-icons))) (defun config-wl-package-xmas () diff --git a/doc/wl-ja.texi b/doc/wl-ja.texi index 0c140f4..5e0f1ad 100644 --- a/doc/wl-ja.texi +++ b/doc/wl-ja.texi @@ -7141,6 +7141,16 @@ spam $B$+$I$&$+$N%F%9%H$r9T$$$^$9!#(Bspam $B$HH=Dj$5$l$?%a%C%;!<%8$K$O!"(Bsp $B;XDj%j!<%8%g%s$K$"$k%a%C%;!<%8$r%F%9%H$7!"(Bspam $B$HH=Dj$5$l$?>l9g$K(B spam $B%^!<%/$r(B $BIU$1$^$9!#(Bspam $B$G$J$$$HH=Dj$5$l$?>l9g$O(B spam $B%^!<%/$rl9g$O(B spam $B%^!<%/$r + + * elmo-imap4.el: Remove trailing whitespace. + + * elmo-localdir.el (elmo-folder-pack-numbers): Fix + `elmo-bind-directory' indent. + + * elmo-imap4.el (elmo-imap4-folder-list-range): Fix indent (only + cosmetic fix). + +2010-08-27 TAKAHASHI Kaoru + + * elmo-util.el (elmo-delete-char): Fix `elmo-set-work-buf' indent. + (elmo-delete-cr, elmo-get-file-string, elmo-save-string) + (elmo-string-to-list, elmo-list-to-string): Ditto. + +2010-08-26 TAKAHASHI Kaoru + + * elmo-archive.el (elmo-archive-field-condition-match) + (elmo-archive-suffix-alist) + (elmo-archive-create-file, elmo-archive-folder-append-buffer) + (elmo-archive-folder-message-make-temp-files) + (elmo-archive-append-files) + (elmo-archive-field-condition-match): Fix indent. + + * elmo-pop3.el (elmo-pop3-read-response): Fix `response-string'. + Avoid `args-out-of-range 0, 1' error. + +2010-08-24 TAKAHASHI Kaoru + + * acap.el (acap-arrival-filter): Use (delete-char (- X)) instead of + (delete-backward-char X) that deletes region in Emacs 24. + See delete-active-region described in NEWS. + * elmo-imap4.el (elmo-imap4-arrival-filter): Ditto. + * elmo-util.el (elmo-get-file-string): Ditto. + * utf7.el (utf7-encode-internal, utf7-decode-internal): Ditto. + +2010-08-09 David Maus + + * elmo.el (elmo-folder-open-internal-p): New luna method. + (elmo-folder-move-messages): Open source folder only if necessary. + * elmo-pipe.el (elmo-folder-open-internal-p): New luna method. + * elmo-multi.el (elmo-folder-open-internal-p): Dto. + * elmo-map.el (elmo-folder-open-internal-p): Dto. + * elmo-filter.el (elmo-folder-open-internal-p): Dto. + 2010-08-04 David Maus * elmo-imap4.el (elmo-imap4-session-deselect-mailbox): New @@ -10,6 +56,11 @@ (elmo-imap4-folder-status-plugged, elmo-folder-rename-internal): Use function. +2010-08-01 David Maus + + * elmo.el (elmo-folder-move-messages): Open source folder before + moving messages. + 2010-07-18 David Maus * elmo-imap4.el (elmo-imap4-mailbox-size-update-maybe): Ignore @@ -2154,7 +2205,7 @@ * elmo.el (elmo-folder-append-buffer): Fix docstring. (elmo-generic-folder-append-messages): If elmo-message-flags return nil, pass (read) for the FLAG argument of elmo-folder-append-buffer. - + 2004-10-02 Yoichi NAKAYAMA * elmo-split.el (elmo-split-rule): Update comment. diff --git a/elmo/acap.el b/elmo/acap.el index c2ad7e3..a21501f 100644 --- a/elmo/acap.el +++ b/elmo/acap.el @@ -587,7 +587,7 @@ ENTRIES is a store-entry list." (while (setq end (acap-find-next-line)) (save-restriction (narrow-to-region (point-min) end) - (delete-backward-char (length acap-server-eol)) + (delete-char (- (length acap-server-eol))) (goto-char (point-min)) (unwind-protect (cond ((or (eq acap-state 'auth) diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index a2b9549..274bde1 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -146,15 +146,15 @@ (rar . "^[ \t]%s\\([0-9]+\\)$")))) (defvar elmo-archive-suffix-alist - '((lha . ".lzh") ; default + '((lha . ".lzh") ; default ;;; (lha . ".lzs") - (zip . ".zip") - (zoo . ".zoo") + (zip . ".zip") + (zoo . ".zoo") ;;; (arc . ".arc") ;;; (arj . ".arj") - (rar . ".rar") - (tar . ".tar") - (tgz . ".tar.gz"))) + (rar . ".rar") + (tar . ".tar") + (tgz . ".tar.gz"))) ;;; lha (defvar elmo-archive-lha-method-alist @@ -428,20 +428,19 @@ TYPE specifies the archiver's symbol." (error "WARNING: read-only mode: %s (method undefined)" type)) (cond ((file-directory-p tmp-dir) - ()) ;nop + ()) ; nop ((file-exists-p tmp-dir) ;; file exists (error "Create directory failed; File \"%s\" exists" tmp-dir)) (t (elmo-make-directory tmp-dir))) - (elmo-bind-directory - tmp-dir - (write-region (point) (point) dummy nil 'no-msg) - (prog1 - (elmo-archive-call-method method args) - (if (file-exists-p dummy) - (delete-file dummy))) - )))) + (elmo-bind-directory tmp-dir + (write-region (point) (point) dummy nil 'no-msg) + (prog1 + (elmo-archive-call-method method args) + (if (file-exists-p dummy) + (delete-file dummy))) + )))) (luna-define-method elmo-folder-delete ((folder elmo-archive-folder)) (let ((msgs (and (elmo-folder-exists-p folder) @@ -601,24 +600,23 @@ TYPE specifies the archiver's symbol." (setq newfile (elmo-concat-path prefix (number-to-string next-num))) - (elmo-bind-directory - tmp-dir - (if (and (or (functionp method) (car method)) - (file-writable-p newfile)) - (progn - (setq dst-buffer (current-buffer)) - (with-current-buffer src-buffer - (copy-to-buffer dst-buffer (point-min) (point-max))) - (as-binary-output-file - (write-region (point-min) (point-max) newfile nil 'no-msg)) - (when (elmo-archive-call-method method (list arc newfile)) - (elmo-folder-preserve-flags - folder - (with-current-buffer src-buffer - (elmo-msgdb-get-message-id-from-buffer)) - flags) - t)) - nil))))) + (elmo-bind-directory tmp-dir + (if (and (or (functionp method) (car method)) + (file-writable-p newfile)) + (progn + (setq dst-buffer (current-buffer)) + (with-current-buffer src-buffer + (copy-to-buffer dst-buffer (point-min) (point-max))) + (as-binary-output-file + (write-region (point-min) (point-max) newfile nil 'no-msg)) + (when (elmo-archive-call-method method (list arc newfile)) + (elmo-folder-preserve-flags + folder + (with-current-buffer src-buffer + (elmo-msgdb-get-message-id-from-buffer)) + flags) + t)) + nil))))) (defun elmo-folder-append-messages-*-archive (folder src-folder @@ -706,22 +704,21 @@ TYPE specifies the archiver's symbol." (number-to-string x))) numbers)) number) ;; Expand files in the tmp-dir-src. - (elmo-bind-directory - tmp-dir-src - (cond - ((functionp n-method) - (funcall n-method (cons arc tmp-msgs))) - (p-method - (let ((p-prog (car p-method)) - (p-prog-arg (cdr p-method))) - (elmo-archive-exec-msgs-subr1 - p-prog (append p-prog-arg (list arc)) tmp-msgs))) - (t - (let ((n-prog (car n-method)) - (n-prog-arg (cdr n-method))) - (elmo-archive-exec-msgs-subr2 - n-prog (append n-prog-arg (list arc)) tmp-msgs - (length arc)))))) + (elmo-bind-directory tmp-dir-src + (cond + ((functionp n-method) + (funcall n-method (cons arc tmp-msgs))) + (p-method + (let ((p-prog (car p-method)) + (p-prog-arg (cdr p-method))) + (elmo-archive-exec-msgs-subr1 + p-prog (append p-prog-arg (list arc)) tmp-msgs))) + (t + (let ((n-prog (car n-method)) + (n-prog-arg (cdr n-method))) + (elmo-archive-exec-msgs-subr2 + n-prog (append n-prog-arg (list arc)) tmp-msgs + (length arc)))))) ;; Move files to the tmp-dir-dst. (setq number start-number) (dolist (tmp-file tmp-msgs) @@ -752,21 +749,20 @@ TYPE specifies the archiver's symbol." (ding) (error "WARNING: read-only mode: %s (method undefined)" dst-type)) (save-excursion - (elmo-bind-directory - dir - (cond - ((functionp n-method) - (funcall n-method (cons arc files))) - (p-method - (let ((p-prog (car p-method)) - (p-prog-arg (cdr p-method))) - (elmo-archive-exec-msgs-subr1 - p-prog (append p-prog-arg (list arc)) files))) - (t - (let ((n-prog (car n-method)) - (n-prog-arg (cdr n-method))) - (elmo-archive-exec-msgs-subr2 - n-prog (append n-prog-arg (list arc)) files (length arc))))))))) + (elmo-bind-directory dir + (cond + ((functionp n-method) + (funcall n-method (cons arc files))) + (p-method + (let ((p-prog (car p-method)) + (p-prog-arg (cdr p-method))) + (elmo-archive-exec-msgs-subr1 + p-prog (append p-prog-arg (list arc)) files))) + (t + (let ((n-prog (car n-method)) + (n-prog-arg (cdr n-method))) + (elmo-archive-exec-msgs-subr2 + n-prog (append n-prog-arg (list arc)) files (length arc))))))))) (luna-define-method elmo-folder-delete-messages-internal ((folder elmo-archive-folder) @@ -1051,12 +1047,12 @@ TYPE specifies the archiver's symbol." (method (elmo-archive-get-method type 'cat)) (args (list arc (elmo-concat-path prefix (number-to-string number))))) (elmo-set-work-buf - (when (file-exists-p arc) - (as-binary-process - (elmo-archive-call-method method args t)) - (set-buffer-multibyte default-enable-multibyte-characters) - (decode-mime-charset-region (point-min)(point-max) elmo-mime-charset) - (elmo-message-buffer-match-condition condition number)))))) + (when (file-exists-p arc) + (as-binary-process + (elmo-archive-call-method method args t)) + (set-buffer-multibyte default-enable-multibyte-characters) + (decode-mime-charset-region (point-min)(point-max) elmo-mime-charset) + (elmo-message-buffer-match-condition condition number)))))) (luna-define-method elmo-folder-search ((folder elmo-archive-folder) condition &optional from-msgs) diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 700be31..65aacfa 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -156,6 +156,9 @@ (luna-define-method elmo-folder-open-internal ((folder elmo-filter-folder)) (elmo-folder-open-internal (elmo-filter-folder-target-internal folder))) +(luna-define-method elmo-folder-open-internal-p ((folder elmo-filter-folder)) + (elmo-folder-open-internal-p (elmo-filter-folder-target-internal folder))) + (luna-define-method elmo-folder-check ((folder elmo-filter-folder)) (when (elmo-filter-folder-require-msgdb-internal folder) (elmo-folder-synchronize (elmo-filter-folder-target-internal folder)))) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 134223e..20b2fa2 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -1336,7 +1336,7 @@ Return nil if no complete line has arrived." (while (setq end (elmo-imap4-find-next-line)) (save-restriction (narrow-to-region (point-min) end) - (delete-backward-char (length elmo-imap4-server-eol)) + (delete-char (- (length elmo-imap4-server-eol))) (goto-char (point-min)) (unwind-protect (case elmo-imap4-status @@ -1685,7 +1685,7 @@ Return nil if no complete line has arrived." (goto-char (match-end 1))))) (UNSEEN (list 'unseen (read (current-buffer)))) - (t + (t (message "Unknown status data %s in mailbox %s ignored" token mailbox)))) @@ -2019,16 +2019,14 @@ Return nil if no complete line has arrived." (elmo-imap4-list folder (concat - (let ((killed - (elmo-folder-killed-list-internal - folder))) + (let ((killed (elmo-folder-killed-list-internal folder))) (if (and killed - (eq (length killed) 1) - (consp (car killed)) - (eq (car (car killed)) 1)) -;; What about elmo-imap4-use-uid? - (format "uid %d:%s" (cdr (car killed)) max) - (format "uid %s:%s" min max))) + (eq (length killed) 1) + (consp (car killed)) + (eq (car (car killed)) 1)) + ;; What about elmo-imap4-use-uid? + (format "uid %d:%s" (cdr (car killed)) max) + (format "uid %s:%s" min max))) " undeleted"))) (luna-define-method elmo-folder-list-messages-plugged diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 9651f8a..78a30f1 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -329,11 +329,10 @@ (dolist (old-number numbers) (setq entity (elmo-msgdb-message-entity msgdb old-number)) (when (not (eq old-number new-number)) ; why \=() is wrong.. - (elmo-bind-directory - dir - ;; xxx nfs,hardlink - (rename-file (number-to-string old-number) - (number-to-string new-number) t)) + (elmo-bind-directory dir + ;; xxx nfs,hardlink + (rename-file (number-to-string old-number) + (number-to-string new-number) t)) (elmo-message-entity-set-number entity new-number)) (elmo-msgdb-append-entity new-msgdb entity (elmo-msgdb-flags msgdb old-number)) diff --git a/elmo/elmo-map.el b/elmo/elmo-map.el index 0ba69ff..20c6f65 100644 --- a/elmo/elmo-map.el +++ b/elmo/elmo-map.el @@ -233,6 +233,9 @@ Return new location alist." folder (elmo-map-folder-list-message-locations folder)))) +(luna-define-method elmo-folder-open-internal-p ((folder elmo-map-folder)) + (elmo-location-map-alist folder)) + (luna-define-method elmo-folder-commit :after ((folder elmo-map-folder)) (when (elmo-folder-persistent-p folder) (elmo-location-map-save folder (elmo-folder-msgdb-path folder)))) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 2e52de3..122a6df 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -123,6 +123,11 @@ (dolist (fld (elmo-multi-folder-children-internal folder)) (elmo-folder-open-internal fld))) +(luna-define-method elmo-folder-open-internal-p ((folder elmo-multi-folder)) + (let (open) + (dolist (fld (elmo-multi-folder-children-internal folder)) + (setq open (and open (elmo-folder-open-internal-p fld)))))) + (luna-define-method elmo-folder-check ((folder elmo-multi-folder)) (dolist (fld (elmo-multi-folder-children-internal folder)) (elmo-folder-check fld))) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index f3c7ffc..68bb479 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -179,6 +179,9 @@ (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-open-internal-p ((folder elmo-pipe-folder)) + (elmo-folder-open-internal-p (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))) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index ac755f3..aff5d75 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -228,7 +228,8 @@ CODE is one of the following: (goto-char elmo-pop3-read-point)) (setq match-end (point)) (setq response-string - (buffer-substring elmo-pop3-read-point (- match-end 2))) + (buffer-substring elmo-pop3-read-point + (max (- match-end 2) elmo-pop3-read-point))) (goto-char elmo-pop3-read-point) (if (looking-at "\\+.*$") (progn diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index af9664f..aff84f3 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -417,14 +417,14 @@ Return value is a cons cell of (STRUCTURE . REST)" (defsubst elmo-delete-char (char string &optional unibyte) (save-match-data (elmo-set-work-buf - (let ((coding-system-for-read 'no-conversion) - (coding-system-for-write 'no-conversion)) - (if unibyte (set-buffer-multibyte nil)) - (insert string) - (goto-char (point-min)) - (while (search-forward (char-to-string char) nil t) - (replace-match "")) - (buffer-string))))) + (let ((coding-system-for-read 'no-conversion) + (coding-system-for-write 'no-conversion)) + (if unibyte (set-buffer-multibyte nil)) + (insert string) + (goto-char (point-min)) + (while (search-forward (char-to-string char) nil t) + (replace-match "")) + (buffer-string))))) (defsubst elmo-delete-cr-buffer () "Delete CR from buffer." @@ -445,11 +445,11 @@ Return value is a cons cell of (STRUCTURE . REST)" (defun elmo-delete-cr (string) (save-match-data (elmo-set-work-buf - (insert string) - (goto-char (point-min)) - (while (search-forward "\r\n" nil t) - (replace-match "\n")) - (buffer-string)))) + (insert string) + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + (buffer-string)))) (defun elmo-last (list) (and list (nth (1- (length list)) list))) @@ -499,26 +499,26 @@ Return value is a cons cell of (STRUCTURE . REST)" (defun elmo-get-file-string (filename &optional remove-final-newline) (elmo-set-work-buf - (let (insert-file-contents-pre-hook ; To avoid autoconv-xmas... - insert-file-contents-post-hook) - (when (file-exists-p filename) - (if filename - (as-binary-input-file (insert-file-contents filename))) - (when (and remove-final-newline - (> (buffer-size) 0) - (= (char-after (1- (point-max))) ?\n)) - (goto-char (point-max)) - (delete-backward-char 1)) - (buffer-string))))) + (let (insert-file-contents-pre-hook ; To avoid autoconv-xmas... + insert-file-contents-post-hook) + (when (file-exists-p filename) + (if filename + (as-binary-input-file (insert-file-contents filename))) + (when (and remove-final-newline + (> (buffer-size) 0) + (= (char-after (1- (point-max))) ?\n)) + (goto-char (point-max)) + (delete-char -1)) + (buffer-string))))) (defun elmo-save-string (string filename) (if string (elmo-set-work-buf - (as-binary-output-file - (insert string) - (write-region (point-min) (point-max) - filename nil 'no-msg)) - ))) + (as-binary-output-file + (insert string) + (write-region (point-min) (point-max) + filename nil 'no-msg)) + ))) (defun elmo-max-of-list (nlist) (let ((l nlist) @@ -664,13 +664,13 @@ Return value is a cons cell of (STRUCTURE . REST)" (defun elmo-string-to-list (string) (elmo-set-work-buf - (insert string) - (goto-char (point-min)) - (insert "(") - (goto-char (point-max)) - (insert ")") - (goto-char (point-min)) - (read (current-buffer)))) + (insert string) + (goto-char (point-min)) + (insert "(") + (goto-char (point-max)) + (insert ")") + (goto-char (point-min)) + (read (current-buffer)))) (defun elmo-list-to-string (list) (let ((tlist list) @@ -2226,13 +2226,13 @@ If ALIST is nil, `elmo-obsolete-variable-alist' is used." (save-match-data (let (beg) (elmo-set-work-buf - (insert string) - (goto-char (point-max)) - (when (search-backward "<" nil t) - (setq beg (point)) - (if (search-forward ">" nil t) - (elmo-replace-in-string - (buffer-substring beg (point)) "\n[ \t]*" "")))))))) + (insert string) + (goto-char (point-max)) + (when (search-backward "<" nil t) + (setq beg (point)) + (if (search-forward ">" nil t) + (elmo-replace-in-string + (buffer-substring beg (point)) "\n[ \t]*" "")))))))) (defun elmo-msgdb-get-message-id-from-buffer () (let ((msgid (elmo-field-body "message-id"))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 15c935e..c3c0bd7 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -217,6 +217,9 @@ If optional LOAD-MSGDB is non-nil, msgdb is loaded. (luna-define-generic elmo-folder-open-internal (folder) "Open FOLDER (without loading saved folder status).") +(luna-define-generic elmo-folder-open-internal-p (folder) + "Return non-nil if FOLDER is opened internally.") + (luna-define-generic elmo-folder-check (folder) "Check the FOLDER to obtain newest information at the next list operation.") @@ -713,6 +716,10 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).") nil ; default is do nothing. ) +(luna-define-method elmo-folder-open-internal-p ((folder elmo-folder)) + t ; default is always opened internally + ) + (luna-define-method elmo-folder-check ((folder elmo-folder)) nil) ; default is noop. @@ -1188,7 +1195,8 @@ Returns a list of message numbers successfully appended." (error "move: %d is not writable" (elmo-folder-name-internal dst-folder))) (when messages - ;; src is already opened. + (unless (elmo-folder-open-internal-p src-folder) + (elmo-folder-open-internal src-folder)) (elmo-folder-open-internal dst-folder) (unless (setq succeeds (elmo-folder-append-messages dst-folder src-folder diff --git a/elmo/utf7.el b/elmo/utf7.el index 30fdb74..dd38408 100644 --- a/elmo/utf7.el +++ b/elmo/utf7.el @@ -136,7 +136,7 @@ Use IMAP modification if FOR-IMAP is non-nil." (skip-chars-forward not-direct-encoding-chars))) (if (and (= fc esc-char) (= run-length 1)) ; Lone esc-char? - (delete-backward-char 1) ; Now there's one too many + (delete-char -1) ; Now there's one too many (utf7-fragment-encode p (point) for-imap)) (insert "-"))))))) @@ -185,7 +185,7 @@ Use IMAP modification if FOR-IMAP is non-nil." (save-excursion (utf7-fragment-decode p (point) for-imap) (goto-char p) - (delete-backward-char 1))))))))) + (delete-char -1))))))))) (defun utf7-fragment-decode (start end &optional for-imap) "Decode base64 encoded fragment from START to END of UTF-7 text in buffer. diff --git a/tests/ChangeLog b/tests/ChangeLog index e2999bd..f6adbaf 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-31 TAKAHASHI Kaoru + + * test-dist.el (test-elmo-modules-trailing-whitespace) + (test-util-modules-trailing-whitespace) + (test-wl-modules-trailing-whitespace): New testcases. + 2010-01-22 TAKAHASHI Kaoru * test-utf7.el (test-utf7-encode-string-alpha): Fix indent. diff --git a/tests/test-dist.el b/tests/test-dist.el index 432500e..aabfd03 100644 --- a/tests/test-dist.el +++ b/tests/test-dist.el @@ -17,6 +17,21 @@ WL-MODULES) lost)))) +(luna-define-method test-wl-modules-trailing-whitespace ((case test-dist)) + (let (filename badmodule) + (mapc + (lambda (module) + (setq filename + (format "%s.el%s" (symbol-name module) + (if (eq 'wl-news module) ".in" ""))) + (with-temp-buffer + (insert-file-contents (expand-file-name filename WLDIR)) + (when (re-search-forward "[ \t]$" nil t) + (add-to-list 'badmodule filename)))) + WL-MODULES) + (lunit-assert (null badmodule)))) + + ;; ELMO-MODULES (luna-define-method test-elmo-modules-exists ((case test-dist)) (lunit-assert @@ -30,6 +45,19 @@ ELMO-MODULES) lost)))) +(luna-define-method test-elmo-modules-trailing-whitespace ((case test-dist)) + (let (filename badmodule) + (mapc + (lambda (module) + (setq filename (format "%s.el" (symbol-name module))) + (with-temp-buffer + (insert-file-contents (expand-file-name filename ELMODIR)) + (when (re-search-forward "[ \t]$" nil t) + (add-to-list 'badmodule filename)))) + ELMO-MODULES) + (lunit-assert (null badmodule)))) + + ;; UTILS-MODULES (luna-define-method test-util-modules-exists ((case test-dist)) (lunit-assert @@ -43,6 +71,19 @@ UTILS-MODULES) lost)))) +(luna-define-method test-util-modules-trailing-whitespace ((case test-dist)) + (let (filename badmodule) + (mapc + (lambda (module) + (setq filename (format "%s.el" (symbol-name module))) + (with-temp-buffer + (insert-file-contents (expand-file-name filename UTILSDIR)) + (when (re-search-forward "[ \t]$" nil t) + (add-to-list 'badmodule filename)))) + UTILS-MODULES) + (lunit-assert (null badmodule)))) + + ;; Icons (luna-define-method test-wl-icon-exists ((case test-dist)) (lunit-assert diff --git a/utils/ChangeLog b/utils/ChangeLog index d0f205a..6c41ade 100644 --- a/utils/ChangeLog +++ b/utils/ChangeLog @@ -1,3 +1,28 @@ +2010-09-02 TAKAHASHI Kaoru + + * ptexinfmt.el (texinfo-multitable-widths): Use `make-char' + instead of KANJI literal. + +2010-08-31 TAKAHASHI Kaoru + + * wl-addrbook.el: Delete traing whitespace. + * wl-complete.el: Ditto. + * rfc2368.el: Ditto. + * ssl.el: Ditto. + +2010-08-24 TAKAHASHI Kaoru + + * ptexinfmt.el (texinfo-format-verb): Use (delete-char -1) + instead of (delete-backward-char 1); For Emacs24. + + * wl-addrbook.el (wl-addrbook-insert-file): Use (delete-char -1) + instead of (delete-backward-char 1) or (backward-deletechar 1). + +2010-08-04 David Maus + + * ssl.el (open-ssl-stream, condition-case): Don't use old-style + backquotes. + 2010-01-06 TAKAHASHI Kaoru * wl-addrbook.el (wl-summary-addrbook-add): Use diff --git a/utils/ptexinfmt.el b/utils/ptexinfmt.el index 4c193e8..4c3e9ec 100644 --- a/utils/ptexinfmt.el +++ b/utils/ptexinfmt.el @@ -170,7 +170,10 @@ DOCSTRING will be printed if ASSERTION is nil and "`texinfo-multitable-widths' unsupport wide-char." (if (fboundp 'texinfo-multitable-widths) (with-temp-buffer - (let ((str "$BI}9-J8;z(B")) + (let ((str (string (make-char 'japanese-jisx0208 73 125) + (make-char 'japanese-jisx0208 57 45) + (make-char 'japanese-jisx0208 74 56) + (make-char 'japanese-jisx0208 59 122)))) (texinfo-mode) (insert (format " {%s}\n" str)) (goto-char (point-min)) @@ -409,7 +412,7 @@ For example, @verb\{|@|\} results in @ and (error "Not found: @verb start brace")) (delete-region texinfo-command-start (+ 2 texinfo-command-end)) (search-forward delimiter)) - (delete-backward-char 1) + (delete-char -1) (unless (looking-at "}") (error "Not found: @verb end brace")) (delete-char 1)) diff --git a/utils/rfc2368.el b/utils/rfc2368.el index abca6ed..a2ab61e 100644 --- a/utils/rfc2368.el +++ b/utils/rfc2368.el @@ -89,7 +89,7 @@ ((match-beginning 1) "\n") (t " ")) buf) - (setq start (match-end 0))) + (setq start (match-end 0))) (apply 'concat (nreverse (cons (substring string start) buf))))) (defun rfc2368-parse-mailto-url (mailto-url) diff --git a/utils/ssl.el b/utils/ssl.el index 0b74cd0..7006955 100644 --- a/utils/ssl.el +++ b/utils/ssl.el @@ -38,13 +38,13 @@ ;; We have the old custom-library, hack around it! (defmacro defgroup (&rest args) nil) - (defmacro defcustom (var value doc &rest args) - (` (defvar (, var) (, value) (, doc)))))) + (defmacro defcustom (var value doc &rest args) + `(devar ,var ,value ,doc)))) (defgroup ssl nil "Support for `Secure Sockets Layer' encryption." :group 'comm) - + (defcustom ssl-certificate-directory "~/.w3/certs/" "*Directory to store CA certificates in" :group 'ssl @@ -134,7 +134,7 @@ to." (while (re-search-forward "^\\([^=\n\r]+\\)\\s *=\\s *\\(.*\\)" nil t) (push (cons (match-string 1) (match-string 2)) vals)) vals))))) - + (defun ssl-accept-ca-certificate () "Ask if the user is willing to accept a new CA certificate. The buffer-name should be the intended name of the certificate, and the buffer should probably @@ -143,10 +143,10 @@ be in DER encoding" (let* ((process-connection-type nil) (tmpbuf (generate-new-buffer "X509 CA Certificate Information")) (response (save-excursion - (and (eq 0 + (and (eq 0 (apply 'call-process-region - (point-min) (point-max) - ssl-view-certificate-program-name + (point-min) (point-max) + ssl-view-certificate-program-name nil tmpbuf t ssl-view-certificate-program-arguments)) (switch-to-buffer tmpbuf) @@ -192,9 +192,8 @@ specifying a port number to connect to." (let* ((process-connection-type nil) (port service) (proc (eval - (` - (start-process name buffer ssl-program-name - (,@ ssl-program-arguments)))))) + `(start-process name buffer ssl-program-name + ,@ssl-program-arguments)))) (process-kill-without-query proc) proc)) diff --git a/utils/wl-addrbook.el b/utils/wl-addrbook.el index b553230..e03b94b 100644 --- a/utils/wl-addrbook.el +++ b/utils/wl-addrbook.el @@ -26,7 +26,7 @@ "*Regular expression for \".im/Addrbook\".") (defvar wl-addrbook-override-by-newone t "If non-nil, the 'user' entry in 'wl-alias-auto-alist' -is override by a new entry of (user different-address). +is override by a new entry of (user different-address). This means that addresses in To: and Cc: in Draft mode are always learned with an exception 'user' is defined in Addrbook. If nil, the old 'user' entry remains.") @@ -242,7 +242,7 @@ If addresses is a string, expands it recursively." (setq wl-alias-auto-alist (cons (list user addr) (delete match-auto wl-alias-auto-alist)))) - (t + (t ;; the old entry remains ))) (match-adbk @@ -310,7 +310,7 @@ If addresses is a string, expands it recursively." (while (re-search-forward ",[ \t]*$" nil t) (end-of-line) (forward-char 1) - (delete-backward-char 1) + (delete-char -1) (delete-horizontal-space)) ;; unquote, replace white spaces to "\0". (if unquote @@ -319,11 +319,11 @@ If addresses is a string, expands it recursively." (while (re-search-forward "[\"']" nil t) (setq qchar (char-before (point))) ;; (point) is for backward compatibility - (backward-delete-char 1) ;; delete quote + (delete-char -1) ; delete quote (setq beg (point)) (if (not (re-search-forward (char-to-string qchar) nil t)) (throw 'quote nil) ;; error - (backward-delete-char 1) ;; delete quote + (delete-char -1) ; delete quote (save-restriction (narrow-to-region beg (point)) (goto-char (point-min)) @@ -365,7 +365,7 @@ If addresses is a string, expands it recursively." (defun wl-draft-learn-alias () (interactive) - (let ((recipients (mapconcat 'identity + (let ((recipients (mapconcat 'identity (delq nil (std11-field-bodies '("To" "Cc"))) ","))) (mapcar '(lambda (addr) @@ -502,7 +502,7 @@ The keys that are defined for this mode are: (set-buffer buf) (goto-char (point-min)) (if (and shortname - (re-search-forward + (re-search-forward (concat "^" (regexp-quote shortname) "[ \t]*:?[ \t]+") nil t)) (setq not-uniq t)) (if not-uniq @@ -568,7 +568,7 @@ The keys that are defined for this mode are: ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: -;; +;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright @@ -577,7 +577,7 @@ The keys that are defined for this mode are: ;; 3. Neither the name of the team nor the names of its contributors ;; may be used to endorse or promote products derived from this software ;; without specific prior written permission. -;; +;; ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR diff --git a/utils/wl-complete.el b/utils/wl-complete.el index 70dfc68..b44afe7 100644 --- a/utils/wl-complete.el +++ b/utils/wl-complete.el @@ -123,7 +123,7 @@ (wl-complete word wl-folder-entity-hashtb "folder" nil)))) (defun wl-addrbook-complete-address () - "Complete and expand address aliases. + "Complete and expand address aliases. First alias key is completed. When completed solely or the @ character is inserted before the cursor, the alias key is expanded to its value." (interactive) @@ -134,7 +134,7 @@ is inserted before the cursor, the alias key is expanded to its value." (insert (or (wl-alias-next word) word)) (wl-complete word wl-addrbook-alist "alias" ?@ nil nil - (function wl-addrbook-alias-get) + (function wl-addrbook-alias-get) (function wl-addrbook-alias-hit)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -153,8 +153,8 @@ is inserted before the cursor, the alias key is expanded to its value." (defun wl-circular-complete-domain () "Circular completion of domains for To:, Cc:, etc. If the @ character does not exist, the first value of -wl-mail-domain-list is inserted. If exists, the next value of -wl-mail-domain-list concerned with the string between @ and +wl-mail-domain-list is inserted. If exists, the next value of +wl-mail-domain-list concerned with the string between @ and the cursor is inserted." (interactive) (let ((word (wl-delete-backward-char "@"))) @@ -350,7 +350,7 @@ the name exists." (defun wl-slide-pair (x) (let ((ret nil) (first (car x))) - (cond + (cond ((eq x 0) nil) ((eq x 1) (cons first first)) (t @@ -371,7 +371,7 @@ the name exists." ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: -;; +;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright @@ -380,7 +380,7 @@ the name exists." ;; 3. Neither the name of the team nor the names of its contributors ;; may be used to endorse or promote products derived from this software ;; without specific prior written permission. -;; +;; ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR diff --git a/wl/ChangeLog b/wl/ChangeLog index d3ad732..d9703a4 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,50 @@ +2010-08-31 TAKAHASHI Kaoru + + * wl-summary.el: Delete trailing whitespace. + +2010-08-27 Kenichi Okada + + * wl-summary.el (wl-summary-prefetch-msg): Make the confirmation + message human-readable. + +2010-08-26 TAKAHASHI Kaoru + + * wl-e21.el (wl-draft-insert-signature): Fix comment style. + (wl-highlight-folder-current-line): Ditto. + * wl-xmas.el (wl-draft-insert-signature): Ditto. + (wl-highlight-folder-current-line): Ditto. + +2010-08-24 TAKAHASHI Kaoru + + * wl-address.el (wl-address-make-alist-from-alias-file): Use + `(delete-char -1)' instead of `(delete-backward-char 1)' that + deletes region in Emacs 24. + See delete-active-region described in NEWS. + * wl-draft.el (wl-draft-insert-mail-header-separator): Ditto. + * wl-summary.el (wl-summary-update-persistent-mark): Ditto. + +2010-08-14 David Maus + + * wl-summary.el (wl-summary-mode-menu-spec): Add menu option to + edit draft message when in draft folder. + +2010-07-21 Katsumi Yamaoka + + * wl-summary.el (wl-summary-put-temp-mark): Use (delete-char -1) + instead of (delete-backward-char 1) that deletes region in Emacs 24. + See delete-active-region described in NEWS. + +2010-05-25 Tetsurou Okazaki + + * wl-spam.el (wl-summary-register-as-spam-region) + (wl-thread-register-as-spam, wl-summary-register-as-good-region) + (wl-thread-register-as-good): New functions. + (wl-spam-setup): Bind "rks", "rkn", "tks" and "tkn". + +2010-04-28 Vitaly Mayatskikh + * wl-e21.el (wl-e21-setup-toolbar): Don't define vector with + images for the icon if there is only one image. + 2010-03-17 Katsumi Yamaoka * wl-draft.el (wl-user-agent-insert-body): Make sure body ends with diff --git a/wl/wl-address.el b/wl/wl-address.el index c63c5f1..f657e3b 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -531,7 +531,7 @@ Refresh `wl-address-list', `wl-address-completion-list', and (while (re-search-forward ",$" nil t) (end-of-line) (forward-char 1) - (delete-backward-char 1)) + (delete-char -1)) (goto-char (point-min)) (while (re-search-forward "^\\([^#;\n][^:]+\\):[ \t]*\\(.*\\)$" nil t) (setq alias (wl-match-buffer 1) diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 0e64e1b..28b73b2 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1878,7 +1878,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (goto-char delimline) (goto-char (point-min)) (if (search-forward "\n\n" nil t) - (delete-backward-char 1) + (delete-char -1) (goto-char (point-max)))) (wl-draft-check-new-line) (put-text-property (point) diff --git a/wl/wl-e21.el b/wl/wl-e21.el index 325475c..89bdaa7 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -153,7 +153,7 @@ ) "The Message buffer toolbar.") -(defalias 'wl-draft-insert-signature 'insert-signature);; for draft toolbar. +(defalias 'wl-draft-insert-signature 'insert-signature) ; for draft toolbar. (defvar wl-draft-toolbar '([wl-draft-send-from-toolbar @@ -202,7 +202,9 @@ `((,@props ,(concat name "-down.xpm")))) disabled (wl-e21-find-image `((,@props ,(concat name "-disabled.xpm"))))) - (set icon (vector down up disabled disabled))) + (if (and down disabled) + (set icon (vector down up disabled disabled)) + (set icon up))) (setq bar nil success nil)))) success))) @@ -316,8 +318,8 @@ (beginning-of-line) (let (fld-name start end) (cond - (;; opened folder group - (and (wl-folder-buffer-group-p) + ;; opened folder group + ((and (wl-folder-buffer-group-p) (looking-at wl-highlight-folder-opened-regexp)) (setq start (match-beginning 1) end (match-end 1)) @@ -327,8 +329,8 @@ (wl-e21-highlight-folder-by-numbers start end 'wl-highlight-folder-opened-face numbers)) - (;; closed folder group - (and (wl-folder-buffer-group-p) + ;; closed folder group + ((and (wl-folder-buffer-group-p) (looking-at wl-highlight-folder-closed-regexp)) (setq start (match-beginning 1) end (match-end 1)) @@ -338,8 +340,8 @@ (wl-e21-highlight-folder-by-numbers start end 'wl-highlight-folder-closed-face numbers)) - (;; basic folder - (and (setq fld-name (wl-folder-get-folder-name-by-id + ;; basic folder + ((and (setq fld-name (wl-folder-get-folder-name-by-id (get-text-property (point) 'wl-folder-entity-id))) (looking-at "[[:blank:]]+\\([^[:blank:]\n]+\\)")) (setq start (match-beginning 1) @@ -358,22 +360,26 @@ (unless (get (caar wl-folder-internal-icon-list) 'image) (wl-folder-init-icons)) (setq image - (cond ((string= fld-name wl-trash-folder);; trash folder - (let ((num (nth 2 numbers)));; number of messages - (get (if (or (not num) (zerop num)) - 'wl-folder-trash-empty-image - 'wl-folder-trash-image) - 'image))) - ((string= fld-name wl-draft-folder);; draft folder - (get 'wl-folder-draft-image 'image)) - ((string= fld-name wl-queue-folder);; queue folder - (get 'wl-folder-queue-image 'image)) - (;; and one of many other folders - (setq type (or (elmo-folder-type fld-name) - (elmo-folder-type-internal - (elmo-make-folder fld-name)))) - (get (intern (format "wl-folder-%s-image" type)) - 'image))))) + (cond + ;; trash folder + ((string= fld-name wl-trash-folder) + (let ((num (nth 2 numbers))) ; number of messages + (get (if (or (not num) (zerop num)) + 'wl-folder-trash-empty-image + 'wl-folder-trash-image) + 'image))) + ;; draft folder + ((string= fld-name wl-draft-folder) + (get 'wl-folder-draft-image 'image)) + ;; queue folder + ((string= fld-name wl-queue-folder) + (get 'wl-folder-queue-image 'image)) + ;; and one of many other folders + ((setq type (or (elmo-folder-type fld-name) + (elmo-folder-type-internal + (elmo-make-folder fld-name)))) + (get (intern (format "wl-folder-%s-image" type)) + 'image))))) (overlay-put overlay 'before-string (propertize " " 'display image 'invisible t)))) diff --git a/wl/wl-spam.el b/wl/wl-spam.el index 2464ac4..8cb870f 100644 --- a/wl/wl-spam.el +++ b/wl/wl-spam.el @@ -272,6 +272,19 @@ See `wl-summary-mark-action-list' for the detail of element." (wl-spam-register-spam-messages wl-summary-buffer-elmo-folder (list number))))) +(defun wl-summary-register-as-spam-region (beg end) + (interactive "r") + (let ((numbers (wl-summary-collect-numbers-region beg end))) + (cond (numbers + (wl-spam-register-spam-messages wl-summary-buffer-elmo-folder + numbers)) + ((interactive-p) + (message "No message to register as spam."))))) + +(defun wl-thread-register-as-spam (&optional arg) + (interactive "P") + (wl-thread-call-region-func 'wl-summary-register-as-spam-region arg)) + (defun wl-summary-register-as-spam-all () (interactive) (wl-spam-register-spam-messages wl-summary-buffer-elmo-folder @@ -296,6 +309,19 @@ See `wl-summary-mark-action-list' for the detail of element." (wl-spam-register-good-messages wl-summary-buffer-elmo-folder (list number))))) +(defun wl-summary-register-as-good-region (beg end) + (interactive "r") + (let ((numbers (wl-summary-collect-numbers-region beg end))) + (cond (numbers + (wl-spam-register-good-messages wl-summary-buffer-elmo-folder + numbers)) + ((interactive-p) + (message "No message to register as good."))))) + +(defun wl-thread-register-as-good (&optional arg) + (interactive "P") + (wl-thread-call-region-func 'wl-summary-register-as-good-region arg)) + (defun wl-summary-register-as-good-all () (interactive) (wl-spam-register-good-messages wl-summary-buffer-elmo-folder @@ -410,10 +436,18 @@ See `wl-summary-mark-action-list' for the detail of element." (define-key wl-summary-mode-map "rkc" 'wl-summary-test-spam-region) (define-key + wl-summary-mode-map "rks" 'wl-summary-register-as-spam-region) + (define-key + wl-summary-mode-map "rkn" 'wl-summary-register-as-good-region) + (define-key wl-summary-mode-map "tkm" 'wl-thread-spam) (define-key wl-summary-mode-map "tkc" 'wl-thread-test-spam) (define-key + wl-summary-mode-map "tks" 'wl-thread-register-as-spam) + (define-key + wl-summary-mode-map "tkn" 'wl-thread-register-as-good) + (define-key wl-summary-mode-map "mk" 'wl-summary-target-mark-spam) (define-key wl-summary-mode-map "ms" 'wl-summary-target-mark-register-as-spam) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 72811d5..99742e6 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -245,6 +245,7 @@ See also variable `wl-use-petname'." (defvar wl-summary-mode-menu-spec '("Summary" ["Read" wl-summary-read t] + ["Edit draft message" wl-summary-reedit :visible (string= (wl-summary-buffer-folder-name) wl-draft-folder)] ["Prev page" wl-summary-prev-page t] ["Next page" wl-summary-next-page t] ["Top" wl-summary-display-top t] @@ -292,7 +293,8 @@ See also variable `wl-use-petname'." ["Enter the message" wl-summary-jump-to-current-message t] ["Pipe message" wl-summary-pipe-message t] ["Print message" wl-summary-print-message t] - ["View raw message" wl-summary-display-raw t]) + ["View raw message" wl-summary-display-raw t] + ) ("Thread Operation" ["Open or Close" wl-thread-open-close (eq wl-summary-buffer-view 'thread)] ["Open all" wl-thread-open-all (eq wl-summary-buffer-view 'thread)] @@ -1594,7 +1596,7 @@ If ARG is non-nil, checking is omitted." (widen) (y-or-n-p (format - "Message from %s has %d bytes. Prefetch it? " + "Message from %s has %s bytes. Prefetch it? " (concat "[ " (save-match-data @@ -1610,7 +1612,10 @@ If ARG is non-nil, checking is omitted." 'from) "??"))))) " ]") - size)))) + (do ((size (/ size 1024.0) (/ size 1024.0)) + ;; kilo, mega, giga, tera, peta, exa + (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes))) + ((< size 1024) (format "%.0f%s" size (car post-fixes)))))))) (message ""))) ; flush. (if force-read (save-excursion @@ -3008,7 +3013,7 @@ The mark is decided according to the FOLDER and STATUS." (let ((inhibit-read-only t) (buffer-read-only nil)) (move-to-column wl-summary-buffer-temp-mark-column) - (delete-backward-char 1) + (delete-char -1) (insert mark))))) (defun wl-summary-next-buffer () @@ -3141,7 +3146,7 @@ Return non-nil if the mark is updated" (new-mark (wl-summary-persistent-mark number status))) (prog1 (unless (string= new-mark mark) - (delete-backward-char 1) + (delete-char -1) (insert new-mark) (wl-summary-set-message-modified) t) @@ -4744,7 +4749,7 @@ If ARG is numeric number, decode message as following: (let ((number (wl-summary-message-number)) (folder wl-summary-buffer-elmo-folder)) (if number - (let ((raw (elmo-message-fetch-string + (let ((raw (elmo-message-fetch-string folder number (elmo-find-fetch-strategy folder number))) (raw-buffer (get-buffer-create "*wl:raw message*")) diff --git a/wl/wl-xmas.el b/wl/wl-xmas.el index 3e62300..8bd5086 100644 --- a/wl/wl-xmas.el +++ b/wl/wl-xmas.el @@ -123,7 +123,7 @@ ) "The Message buffer toolbar.") -(defalias 'wl-draft-insert-signature 'insert-signature);; for draft toolbar. +(defalias 'wl-draft-insert-signature 'insert-signature) ; for draft toolbar. (defvar wl-draft-toolbar '([wl-draft-send-from-toolbar @@ -252,20 +252,20 @@ (beginning-of-line) (let (fld-name) (cond - (;; opened folder group - (and (wl-folder-buffer-group-p) + ;; opened folder group + ((and (wl-folder-buffer-group-p) (looking-at wl-highlight-folder-opened-regexp)) (wl-xmas-highlight-folder-group-line 'wl-folder-opened-glyph 'wl-highlight-folder-opened-face numbers)) - (;; closed folder group - (and (wl-folder-buffer-group-p) + ;; closed folder group + ((and (wl-folder-buffer-group-p) (looking-at wl-highlight-folder-closed-regexp)) (wl-xmas-highlight-folder-group-line 'wl-folder-closed-glyph 'wl-highlight-folder-closed-face numbers)) - (;; basic folder - (and (setq fld-name (wl-folder-get-folder-name-by-id + ;; basic folder + ((and (setq fld-name (wl-folder-get-folder-name-by-id (get-text-property (point) 'wl-folder-entity-id))) (looking-at "[ \t]+\\([^ \t]+\\)")) (let ((start (match-beginning 1))) @@ -280,18 +280,21 @@ (set-extent-begin-glyph extent (cond - ((string= fld-name wl-trash-folder);; trash folder - (let ((num (nth 2 numbers)));; number of messages + ;; trash folder + ((string= fld-name wl-trash-folder) + (let ((num (nth 2 numbers))) ; number of messages (get (if (or (not num) (zerop num)) 'wl-folder-trash-empty-glyph 'wl-folder-trash-glyph) 'glyph))) - ((string= fld-name wl-draft-folder);; draft folder + ;; draft folder + ((string= fld-name wl-draft-folder) (get 'wl-folder-draft-glyph 'glyph)) - ((string= fld-name wl-queue-folder);; queue folder + ;; queue folder + ((string= fld-name wl-queue-folder) (get 'wl-folder-queue-glyph 'glyph)) - (;; and one of many other folders - (setq type (or (elmo-folder-type fld-name) + ;; and one of many other folders + ((setq type (or (elmo-folder-type fld-name) (elmo-folder-type-internal (elmo-make-folder fld-name)))) (get (intern (format "wl-folder-%s-glyph" type)) 'glyph)))))) -- 1.7.10.4