]> git.eshelyaron.com Git - emacs.git/commitdiff
Make after-change-functions called from call-process get the correct BEG
authorAlan Mackenzie <acm@muc.de>
Thu, 13 Feb 2020 19:00:36 +0000 (19:00 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 13 Feb 2020 19:00:36 +0000 (19:00 +0000)
This fixes bug #39585.

* src/callproc.c (call_process): Supply the correct CHARPOS to
signal_after_change (twice).

src/callproc.c

index 07dcc4c3ae41c37dd516e6f9b58c433b769b9f50..8883415f3f5cf8698ae2adbafadb0ad5451abf6e 100644 (file)
@@ -811,7 +811,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
                   && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
             {
               insert_1_both (buf, nread, nread, 0, 0, 0);
-              signal_after_change (PT, 0, nread);
+              signal_after_change (PT - nread, 0, nread);
             }
          else
            {                   /* We have to decode the input.  */
@@ -854,7 +854,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
 
              TEMP_SET_PT_BOTH (PT + process_coding.produced_char,
                                PT_BYTE + process_coding.produced);
-              signal_after_change (PT, 0, process_coding.produced_char);
+              signal_after_change (PT - process_coding.produced_char,
+                                   0, process_coding.produced_char);
              carryover = process_coding.carryover_bytes;
              if (carryover > 0)
                memcpy (buf, process_coding.carryover,