GNU bug report logs - #9272
[nnir] (invalid-read-syntax "#")

Previous Next

Package: gnus;

Reported by: Dave Abrahams <dave <at> boostpro.com>

Date: Tue, 9 Aug 2011 17:05:02 UTC

Severity: normal

Merged with 9271

Found in version 5.110018

Done: Andrew Cohen <cohen <at> andy.bu.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrew Cohen <cohen <at> andy.bu.edu>
To: Dave Abrahams <dave <at> boostpro.com>
Cc: 9272 <at> debbugs.gnu.org
Subject: bug#9272: [nnir] (invalid-read-syntax "#")
Date: Thu, 11 Aug 2011 13:06:27 -0400
I don't think this is a bug in nnir. It looks like its a bug in
`nnimap-transform-headers'. If I read the RFC correctly the parsing of a
bodystructure is special for a bodytype of "MESSAGE" and subtype of
"RFC822".  Can you try evaluating the modified version of
`nnimap-transform-headers' below and see if it fixes the problem?


(defun nnimap-transform-headers ()
  (goto-char (point-min))
  (let (article bytes lines size string)
    (block nil
      (while (not (eobp))
	(while (not (looking-at "\\* [0-9]+ FETCH.+UID \\([0-9]+\\)"))
	  (delete-region (point) (progn (forward-line 1) (point)))
	  (when (eobp)
	    (return)))
	(setq article (match-string 1))
	;; Unfold quoted {number} strings.
	(while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r?\n"
				  (1+ (line-end-position)) t)
	  (setq size (string-to-number (match-string 1)))
	  (delete-region (+ (match-beginning 0) 2) (point))
	  (setq string (buffer-substring (point) (+ (point) size)))
	  (delete-region (point) (+ (point) size))
	  (insert (format "%S" string)))
	(setq bytes (nnimap-get-length)
	      lines nil)
	(beginning-of-line)
	(setq size
	      (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"
				      (line-end-position)
				      t)
		   (match-string 1)))
	(beginning-of-line)
	(when (search-forward "BODYSTRUCTURE" (line-end-position) t)
	  (let ((structure (ignore-errors
			     (read (current-buffer)))))
	    (while (and (consp structure)
			(not (stringp (car structure))))
	      (setq structure (car structure)))
	    (setq lines (if (and 
			     (equal (nth 0 structure) "MESSAGE") 
			     (equal (nth 1 structure) "RFC822"))
			    (nth 9 structure)
			  (nth 7 structure)))))
	(delete-region (line-beginning-position) (line-end-position))
	(insert (format "211 %s Article retrieved." article))
	(forward-line 1)
	(when size
	  (insert (format "Chars: %s\n" size)))
	(when lines
	  (insert (format "Lines: %s\n" lines)))
	(unless (re-search-forward "^\r$" nil t)
	  (goto-char (point-max)))
	(delete-region (line-beginning-position) (line-end-position))
	(insert ".")
	(forward-line 1)))))




This bug report was last modified 13 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.