diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/process.c b/src/process.c index 53f4a1d8530..50c425077a9 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1205,6 +1205,16 @@ not the name of the pty that Emacs uses to talk with that terminal. */) | |||
| 1205 | return XPROCESS (process)->tty_name; | 1205 | return XPROCESS (process)->tty_name; |
| 1206 | } | 1206 | } |
| 1207 | 1207 | ||
| 1208 | static void | ||
| 1209 | update_process_mark (struct Lisp_Process *p) | ||
| 1210 | { | ||
| 1211 | Lisp_Object buffer = p->buffer; | ||
| 1212 | if (BUFFERP (buffer)) | ||
| 1213 | set_marker_both (p->mark, buffer, | ||
| 1214 | BUF_ZV (XBUFFER (buffer)), | ||
| 1215 | BUF_ZV_BYTE (XBUFFER (buffer))); | ||
| 1216 | } | ||
| 1217 | |||
| 1208 | DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, | 1218 | DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, |
| 1209 | 2, 2, 0, | 1219 | 2, 2, 0, |
| 1210 | doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). | 1220 | doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). |
| @@ -1217,7 +1227,11 @@ Return BUFFER. */) | |||
| 1217 | if (!NILP (buffer)) | 1227 | if (!NILP (buffer)) |
| 1218 | CHECK_BUFFER (buffer); | 1228 | CHECK_BUFFER (buffer); |
| 1219 | p = XPROCESS (process); | 1229 | p = XPROCESS (process); |
| 1220 | pset_buffer (p, buffer); | 1230 | if (!EQ (p->buffer, buffer)) |
| 1231 | { | ||
| 1232 | pset_buffer (p, buffer); | ||
| 1233 | update_process_mark (p); | ||
| 1234 | } | ||
| 1221 | if (NETCONN1_P (p) || SERIALCONN1_P (p) || PIPECONN1_P (p)) | 1235 | if (NETCONN1_P (p) || SERIALCONN1_P (p) || PIPECONN1_P (p)) |
| 1222 | pset_childp (p, Fplist_put (p->childp, QCbuffer, buffer)); | 1236 | pset_childp (p, Fplist_put (p->childp, QCbuffer, buffer)); |
| 1223 | setup_process_coding_systems (process); | 1237 | setup_process_coding_systems (process); |
| @@ -1637,6 +1651,7 @@ DEFUN ("process-list", Fprocess_list, Sprocess_list, 0, 0, 0, | |||
| 1637 | return Fmapcar (Qcdr, Vprocess_alist); | 1651 | return Fmapcar (Qcdr, Vprocess_alist); |
| 1638 | } | 1652 | } |
| 1639 | 1653 | ||
| 1654 | |||
| 1640 | /* Starting asynchronous inferior processes. */ | 1655 | /* Starting asynchronous inferior processes. */ |
| 1641 | 1656 | ||
| 1642 | DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, | 1657 | DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, |
| @@ -1805,10 +1820,7 @@ usage: (make-process &rest ARGS) */) | |||
| 1805 | : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); | 1820 | : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); |
| 1806 | 1821 | ||
| 1807 | /* Make the process marker point into the process buffer (if any). */ | 1822 | /* Make the process marker point into the process buffer (if any). */ |
| 1808 | if (BUFFERP (buffer)) | 1823 | update_process_mark (XPROCESS (proc)); |
| 1809 | set_marker_both (XPROCESS (proc)->mark, buffer, | ||
| 1810 | BUF_ZV (XBUFFER (buffer)), | ||
| 1811 | BUF_ZV_BYTE (XBUFFER (buffer))); | ||
| 1812 | 1824 | ||
| 1813 | USE_SAFE_ALLOCA; | 1825 | USE_SAFE_ALLOCA; |
| 1814 | 1826 | ||
| @@ -2453,10 +2465,7 @@ usage: (make-pipe-process &rest ARGS) */) | |||
| 2453 | : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); | 2465 | : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); |
| 2454 | 2466 | ||
| 2455 | /* Make the process marker point into the process buffer (if any). */ | 2467 | /* Make the process marker point into the process buffer (if any). */ |
| 2456 | if (BUFFERP (buffer)) | 2468 | update_process_mark (p); |
| 2457 | set_marker_both (p->mark, buffer, | ||
| 2458 | BUF_ZV (XBUFFER (buffer)), | ||
| 2459 | BUF_ZV_BYTE (XBUFFER (buffer))); | ||
| 2460 | 2469 | ||
| 2461 | { | 2470 | { |
| 2462 | /* Setup coding systems for communicating with the network stream. */ | 2471 | /* Setup coding systems for communicating with the network stream. */ |
| @@ -3182,12 +3191,7 @@ usage: (make-serial-process &rest ARGS) */) | |||
| 3182 | if (!EQ (p->command, Qt)) | 3191 | if (!EQ (p->command, Qt)) |
| 3183 | add_process_read_fd (fd); | 3192 | add_process_read_fd (fd); |
| 3184 | 3193 | ||
| 3185 | if (BUFFERP (buffer)) | 3194 | update_process_mark (p); |
| 3186 | { | ||
| 3187 | set_marker_both (p->mark, buffer, | ||
| 3188 | BUF_ZV (XBUFFER (buffer)), | ||
| 3189 | BUF_ZV_BYTE (XBUFFER (buffer))); | ||
| 3190 | } | ||
| 3191 | 3195 | ||
| 3192 | tem = Fplist_get (contact, QCcoding); | 3196 | tem = Fplist_get (contact, QCcoding); |
| 3193 | 3197 | ||
| @@ -3664,10 +3668,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3664 | pset_status (p, Qlisten); | 3668 | pset_status (p, Qlisten); |
| 3665 | 3669 | ||
| 3666 | /* Make the process marker point into the process buffer (if any). */ | 3670 | /* Make the process marker point into the process buffer (if any). */ |
| 3667 | if (BUFFERP (p->buffer)) | 3671 | update_process_mark (p); |
| 3668 | set_marker_both (p->mark, p->buffer, | ||
| 3669 | BUF_ZV (XBUFFER (p->buffer)), | ||
| 3670 | BUF_ZV_BYTE (XBUFFER (p->buffer))); | ||
| 3671 | 3672 | ||
| 3672 | if (p->is_non_blocking_client) | 3673 | if (p->is_non_blocking_client) |
| 3673 | { | 3674 | { |