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

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

Re: call-process and incremental display of output


From: John Shahid
Subject: Re: call-process and incremental display of output
Date: Sun, 21 Oct 2018 13:05:17 -0400
User-agent: mu4e 1.1.0; emacs 27.0.50

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> 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.
>

Sounds good.  I'll make the change locally and test it for a month or
two and report back.

Thanks,

js




reply via email to

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