read_and_insert_process_output: Insert before markers
* src/insdel.c (adjust_markers_for_insert): Make non-static. * src/lisp.h: Add declaration for it. * src/process.c (read_and_insert_process_output): Use it here. And also call insert_1_both with BEFORE_MARKERS=t, for compatibility with internal-default-process-filter (bug#66020).
This commit is contained in:
parent
5ecff95993
commit
3199b8584e
3 changed files with 7 additions and 2 deletions
|
@ -284,7 +284,7 @@ adjust_markers_for_delete (ptrdiff_t from, ptrdiff_t from_byte,
|
|||
we advance it if either its insertion-type is t
|
||||
or BEFORE_MARKERS is true. */
|
||||
|
||||
static void
|
||||
void
|
||||
adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte,
|
||||
ptrdiff_t to, ptrdiff_t to_byte, bool before_markers)
|
||||
{
|
||||
|
|
|
@ -4399,6 +4399,8 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t,
|
|||
ptrdiff_t, ptrdiff_t);
|
||||
extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t,
|
||||
ptrdiff_t, ptrdiff_t);
|
||||
extern void adjust_markers_for_insert (ptrdiff_t, ptrdiff_t,
|
||||
ptrdiff_t, ptrdiff_t, bool);
|
||||
extern void adjust_markers_bytepos (ptrdiff_t, ptrdiff_t,
|
||||
ptrdiff_t, ptrdiff_t, int);
|
||||
extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool,
|
||||
|
|
|
@ -6406,7 +6406,7 @@ read_and_insert_process_output (struct Lisp_Process *p, char *buf,
|
|||
if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))
|
||||
&& ! CODING_MAY_REQUIRE_DECODING (process_coding))
|
||||
{
|
||||
insert_1_both (buf, nread, nread, 0, 0, 0);
|
||||
insert_1_both (buf, nread, nread, 0, 0, 1);
|
||||
signal_after_change (PT - nread, 0, nread);
|
||||
}
|
||||
else
|
||||
|
@ -6423,6 +6423,9 @@ read_and_insert_process_output (struct Lisp_Process *p, char *buf,
|
|||
specbind (Qinhibit_modification_hooks, Qt);
|
||||
decode_coding_c_string (process_coding,
|
||||
(unsigned char *) buf, nread, curbuf);
|
||||
adjust_markers_for_insert (PT, PT_BYTE,
|
||||
PT + process_coding->produced_char,
|
||||
PT_BYTE + process_coding->produced, true);
|
||||
unbind_to (count1, Qnil);
|
||||
|
||||
read_process_output_set_last_coding_system (p, process_coding);
|
||||
|
|
Loading…
Add table
Reference in a new issue