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

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

bug#51177: 29.0.50; stop-process on pipes


From: Helmut Eller
Subject: bug#51177: 29.0.50; stop-process on pipes
Date: Thu, 11 Nov 2021 20:47:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

I have another problem with stopped output.  In this example:

;;; -*- lexical-binding:t -*-

(ert-deftest test-read-after-exit ()
  (let* ((output "")
         (filter (lambda (p s) (setq output (concat output s))))
         (sentinel (lambda (p _)
                     (set-process-filter p filter)
                     (while (accept-process-output p 0))))
         (proc (make-process :command '("printf" "foo")
                             :name "test-proc"
                             :filter t
                             :sentinel sentinel
                             :connection-type 'pipe)))
    (while (process-live-p proc)
      (accept-process-output proc 0.2))
    (set-process-filter proc filter)
    (while (accept-process-output proc 0))
    (should (equal output "foo"))))

the filter function is never called.

We could say that reading the process's output after the process has
terminated is an unreasonable request.  However, I would like to propose
that, in status_notify, the sentinel function should be called before
closing the file descriptors.  That way, the sentinel can read the
buffered output as suggested in the example.

Helmut





reply via email to

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