From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.emacs.help Subject: call-process and incremental display of output Date: Tue, 16 Oct 2018 15:25:17 +0200 Message-ID: <87y3ay2fcy.fsf@oldenburg.str.redhat.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1539699005 15444 195.159.176.226 (16 Oct 2018 14:10:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 14:10:05 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 16 16:10:01 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gCQ2r-0003s7-6j for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2018 16:10:01 +0200 Original-Received: from localhost ([::1]:58270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCQ4x-0001DS-Er for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2018 10:12:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCPLp-0004ET-Qy for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 09:25:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCPLm-0001az-1N for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 09:25:33 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:42048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCPLl-0001Sa-HC for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 09:25:29 -0400 Original-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18A04811B7 for ; Tue, 16 Oct 2018 13:25:24 +0000 (UTC) Original-Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9680E1057043 for ; Tue, 16 Oct 2018 13:25:23 +0000 (UTC) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 16 Oct 2018 13:25:24 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Tue, 16 Oct 2018 10:11:33 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118278 Archived-At: I'm trying to show some progress information while downloading email for Gnus using an external program. I think this reproduces the core issue: (defun fw/get-new-mail () (interactive) (let* ((buffer (get-buffer-create "*mbsync*")) (status (with-current-buffer buffer (delete-region (point-min) (point-max)) (call-process "bash" nil (list buffer t) t "-c" " for x in {1..5} ; do date sleep 1 done ")))) (unless (=3D 0 status) (switch-to-buffer buffer) (error "mbsync exit with status %d" status)))) When I run this using =E2=80=98M-x fw/get-new-mail RET=E2=80=99, the buffer= is not displayed, even though I passed t for the display argument. The output from the shell does land in the buffer, which is possible to confirm by putting a line =E2=80=9Cexit 1=E2=80=9D after the =E2=80=9Cdone=E2=80=9C. Any idea what is necessary to get incremental output? I'm running GNU Emacs 25.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.26) of 2018-06-27 (which is usual the Fedora 27 build). Thanks, Florian