unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: call-process and incremental display of output
Date: Thu, 28 Feb 2019 14:16:47 -0500	[thread overview]
Message-ID: <87h8cn7mg0.fsf@gmail.com> (raw)
In-Reply-To: <jwvk1hlnxah.fsf-monnier+emacs@gnu.org>


[ -help-gnu-emacs and +emacs-devel ]

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

>> Ping.  Not sure if my previous email was lost in the ether.  FWIW, I am
>> still using that patch and didn't run into any issues.  It works as I
>> expected, i.e. when point is at eob, new text is inserted before the
>> point.
>
> This should go to emacs-devel.

Good point.  I didn't realize this thread was CC'ing help-gnu-emacs.  I
think there is enough context below for those who haven't been following
the original thread.

> FWIW, I noticed at least the following incompatibility with this patch:
>
>     emacs -Q
>     M-x ielm
>     M-x electric-pair-mode
>     (
>
> This should leave you with "()" and point between the two parens, but
> instead point is left after the closing paren.
>
> This is because the behavior of the electric-pair thingy is equivalent to
>
>     (insert "(")
>     (save-excursion
>       (insert ")"))
>
> which is indeed affected by this patch.

This will affect all modes derived from comint modes and all the minor
modes that could be enabled in those buffers.  That isn't great.  Maybe
the type of marker used in `save-excursion' should be controlled by a
different and/or new variable, which isn't great either.  I don't like
the idea of introducing more variables/customizations.

Unfortunately I don't have anymore ideas to share ATM.

JS

>         Stefan
>
>
>> John Shahid <jvshahid@gmail.com> writes:
>>
>>> FYI, I have been using this patch without any noticeable issues.  Not
>>> sure if we should merge it.
>>>
>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>>>
>>>>> Sounds good.  I'll make the change locally and test it for a month or
>>>>> two and report back.
>>>>
>>>> FWIW, I'm running with the following change now:
>>>>
>>>>     diff --git a/src/editfns.c b/src/editfns.c
>>>>     index e995b38a44..db95a8a20a 100644
>>>>     --- a/src/editfns.c
>>>>     +++ b/src/editfns.c
>>>>     @@ -782,6 +782,12 @@ save_excursion_save (union specbinding *pdl)
>>>>      {
>>>>        eassert (pdl->unwind_excursion.kind == SPECPDL_UNWIND_EXCURSION);
>>>>        pdl->unwind_excursion.marker = Fpoint_marker ();
>>>>     +  /* Suggested by John Shahid <jvshahid@gmail.com> in the "call-process and
>>>>     +   * incremental display of output" thread of help-gnu-emacs.
>>>>     +   * This matches the manually-created behavior of compile.el's process filter
>>>>     +   * and probably others like comint as well.  */
>>>>     +  XMARKER (pdl->unwind_excursion.marker)->insertion_type
>>>>     +    = !NILP (Vwindow_point_insertion_type);
>>>>        /* Selected window if current buffer is shown in it, nil otherwise.  */
>>>>        pdl->unwind_excursion.window
>>>>          = (EQ (XWINDOW (selected_window)->contents, Fcurrent_buffer ())
>>>>
>>>> I haven't double checked that it does what I think it does, to be
>>>> honest, but at least after a mere 48h of normal use I haven't noticed
>>>> anything weird yet.
>>>>
>>>>
>>>>         Stefan



       reply	other threads:[~2019-02-28 19:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y3ay2fcy.fsf@oldenburg.str.redhat.com>
     [not found] ` <jwvk1mi2c5f.fsf-monnier+gmane.emacs.help@gnu.org>
     [not found]   ` <87ftx5x9bv.fsf@oldenburg.str.redhat.com>
     [not found]     ` <jwvh8hkvd4j.fsf-monnier+Inbox@gnu.org>
     [not found]       ` <87tvlh3991.fsf@gmail.com>
     [not found]         ` <jwvk1mdr3sd.fsf-monnier+gmane.emacs.help@gnu.org>
     [not found]           ` <87sh113360.fsf@gmail.com>
     [not found]             ` <jwvlg6tv0h6.fsf-monnier+emacs@gnu.org>
     [not found]               ` <871s8ji62a.fsf@gmail.com>
     [not found]                 ` <jwv36szqj1d.fsf-monnier+emacs@gnu.org>
     [not found]                   ` <87muosmb8f.fsf@gmail.com>
     [not found]                     ` <87d0nd9yl9.fsf@gmail.com>
     [not found]                       ` <jwvk1hlnxah.fsf-monnier+emacs@gnu.org>
2019-02-28 19:16                         ` John Shahid [this message]
2019-02-28 21:56                           ` call-process and incremental display of output Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8cn7mg0.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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