Index: nnmaildir.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmaildir.el,v retrieving revision 7.11 diff -C2 -r7.11 nnmaildir.el *** nnmaildir.el 5 Jul 2005 22:34:47 -0000 7.11 --- nnmaildir.el 8 Oct 2006 22:18:33 -0000 *************** *** 115,118 **** --- 115,126 ---- (defmacro nnmaildir--nov-set-mtime (nov value) `(aset ,nov 3 ,value)) (defmacro nnmaildir--nov-set-extra (nov value) `(aset ,nov 4 ,value)) + (defun nnmaildir--write-region (start end file &optional append visit + lockname) + (if (featurep 'xemacs) + (if (file-exists-p file) + (signal 'file-already-exists + (list "File exists" file)) + (write-region start end file append visit lockname)) + (write-region start end file append visit lockname 'excl))) (defstruct nnmaildir--art *************** *** 482,486 **** (setq file (concat novfile ":")) (nnmaildir--unlink file) ! (write-region (point-min) (point-max) file nil 'no-message nil 'excl)) (rename-file file novfile 'replace) (setf (nnmaildir--art-msgid article) msgid) --- 490,495 ---- (setq file (concat novfile ":")) (nnmaildir--unlink file) ! (nnmaildir--write-region (point-min) (point-max) file nil ! 'no-message nil)) (rename-file file novfile 'replace) (setf (nnmaildir--art-msgid article) msgid) *************** *** 1299,1304 **** (save-excursion (set-buffer buffer) ! (write-region (point-min) (point-max) tmpfile nil 'no-message nil ! 'excl)) (unix-sync) ;; no fsync :( (rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace) --- 1308,1313 ---- (save-excursion (set-buffer buffer) ! (nnmaildir--write-region (point-min) (point-max) tmpfile nil ! 'no-message nil)) (unix-sync) ;; no fsync :( (rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace) *************** *** 1393,1398 **** (condition-case nil (add-name-to-file nnmaildir--file tmpfile) (error ! (write-region (point-min) (point-max) tmpfile nil 'no-message nil ! 'excl) (unix-sync))) ;; no fsync :( (nnheader-cancel-timer 24h) --- 1402,1407 ---- (condition-case nil (add-name-to-file nnmaildir--file tmpfile) (error ! (nnmaildir--write-region (point-min) (point-max) tmpfile nil ! 'no-message nil) (unix-sync))) ;; no fsync :( (nnheader-cancel-timer 24h)