bug-gnu-emacs
[Top][All Lists]
Advanced

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

`shell-resync-dir' hangs


From: Jens Schmidt
Subject: `shell-resync-dir' hangs
Date: 10 Jul 2001 17:22:01 +0100

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.1 (i386-*-nt4.0.1381)
 of Tue Jun 13 2000 on buffy
configured using `configure NT'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

`shell-resync-dir' hangs if `comint-truncate-buffer' is in
`comint-output-filter-functions' and the shell buffer is at its
maximum size.

The reason is the following `while'-loop in `shell-resync-dir':

    (let ((pt (point))) ; wait for 1 line
      ;; This extra newline prevents the user's pending input from spoofing us.
      (insert "\n") (backward-char 1)
      (while (not (looking-at ".+\n"))
        (accept-process-output proc)
        (goto-char pt)))

In the scenario described above, calling `accept-process-output'
triggers `comint-truncate-buffer' which removes text *before* the
location `pt' point to.  As a result, `pt' points to (for
example) after `(point-max)', so the `looking-at' never
recognizes that process output has been inserted.  Another
variant may be that `pt' point to the middle of the process
output, leading to incorrect results.

Making `pt' a marker does not help, since `comint-output-filter'
uses `insert-before-markers' to insert its text.

A possible solution would be to replace the expression
`(goto-char pt)' by `(goto-char comint-last-output-start)' and
remove the surrounding `let' alltogether, but I am not sure about
correctness of this one.  However, I'll try it as a workaround.

Regards

Jens




reply via email to

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