GNU bug report logs - #17139
Race condition in complete-in-region: should we be using pre-command-hook, not post-command-hook?

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Sat, 29 Mar 2014 02:19:02 UTC

Severity: normal

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17139: closed (Race condition in complete-in-region: should
 we be using pre-command-hook, not post-command-hook?)
Date: Sat, 04 Jun 2016 22:18:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 4 Jun 2016 18:17:49 -0400
with message-id <CAM-tV--N8tP9uGoH4VfgHBU6LTzyCMnDRPEEVV7w6LU+0RysYw <at> mail.gmail.com>
and subject line Re: bug#17139: Race condition in complete-in-region: should we be using pre-command-hook, not post-command-hook?
has caused the debbugs.gnu.org bug report #17139,
regarding Race condition in complete-in-region: should we be using pre-command-hook, not post-command-hook?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17139: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17139
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Daniel Colascione <dancol <at> dancol.org>
To: "bug-gnu-ema >> bug-emacs" <bug-gnu-emacs <at> gnu.org>
Subject: Race condition in complete-in-region: should we be using
 pre-command-hook, not post-command-hook?
Date: Fri, 28 Mar 2014 19:18:04 -0700
[Message part 3 (text/plain, inline)]
Say we're using a mode derived from comint that implements completion by
using the comint redirection functionality to send commands to the
process associated with the comint buffer. Say we have TAB bound to
complete-symbol. If the user presses TAB (to create a list of
completions) and then immediately presses RET to run comint-send-input,
we send the input to the subprocess, but don't wait for a reply. Then we
run post-command-hook; completion-in-region--postch is on the list of
hooks to run. This function runs completion-in-region-mode--predicate,
which makes a hidden call to the subprocess; this hidden call involves
writing a command waiting for a reply. But because we just sent the
*user* line in comint-send-input, we might actually read the response to
*that* line instead of the internal completion command, causing an
error. The response to the internal completion command then appears in
the comint buffer.

Why can't we do the completion-in-region--postch stuff in pre-command-hook?

[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 17139-done <at> debbugs.gnu.org
Cc: Daniel Colascione <dancol <at> dancol.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17139: Race condition in complete-in-region: should we be
 using pre-command-hook, not post-command-hook?
Date: Sat, 4 Jun 2016 18:17:49 -0400
Closing since this seems to have been resolved.


This bug report was last modified 8 years and 348 days ago.

Previous Next


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