Gnus development mailing list
 help / color / mirror / Atom feed
* Re: nnmaildir.el error caused by using function `='
       [not found] <83hbyh6hy2.fsf@gmail.com>
@ 2009-07-14 23:17 ` Katsumi Yamaoka
  2009-07-15  1:49   ` Haojun Bao
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2009-07-14 23:17 UTC (permalink / raw)
  To: ding; +Cc: Haojun Bao, bugs

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

>>>>> Haojun Bao wrote:
> hi,

> As you might see from the `User settings' section, I'm using emacs on
> Windows...
> Anyway, I have an error when using Gnus with nnmaildir:
> error in process filter: wrong type argument number-or-marker-p

> I checked Gnus info and did a little debugging, I think the culprit is
> this code in nnmaildir.el:

> 	(unless (and (= x (nth 11 nattr)) (= x (nth 11 cattr)))

> `nattr' is returned by `file-attributes', help on this function says
> about item 11:

>     11. Device number.  If it is larger than the Emacs integer, this is
>       a cons cell, similar to the inode number.

> And in my case, it is a cons cell.

[...]

That's obviously a bug, moreover, nnmaildir treats i-node as just
a number, too.

    10. inode number.  If inode number is larger than the Emacs integer,
      but still fits into a 32-bit number, this is a cons cell containing two
      integers: first the high part, then the low 16 bits.  If the inode number
      is wider than 32 bits, this is a cons cell containing three integers:
      first the high 24 bits, then middle 24 bits, and finally the low 16 bits.

Could anyone verify the attached patch?  I'm not a nnmaildir user.

2009-07-14  Katsumi Yamaoka  <yamaoka@jpl.org>

	* nnmaildir.el (nnmaildir--group-maxnum, nnmaildir--new-number)
	(nnmaildir--scan): Assume i-node and device number that file-attributes
	returns might be cons-cell.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1407 bytes --]

--- nnmaildir.el~	2008-05-20 22:11:27 +0000
+++ nnmaildir.el	2009-07-14 23:16:05 +0000
@@ -270,8 +270,8 @@
 	(setq attr (file-attributes
 		    (concat dir (number-to-string number-linked))))
 	(or attr (throw 'return (1- number-linked)))
-	(if (/= ino-opened (nth 10 attr))
-	    (setq number-opened number-linked))))))
+	(unless (equal ino-opened (nth 10 attr))
+	  (setq number-opened number-linked))))))
 
 ;; Make the given server, if non-nil, be the current server.  Then make the
 ;; given group, if non-nil, be the current group of the current server.  Then
@@ -361,9 +361,9 @@
 		  number-open number-link))
 	   ((nnmaildir--eexist-p err)
 	    (let ((attr (file-attributes path-link)))
-	      (if (/= (nth 10 attr) ino-open)
-		  (setq number-open number-link
-			number-link 0))))
+	      (unless (equal (nth 10 attr) ino-open)
+		(setq number-open number-link
+		      number-link 0))))
 	   (t (signal (car err) (cdr err)))))))))
 
 (defun nnmaildir--update-nov (server group article)
@@ -744,7 +744,7 @@
 	    ls (or (nnmaildir--param pgname 'directory-files) srv-ls))
       (unless read-only
 	(setq x (nth 11 (file-attributes tdir)))
-	(unless (and (= x (nth 11 nattr)) (= x (nth 11 cattr)))
+	(unless (and (equal x (nth 11 nattr)) (equal x (nth 11 cattr)))
 	  (setf (nnmaildir--srv-error nnmaildir--cur-server)
 		(concat "Maildir spans filesystems: " absdir))
 	  (throw 'return nil))

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

* Re: nnmaildir.el error caused by using function `='
  2009-07-14 23:17 ` nnmaildir.el error caused by using function `=' Katsumi Yamaoka
@ 2009-07-15  1:49   ` Haojun Bao
  0 siblings, 0 replies; 2+ messages in thread
From: Haojun Bao @ 2009-07-15  1:49 UTC (permalink / raw)
  To: ding, bugs


After some further looking, I see that nnmaildir will not be usable with
native win32 Emacs after all. Because it seems nnmaildir will put ':'
into the filename, which is not allowed with win32.

The new cygwin-1.7 version do allow those strange character already
though. It's better if somebody start with their version of
emacs. (23.0.92 is currebtly included in cygwin1.7).

Also, another issue which discouraged me from native version of win32
Emacs is the nnimap is very slow even my IMAP server is in the LAN. If I
use other mail clients like ThunderBird, I can download a mail of large
size (~10M) instantly, but with EmacsW32, I can see the "read imap
NNNNk) running like a stopwatch.

(Procexp will show that Emacs is reading from openssl (from cygwin)
about 64k bytes per second; I googled for "win32 64k pipe", seems
dos/win32 programs do have this limitation for compatibility? I'm not
sure and simply switched to cygwin-1.7 version of emacs).


Katsumi Yamaoka writes:

>>>>>> Haojun Bao wrote:
>> hi,
>
>> As you might see from the `User settings' section, I'm using emacs on
>> Windows...
>> Anyway, I have an error when using Gnus with nnmaildir:
>> error in process filter: wrong type argument number-or-marker-p
>
>> I checked Gnus info and did a little debugging, I think the culprit is
>> this code in nnmaildir.el:
>
>> 	(unless (and (= x (nth 11 nattr)) (= x (nth 11 cattr)))
>
>> `nattr' is returned by `file-attributes', help on this function says
>> about item 11:
>
>>     11. Device number.  If it is larger than the Emacs integer, this is
>>       a cons cell, similar to the inode number.
>
>> And in my case, it is a cons cell.
>
> [...]
>
> That's obviously a bug, moreover, nnmaildir treats i-node as just
> a number, too.
>
>     10. inode number.  If inode number is larger than the Emacs integer,
>       but still fits into a 32-bit number, this is a cons cell containing two
>       integers: first the high part, then the low 16 bits.  If the inode number
>       is wider than 32 bits, this is a cons cell containing three integers:
>       first the high 24 bits, then middle 24 bits, and finally the low 16 bits.
>
> Could anyone verify the attached patch?  I'm not a nnmaildir user.
>
> 2009-07-14  Katsumi Yamaoka  <yamaoka@jpl.org>
>
> 	* nnmaildir.el (nnmaildir--group-maxnum, nnmaildir--new-number)
> 	(nnmaildir--scan): Assume i-node and device number that file-attributes
> 	returns might be cons-cell.
>
> --- nnmaildir.el~	2008-05-20 22:11:27 +0000
> +++ nnmaildir.el	2009-07-14 23:16:05 +0000
> @@ -270,8 +270,8 @@
>  	(setq attr (file-attributes
>  		    (concat dir (number-to-string number-linked))))
>  	(or attr (throw 'return (1- number-linked)))
> -	(if (/= ino-opened (nth 10 attr))
> -	    (setq number-opened number-linked))))))
> +	(unless (equal ino-opened (nth 10 attr))
> +	  (setq number-opened number-linked))))))
>  
>  ;; Make the given server, if non-nil, be the current server.  Then make the
>  ;; given group, if non-nil, be the current group of the current server.  Then
> @@ -361,9 +361,9 @@
>  		  number-open number-link))
>  	   ((nnmaildir--eexist-p err)
>  	    (let ((attr (file-attributes path-link)))
> -	      (if (/= (nth 10 attr) ino-open)
> -		  (setq number-open number-link
> -			number-link 0))))
> +	      (unless (equal (nth 10 attr) ino-open)
> +		(setq number-open number-link
> +		      number-link 0))))
>  	   (t (signal (car err) (cdr err)))))))))
>  
>  (defun nnmaildir--update-nov (server group article)
> @@ -744,7 +744,7 @@
>  	    ls (or (nnmaildir--param pgname 'directory-files) srv-ls))
>        (unless read-only
>  	(setq x (nth 11 (file-attributes tdir)))
> -	(unless (and (= x (nth 11 nattr)) (= x (nth 11 cattr)))
> +	(unless (and (equal x (nth 11 nattr)) (equal x (nth 11 cattr)))
>  	  (setf (nnmaildir--srv-error nnmaildir--cur-server)
>  		(concat "Maildir spans filesystems: " absdir))
>  	  (throw 'return nil))



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

end of thread, other threads:[~2009-07-15  1:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <83hbyh6hy2.fsf@gmail.com>
2009-07-14 23:17 ` nnmaildir.el error caused by using function `=' Katsumi Yamaoka
2009-07-15  1:49   ` Haojun Bao

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).