From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: call-process and incremental display of output Date: Fri, 19 Oct 2018 22:06:54 -0400 Message-ID: References: <87y3ay2fcy.fsf@oldenburg.str.redhat.com> <87ftx5x9bv.fsf@oldenburg.str.redhat.com> <87tvlh3991.fsf@gmail.com> <87sh113360.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540001131 4359 195.159.176.226 (20 Oct 2018 02:05:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2018 02:05:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: John Shahid Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 20 04:05:26 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 1gDgdq-00012Y-8T for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Oct 2018 04:05:26 +0200 Original-Received: from localhost ([::1]:53432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDgfw-0006i8-E1 for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Oct 2018 22:07:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDgfM-0006i2-7D for help-gnu-emacs@gnu.org; Fri, 19 Oct 2018 22:07:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDgfI-0000Gp-VS for help-gnu-emacs@gnu.org; Fri, 19 Oct 2018 22:07:00 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:34567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDgfI-0000GC-QM for help-gnu-emacs@gnu.org; Fri, 19 Oct 2018 22:06:56 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w9K26sm1023464; Fri, 19 Oct 2018 22:06:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0687E6A3F3; Fri, 19 Oct 2018 22:06:54 -0400 (EDT) In-Reply-To: <87sh113360.fsf@gmail.com> (John Shahid's message of "Fri, 19 Oct 2018 19:52:23 -0400") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6399=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6399> : inlines <6936> : streams <1801814> : uri <2734074> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:118358 Archived-At: > spin up a curl process that connects to our CI server and display the > log output of a build. The server stream the log output as a sequence > of json messages that have to be parsed and appended to the buffer. I > used to do that with the following snippet of code: > > (with-current-buffer log-buffer > (save-excursion > (goto-char (point-max)) > (insert log-line))) Ah, this one. > FYI, what I currently have is something like this: > > (let ((pos (copy-marker (point) t))) > (ignore-errors > (goto-char (point-max)) > (insert payload)) > (goto-char pos)) Yes, many/most process filters end up doing that (tho others use insert-before-markers instead, which comes with other problems). Given how pervasively save-excursion is used, I think changing its behavior is very risky. Admittedly, it didn't prevent me from changing it by dropping the mark handling from it. And window-point-insertion-type is used fairly rarely, so maybe the impact would not be quite as widespread as it seems. Anyway, it's luckily not my call to make ;-) I'd suggest you try running with such a change for some months, trying to use a variety of packages and see if you bump into problems. Stefan