* Changes in 2.12.1 from 2.12.0
Version 2.12.1 is a bug fix version of 2.12.0.
+** Now Maildir is usable on Windows systems.
+ Note that it does not conform to the Maildir standard.
+
** Fixed the problem in display module for IMAP messages.
Now partially fetched messages are displayed correctly.
If a message included child messages, their headers were not displayed.
* 2.12.0 \e$B$+$i\e(B 2.12.1 \e$B$X$NJQ99E@\e(B
2.12.1 \e$B$O!"\e(B2.12.0 \e$B$N%P%0=$@5HG$G$9!#\e(B
+** Windows \e$B$G\e(B Maildir \e$B$,;H$($k$h$&$K$J$j$^$7$?!#\e(B
+ \e$B$?$@$7!"5,3J$KB'$C$F$$$^$;$s$N$G!"\e(BUNIX \e$B>e$N\e(B Maildir \e$B$H8_49@-$,$"$j$^$;$s!#\e(B
+
** \e$BF~$l;R$K$J$C$?%a%C%;!<%8$N\e(B IMAP \e$B$K$h$kI=<(;~$NIT6q9g$,2r>C$5$l$^$7$?!#\e(B
\e$BF~$l;R$K$J$C$?%a%C%;!<%8$r%Q!<%H%U%'%C%A$7$?>l9g!"%X%C%@$,I=<($5$l$J$$\e(B
\e$B>l9g$,$"$j$^$7$?$,!"@5$7$/I=<($5$l$k$h$&$K$J$j$^$7$?!#\e(B
+2005-02-11 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-maildir.el (elmo-maildir-separator): Added some OS types
+ to the check logic of file systems which are weak in colon character.
+
+2005-02-11 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo-maildir.el (elmo-maildir-move-file): Simplify.
+
+2005-02-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-maildir.el (elmo-maildir-move-file): New function.
+ (elmo-folder-append-buffer): Use it.
+ (elmo-folder-append-messages): Ditto.
+ (These changes are based on Ron Isaacson's patch [wl-en: 01205])
+
+ * elmo-imap4.el (elmo-imap4-decode-folder-string): Call `utf7-decode'.
+ (elmo-imap4-encode-folder-string): Call `utf7-encode'.
+
+ * elmo-maildir.el (elmo-maildir-separator): New user option.
+ (elmo-maildir-adjust-separator): New macro.
+ (elmo-maildir-list-location): Use it.
+ (elmo-maildir-update-current): Ditto.
+ (elmo-maildir-set-mark): Ditto.
+ (elmo-maildir-delete-mark): Ditto.
+ (These changes are based on Hiroya Murata's patch [wl: 13437])
+
2005-02-06 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* elmo-nntp.el (elmo-nntp-server-command-index): Add entry `xhdr'.
(defsubst elmo-imap4-decode-folder-string (string)
(if elmo-imap4-use-modified-utf7
- (utf7-decode-string string 'imap)
+ (utf7-decode string 'imap)
string))
(defsubst elmo-imap4-encode-folder-string (string)
(if elmo-imap4-use-modified-utf7
- (utf7-encode-string string 'imap)
+ (utf7-encode string 'imap)
string))
;;; Response
(unread ?S 'remove)
(answered ?R)))
+(defcustom elmo-maildir-separator
+ (if (memq system-type
+ '(windows-nt OS/2 emx ms-dos win32 w32 mswindows cygwin))
+ ?\- ?:)
+ "Character separating the id section from the flags section.
+According to the maildir specification, this should be a colon (?:),
+but some file systems don't support colons in filenames."
+ :type 'character
+ :group 'elmo)
+
+(defmacro elmo-maildir-adjust-separator (string)
+ `(if (= elmo-maildir-separator ?:)
+ ,string
+ (elmo-replace-in-string
+ ,string ":" (char-to-string elmo-maildir-separator))))
+
;;; ELMO Maildir folder
(eval-and-compile
(luna-define-class elmo-maildir-folder
(setq locations
(mapcar
(lambda (x)
- (if (string-match "^\\([^:]+\\):\\([^:]+\\)$" x)
+ (if (string-match
+ (elmo-maildir-adjust-separator "^\\([^:]+\\):\\([^:]+\\)$")
+ x)
(progn
(setq sym (elmo-match-string 1 x)
flag-list (string-to-char-list
(expand-file-name (car news) (expand-file-name "new" maildir))
(expand-file-name (concat
(car news)
- (unless (string-match ":2,[A-Z]*$" (car news))
- ":2,"))
+ (unless (string-match
+ (elmo-maildir-adjust-separator ":2,[A-Z]*$")
+ (car news))
+ (elmo-maildir-adjust-separator ":2,")))
(expand-file-name "cur" maildir)))
(setq news (cdr news)))))
(defun elmo-maildir-set-mark (filename mark)
"Mark the FILENAME file in the maildir. MARK is a character."
- (if (string-match "^\\([^:]+:[12],\\)\\(.*\\)$" filename)
+ (if (string-match
+ (elmo-maildir-adjust-separator "^\\([^:]+:[12],\\)\\(.*\\)$")
+ filename)
(let ((flaglist (string-to-char-list (elmo-match-string
2 filename))))
(unless (memq mark flaglist)
(char-list-to-string flaglist)))))
;; Rescue no info file in maildir.
(rename-file filename
- (concat filename ":2," (char-to-string mark))))
+ (concat filename
+ (elmo-maildir-adjust-separator ":2,")
+ (char-to-string mark))))
t)
(defun elmo-maildir-delete-mark (filename mark)
"Mark the FILENAME file in the maildir. MARK is a character."
- (if (string-match "^\\([^:]+:2,\\)\\(.*\\)$" filename)
+ (if (string-match (elmo-maildir-adjust-separator "^\\([^:]+:2,\\)\\(.*\\)$")
+ filename)
(let ((flaglist (string-to-char-list (elmo-match-string
2 filename))))
(when (memq mark flaglist)
basedir)))
filename))
+(defun elmo-maildir-move-file (src dst)
+ (or (condition-case nil
+ (progn
+ ;; 1. Try add-link-to-file, then delete the original.
+ ;; This is safe on NFS.
+ (add-name-to-file src dst)
+ (ignore-errors
+ ;; It's ok if the delete-file fails;
+ ;; elmo-maildir-cleanup-temporal will catch it later.
+ (delete-file src))
+ t)
+ (error))
+ ;; 2. Even on systems with hardlinks, some filesystems (like AFS)
+ ;; might not support them, so fall back on rename-file. This is
+ ;; our best shot at atomic when add-name-to-file fails.
+ (rename-file src dst)))
+
(luna-define-method elmo-folder-append-buffer ((folder elmo-maildir-folder)
&optional flags number)
(let ((basedir (elmo-maildir-folder-directory-internal folder))
(copy-to-buffer dst-buf (point-min) (point-max)))
(as-binary-output-file
(write-region (point-min) (point-max) filename nil 'no-msg))
- ;; add link from new.
- ;; Some filesystem (like AFS) does not have hard-link.
- ;; So we use elmo-copy-file instead of elmo-add-name-to-file here.
- (elmo-copy-file
+ (elmo-maildir-move-file
filename
(expand-file-name
(concat "new/" (file-name-nondirectory filename))
(elmo-copy-file
(elmo-message-file-name src-folder number)
filename)
- ;; Some filesystem (like AFS) does not have hard-link.
- ;; So we use elmo-copy-file instead of elmo-add-name-to-file here.
- (elmo-copy-file
+ (elmo-maildir-move-file
filename
(expand-file-name
(concat "new/" (file-name-nondirectory filename))
+2005-02-11 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl-summary.el (wl-summary-save): Use `write-region-as-binary'
+ instead of `write-region' and simplify.
+
+2005-02-09 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl-template.el (wl-template-select): Cause error if
+ `wl-template-alist' is nil.
+
2005-02-06 TAKAHASHI Kaoru <kaoru@kaisei.org>
* wl-news.el.in: Set file variable `no-byte-compile'.
(interactive)
(let ((filename)
(num (wl-summary-message-number)))
- (if (null wl-save-dir)
- (setq wl-save-dir wl-temporary-file-directory))
+ (unless wl-save-dir
+ (setq wl-save-dir wl-temporary-file-directory))
(if num
(save-excursion
(setq filename (expand-file-name
(concat (int-to-string num)
wl-summary-save-file-suffix)
wl-save-dir))
- (if (null (and arg
- (null (file-exists-p filename))))
- (setq filename
- (read-file-name "Save to file: " filename)))
-
+ (when (or (null arg)
+ (file-exists-p filename))
+ (setq filename (read-file-name "Save to file: " filename)))
(wl-summary-set-message-buffer-or-redisplay)
(set-buffer (wl-message-get-original-buffer))
- (if (and (null arg) (file-exists-p filename))
- (if (y-or-n-p "File already exists. override it? ")
- (write-region (point-min) (point-max) filename))
- (write-region (point-min) (point-max) filename)))
+ (when (or arg
+ (not (file-exists-p filename))
+ (y-or-n-p "File already exists. override it? "))
+ (write-region-as-binary (point-min) (point-max) filename)))
(message "No message to save."))
num))
(defun wl-template-select (&optional arg)
"Select template from `wl-template-alist'."
(interactive "P")
+ (unless wl-template-alist
+ (error "Please set `wl-template-alist'"))
(if (not (if arg
(not wl-template-visible-select)
wl-template-visible-select))