Jury is still out what the right module actually is.
I've seen random erase of all content of buffers I was idling in.
Turns out gnus-group-get-new-news is doing it in imap-close.
Digging deeper it is (delete-process imap-process) which has the side-
effect of changing current-buffer from the imap process buffer to the
buffer active when gnus-group-get-new-news triggered.
Here's my debugging code and aoutput.
This should probably be simplified to automated tests for delete-
process, not involving gnus and imap.
Adrian
(defun imap-close (&optional buffer)
"Close connection to server in BUFFER.
If BUFFER is nil, the current buffer is used."
(with-current-buffer (or buffer (current-buffer))
(message "in imap-close (1) before eb: buffer: %s, cb: %s" buffer
(current-buffer))
(when (imap-opened)
(condition-case nil
(imap-send-command-wait "LOGOUT")
(quit nil)))
(message "in imap-close (2) before eb: buffer: %s, cb: %s" buffer
(current-buffer))
(when (and imap-process
(memq (process-status imap-process) '(open run)))
(message "in imap-close (4) before eb: buffer: %s, cb: %s" buffer
(current-buffer))
(delete-process imap-process)
(message "in imap-close (5) before eb: buffer: %s, cb: %s" buffer
(current-buffer))
)
(setq imap-current-mailbox nil
imap-current-message nil
imap-process nil)
(message "in imap-close (3) before eb: buffer: %s, cb: %s" buffer
(current-buffer))
(erase-buffer)
t))
Recent minibuffer messages (most recent first):
in imap-close (3) before eb: buffer: *imap source*<6>, cb: *Group*
in imap-close (5) before eb: buffer: *imap source*<6>, cb: *Group*
in imap-close (4) before eb: buffer: *imap source*<6>, cb: *imap
source*<6>
in imap-close (2) before eb: buffer: *imap source*<6>, cb: *imap
source*<6>
in imap-close (1) before eb: buffer: *imap source*<6>, cb: *imap
source*<6>
|