emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: special-display-buffer-names and vc-diff displays wrong result


From: Stefan Monnier
Subject: Re: special-display-buffer-names and vc-diff displays wrong result
Date: Mon, 03 Oct 2005 16:43:07 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     To figure out whether there's been diffs or not, the sentinel function
>     checks whether the resulting buffer is empty.

> I think that is a mistake.  The reliable way for it to tell
> whether there are differences is to look at the exit status from diff.

That's beside the point.

>     Given his description of the problem, my guess is that somehow the
>     sentinel is run before all the process's output has been processed.

> That can happen.  Two different signals indicate (1) the process is dead
> and (2) there is output.  I think they can arrive in any order.
> Does anyone know for certain?

> Also, wait_reading_process_output runs sentinels before it
> reads output.  So if the signals arrive at the same time,
> Emacs will run the sentinel first.

If the sentinel happens to run first, is the output still processed
afterwards or is it just discarded?

> That is arguably a bug, but I think it is really risky to change that.

It does sound like a bug, indeed.  But maybe not: maybe the sentinel
processing code first reads the process's output?


        Stefan


PS: As for why VC doesn't check the output status of diff:
- it doesn't run diff, it runs cvs diff, rcsdiff, sccs-diff, tla file-diffs,
  mcvs diff, svn diff, ... which do not all report the absence of changes in
  the same way.
- it doesn't actually care whether there were diffs or not: the code is just
  trying to make sure that the buffer doesn't stay empty, leaving the user
  to wonder whether the command got frozen or just didn't produce
  any output.  So it also makes sense to check the buffer's emptiness.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]