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


Message #11 received at 17139 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 17139 <at> debbugs.gnu.org
Subject: Re: bug#17139: Race condition in complete-in-region: should we be
 using pre-command-hook, not post-command-hook?
Date: Sun, 30 Mar 2014 17:39:19 -0400
>> 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;

Using the subprocess from completion-in-region--postch sounds
like a problem/bug, indeed.  Why do we(I?) do that?

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

Because pre-command-hook would come even later (it would only disable
completion-in-region-mode at the beginning of the next command after RET).

> +  ;; If we're currently completing, stop.  We're definitely done
> +  ;; completing, and by sending the input, we might cause side effects
> +  ;; that will confuse the code running in the completion
> +  ;; post-command-hook.
> +  (when completion-in-region-mode
> +    (completion-in-region-mode -1))

I see you installed it, thanks, I think it's OK.  But I'd also like to
know why we contact the subprocess from completion-in-region--postch,
because that's risky.


        Stefan




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.