unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* call-process and incremental display of output
@ 2018-10-16 13:25 Florian Weimer
  2018-10-16 14:21 ` Michael Albinus
  2018-10-16 14:36 ` Stefan Monnier
  0 siblings, 2 replies; 18+ messages in thread
From: Florian Weimer @ 2018-10-16 13:25 UTC (permalink / raw)
  To: help-gnu-emacs

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 (= 0 status)
      (switch-to-buffer buffer)
      (error "mbsync exit with status %d" status))))

When I run this using ‘M-x fw/get-new-mail RET’, 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 “exit 1” after the “done“.

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



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-02-27 14:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 13:25 call-process and incremental display of output Florian Weimer
2018-10-16 14:21 ` Michael Albinus
2018-10-16 14:26   ` Florian Weimer
2018-10-16 14:32     ` Michael Albinus
2018-10-16 14:36 ` Stefan Monnier
2018-10-17  8:32   ` Florian Weimer
2018-10-17  9:21     ` tomas
2018-10-17  9:34       ` Florian Weimer
2018-10-17  9:40         ` tomas
2018-10-17 14:59     ` Stefan Monnier
2018-10-19 21:40       ` John Shahid
2018-10-19 22:05         ` Stefan Monnier
2018-10-19 23:52           ` John Shahid
2018-10-20  2:06             ` Stefan Monnier
2018-10-21 17:05               ` John Shahid
     [not found]                 ` <jwv36szqj1d.fsf-monnier+emacs@gnu.org>
2018-12-26 17:47                   ` John Shahid
2019-02-27 12:59                     ` John Shahid
2019-02-27 14:11                       ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).