* [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
@ 2008-12-23 18:39 Michael Olson
2008-12-28 4:29 ` Michael Olson
0 siblings, 1 reply; 6+ messages in thread
From: Michael Olson @ 2008-12-23 18:39 UTC (permalink / raw)
To: ding
* lisp/gnus/nnimap.el (nnimap-retrieve-headers-progress): Handle edge
case where `headers' is nil. This can occur if the IMAP server does
not have permissions to read messages from a folder, but can write new
messages to the folder.
(nnimap-request-article-part): Do not insert `data' if it is nil.
* lisp/net/imap.el (imap-parse-fetch): Courier can insert spurious blank
characters which will confuse `read', so skip past them.
---
This applies to Emacs CVS HEAD.
This version backs up one char in order to appease nnimap-forward.
lisp/gnus/nnimap.el | 9 +++++----
lisp/net/imap.el | 4 +++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index e0bb5ad..a38d354 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -620,7 +620,7 @@ If EXAMINE is non-nil the group is selected read-only."
;; to make it more clear.
(mm-with-unibyte-buffer
(buffer-disable-undo)
- (insert headers)
+ (when headers (insert headers))
(let ((head (nnheader-parse-naked-head uid)))
(mail-header-set-number head uid)
(mail-header-set-chars head chars)
@@ -950,9 +950,10 @@ function is generally only called when Gnus is shutting down."
(erase-buffer)
(let ((data (imap-fetch article part prop nil
nnimap-server-buffer)))
- (insert (nnimap-demule (if detail
- (nth 2 (car data))
- data))))
+ (when data
+ (insert (nnimap-demule (if detail
+ (nth 2 (car data))
+ data)))))
(nnheader-ms-strip-cr)
(gnus-message
10 "nnimap: Fetching (part of) article %d from %s...done"
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 6726bfd..85afffc 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -2493,7 +2493,9 @@ Return nil if no complete line has arrived."
(when (eq (char-after) ?\()
(let (uid flags envelope internaldate rfc822 rfc822header rfc822text
rfc822size body bodydetail bodystructure flags-empty)
- (while (not (eq (char-after) ?\)))
+ (while (let ((moved (skip-chars-forward " \t")))
+ (prog1 (not (eq (char-after) ?\)))
+ (unless (= moved 0) (backward-char))))
(imap-forward)
(let ((token (read (current-buffer))))
(imap-forward)
--
1.5.6.3
--
| Michael Olson | FSF Associate Member #652 |
| http://mwolson.org/ | Hobbies: Lisp, HCoop |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
2008-12-23 18:39 [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity Michael Olson
@ 2008-12-28 4:29 ` Michael Olson
2008-12-29 21:31 ` Ted Zlatanov
0 siblings, 1 reply; 6+ messages in thread
From: Michael Olson @ 2008-12-28 4:29 UTC (permalink / raw)
To: ding
Michael Olson <mwolson@gnu.org> writes:
> This applies to Emacs CVS HEAD.
>
> This version backs up one char in order to appease nnimap-forward.
>
> lisp/gnus/nnimap.el | 9 +++++----
> lisp/net/imap.el | 4 +++-
> 2 files changed, 8 insertions(+), 5 deletions(-)
Does anyone mind if I apply this version of the patch to Emacs CVS next
week?
--
| Michael Olson | FSF Associate Member #652 |
| http://mwolson.org/ | Hobbies: Lisp, HCoop |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
2008-12-28 4:29 ` Michael Olson
@ 2008-12-29 21:31 ` Ted Zlatanov
2009-01-03 23:12 ` Michael Olson
0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2008-12-29 21:31 UTC (permalink / raw)
To: ding
On Sat, 27 Dec 2008 20:29:38 -0800 Michael Olson <mwolson@member.fsf.org> wrote:
MO> Michael Olson <mwolson@gnu.org> writes:
>> This applies to Emacs CVS HEAD.
>>
>> This version backs up one char in order to appease nnimap-forward.
>>
>> lisp/gnus/nnimap.el | 9 +++++----
>> lisp/net/imap.el | 4 +++-
>> 2 files changed, 8 insertions(+), 5 deletions(-)
MO> Does anyone mind if I apply this version of the patch to Emacs CVS next
MO> week?
No, I tried it with Courier and haven't seen any problems.
Ted
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
2008-12-29 21:31 ` Ted Zlatanov
@ 2009-01-03 23:12 ` Michael Olson
2009-01-03 23:56 ` Reiner Steib
0 siblings, 1 reply; 6+ messages in thread
From: Michael Olson @ 2009-01-03 23:12 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: ding
Ted Zlatanov <tzz@lifelogs.com> writes:
> On Sat, 27 Dec 2008 20:29:38 -0800 Michael Olson <mwolson@member.fsf.org> wrote:
>
> MO> Michael Olson <mwolson@gnu.org> writes:
>>> This applies to Emacs CVS HEAD.
>>>
>>> This version backs up one char in order to appease nnimap-forward.
>>>
>>> lisp/gnus/nnimap.el | 9 +++++----
>>> lisp/net/imap.el | 4 +++-
>>> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> MO> Does anyone mind if I apply this version of the patch to Emacs CVS next
> MO> week?
>
> No, I tried it with Courier and haven't seen any problems.
I've checked in the changes to CVS Emacs.
--
| Michael Olson | FSF Associate Member #652 |
| http://mwolson.org/ | Hobbies: Lisp, HCoop |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
2009-01-03 23:12 ` Michael Olson
@ 2009-01-03 23:56 ` Reiner Steib
2009-01-04 0:03 ` Michael Olson
0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2009-01-03 23:56 UTC (permalink / raw)
To: Michael Olson; +Cc: ding
On Sun, Jan 04 2009, Michael Olson wrote:
>> MO> Michael Olson <mwolson@gnu.org> writes:
>>>> * lisp/gnus/nnimap.el (nnimap-retrieve-headers-progress): Handle edge
>>>> case where `headers' is nil. This can occur if the IMAP server does
>>>> not have permissions to read messages from a folder, but can write new
>>>> messages to the folder.
>>>> (nnimap-request-article-part): Do not insert `data' if it is nil.
>>>>
>>>> * lisp/net/imap.el (imap-parse-fetch): Courier can insert spurious blank
>>>> characters which will confuse `read', so skip past them.
> I've checked in the changes to CVS Emacs.
Thanks.
Could you put the explanations (like in the ChangeLog) next to the
relevant code, please?
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity.
2009-01-03 23:56 ` Reiner Steib
@ 2009-01-04 0:03 ` Michael Olson
0 siblings, 0 replies; 6+ messages in thread
From: Michael Olson @ 2009-01-04 0:03 UTC (permalink / raw)
To: ding
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> On Sun, Jan 04 2009, Michael Olson wrote:
>
>>> MO> Michael Olson <mwolson@gnu.org> writes:
>>>>> * lisp/gnus/nnimap.el (nnimap-retrieve-headers-progress): Handle edge
>>>>> case where `headers' is nil. This can occur if the IMAP server does
>>>>> not have permissions to read messages from a folder, but can write new
>>>>> messages to the folder.
>>>>> (nnimap-request-article-part): Do not insert `data' if it is nil.
>>>>>
>>>>> * lisp/net/imap.el (imap-parse-fetch): Courier can insert spurious blank
>>>>> characters which will confuse `read', so skip past them.
>> I've checked in the changes to CVS Emacs.
>
> Thanks.
>
> Could you put the explanations (like in the ChangeLog) next to the
> relevant code, please?
Done.
--
| Michael Olson | FSF Associate Member #652 |
| http://mwolson.org/ | Hobbies: Lisp, HCoop |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-04 0:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 18:39 [PATCH v2] Fix edge cases with no data being returned and Courier eccentricity Michael Olson
2008-12-28 4:29 ` Michael Olson
2008-12-29 21:31 ` Ted Zlatanov
2009-01-03 23:12 ` Michael Olson
2009-01-03 23:56 ` Reiner Steib
2009-01-04 0:03 ` Michael Olson
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).