Gnus development mailing list
 help / color / mirror / Atom feed
* nnmaildir and XEmacs
@ 2006-10-09 14:28 Michael Piotrowski
  2006-10-10 21:53 ` Reiner Steib
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Piotrowski @ 2006-10-09 14:28 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

Hi,

I recently noticed that nnmaildir.el contains Emacs-specific code,
namely calls to `write-region' where the seventh argument is used with
the semantics of "mustbenew", e.g.:

  (write-region (point-min) (point-max) file nil 'no-message nil 'excl)

On XEmacs however, the seventh argument is "coding-system".
Consequently, a call as above results in the error message "No such
coding system: excl" on XEmacs.

Attached is a patch which fixes the problem for me.

Greetings

-- 
Michael Piotrowski, M.A.                               <mxp@dynalabs.de>
Public key at <http://www.dynalabs.de/mxp/pubkey.txt>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Make nnmaildir.el work on XEmacs --]
[-- Type: text/x-patch, Size: 2475 bytes --]

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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-18  9:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-09 14:28 nnmaildir and XEmacs Michael Piotrowski
2006-10-10 21:53 ` Reiner Steib
2006-10-11  2:19   ` Katsumi Yamaoka
2006-10-11  3:49     ` Katsumi Yamaoka
2006-10-11  8:09       ` Reiner Steib
2006-10-11 12:13         ` Katsumi Yamaoka
2006-10-18  9:03   ` Michael Piotrowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).