unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>, 5924@debbugs.gnu.org
Subject: bug#5924: 23.1; accept-process-output switching current-buffer
Date: Mon, 24 May 2010 01:07:53 +0100	[thread overview]
Message-ID: <19449.50009.338000.183687@gargle.gargle.HOWL> (raw)
In-Reply-To: <jwv8w8ux962.fsf-monnier+emacs@gnu.org>

Dear Stefan,

I have now tried this with the Windows build that was published today:
emacs-20100523.  The same problem occurs.  (Of course, there was no
reason to expect that anything would be different.)

Even though I am able to protect the spurious buffer-change inside VM
using my wrapper for accept-process-output, I can't do anything if
some other process is invoked and the VM process interferes with it.
This is now regularly occurring with smtpmail.  In the middle of
smtpmail, the buffer is changing to VM's IMAP process buffer (invoked
for an FCC to an IMAP folder), and smtpmail fails.  Sometimes the smtp
has gone through and sometimes it hasn't.  This is getting to be an
annoyance.

I am repeating my previous message again below, because it got
MIME-encoded in a strange way last time:

----

Here is my current proxy for accept-process-output:

  (defsubst vm-accept-process-output (process)
    "Accept output from PROCESS.  The variable `vm-imap-server-timeout'
  specifies how many seconds to wait before timing out.  If a timeout
  occurs, typically VM cannot proceed."
    ;; protect against possible buffer change due to bug in Emacs
    (let ((buf (current-buffer))
	  (got-output (accept-process-output process vm-imap-server-timeout)))
      (if got-output
	  (when (not (equal (current-buffer) buf))
	    (if (string-lessp "24" emacs-version)
		;; the Emacs bug should have been fixed
		(message 
		 "Emacs process output error: Buffer changed to %s" 
		 (current-buffer)))
	    ;; recover from the bug
	    (set-buffer buf))
	(vm-imap-protocol-error "No response from the IMAP server"))))

and the error came up pretty much the first time I tried it:

  Emacs process output error: Buffer changed to saved IMAP mailhost.c 10:31:09

The current-buffer should have been "IMAP mailhost.c 10:31.40".  But
it switched to the "IMAP mailhost.c 10:31:09" (call it the "old
buffer") because its process sent some output.

I am attaching the contents of the old buffer.  I think the last line
would have been output while the current accept-process-output was
done.  (Note that this line came in a few seconds after the current
process got started.)

-----

starting IMAP session Thu May 20 10:31:09 2010
connecting to mailhost.cs.bham.ac.uk:143
connected for fetch
* OK IMAP4 Ready imap 0001cdf3
VM CAPABILITY
* CAPABILITY IMAP4 IMAP4REV1
VM OK CAPABILITY
VM LOGIN <parameters omitted>
VM OK Logged in.
VM SELECT "INBOX"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft forwarded filed redistributed
! $Forwarded 7350 7354 7391 signed * accept action plagiarism Junk NonJunk !@)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft forwarded filed
redistributed ! $Forwarded 7350 7354 7391 signed * accept action plagiarism
Junk NonJunk !@ \*)] Flags permitted.
* 2648 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1217243146] UIDs valid
* OK [UIDNEXT 26600] Predicted next UID
VM OK [READ-WRITE] Select completed.
VM UID FETCH 26471:26471 (RFC822.SIZE)
* 2594 FETCH (RFC822.SIZE 58175 UID 26471)
VM OK Fetch completed.
VM UID FETCH 26471:26471 (BODY.PEEK[])
* 2594 FETCH (UID 26471 BODY[] {58175}
)
VM OK Fetch completed.
VM NOOP
VM OK NOOP completed.
VM UID FETCH 26582:26582 (RFC822.SIZE)
* 2638 FETCH (RFC822.SIZE 2181 UID 26582)
VM OK Fetch completed.
VM UID FETCH 26582:26582 (BODY.PEEK[])
* 2638 FETCH (UID 26582 BODY[] {2181}
)
VM OK Fetch completed.
VM NOOP
VM OK NOOP completed.
VM UID FETCH 26471:26471 (RFC822.SIZE)
* 2594 FETCH (RFC822.SIZE 58175 UID 26471)
VM OK Fetch completed.
VM UID FETCH 26471:26471 (BODY.PEEK[])
* 2594 FETCH (UID 26471 BODY[] {58175}
)
VM OK Fetch completed.
VM NOOP
VM OK NOOP completed.
VM UID FETCH 26578:26578 (RFC822.SIZE)
* 2635 FETCH (RFC822.SIZE 52388 UID 26578)
VM OK Fetch completed.
VM UID FETCH 26578:26578 (BODY.PEEK[])
* 2635 FETCH (UID 26578 BODY[] {52388}
)
VM OK Fetch completed.
VM LOGOUT
* BYE Logging out
VM OK Logout completed.

Process IMAP<2> connection broken by remote peer
ending IMAP session Thu May 20 10:31:43 2010

---

Cheers,
Uday





  parent reply	other threads:[~2010-05-24  0:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10 21:23 bug#5924: 23.1; accept-process-output switching current-buffer Uday S Reddy
2010-04-11  2:54 ` Stefan Monnier
2010-04-11 12:22   ` Uday S Reddy
2010-04-11 16:30     ` Stefan Monnier
2010-04-12 19:13       ` Uday S Reddy
2010-04-12 20:58         ` Stefan Monnier
2010-04-12 19:39       ` Uday S Reddy
2010-05-20  9:50       ` Uday S Reddy
2010-05-24  0:07       ` Uday S Reddy [this message]
2010-05-24  2:04       ` Uday S Reddy
2010-07-23 22:36         ` Stefan Monnier
2011-09-18 20:16           ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19449.50009.338000.183687@gargle.gargle.HOWL \
    --to=u.s.reddy@cs.bham.ac.uk \
    --cc=5924@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).