** 'parse-time-string' can now parse ISO 8601 format strings,
such as "2020-01-15T16:12:21-08:00".
+---
+** 'make-network-process', 'make-serial-process' :coding behavior change.
+Previously, passing ":coding nil" to either of these functions would
+override any non-nil binding for 'coding-system-for-read' and
+'coding-system-for-write'. For consistency with 'make-process' and
+'make-pipe-process', passing ":coding nil" is now ignored. No code in
+Emacs depended on the previous behavior; if you really want the
+process' coding-system to be nil, use 'set-process-coding-system'
+after the process has been created, or pass in ":coding '(nil nil)".
+
\f
* Changes in Emacs 28.1 on Non-Free Operating Systems
BUF_ZV_BYTE (XBUFFER (buffer)));
}
- tem = Fplist_member (contact, QCcoding);
- if (!NILP (tem) && (!CONSP (tem) || !CONSP (XCDR (tem))))
- tem = Qnil;
+ tem = Fplist_get (contact, QCcoding);
val = Qnil;
if (!NILP (tem))
{
- val = XCAR (XCDR (tem));
+ val = tem;
if (CONSP (val))
val = XCAR (val);
}
val = Qnil;
if (!NILP (tem))
{
- val = XCAR (XCDR (tem));
+ val = tem;
if (CONSP (val))
val = XCDR (val);
}
Lisp_Object coding_systems = Qt;
Lisp_Object val;
- tem = Fplist_member (contact, QCcoding);
- if (!NILP (tem) && (!CONSP (tem) || !CONSP (XCDR (tem))))
- tem = Qnil; /* No error message (too late!). */
+ tem = Fplist_get (contact, QCcoding);
/* Setup coding systems for communicating with the network stream. */
/* Qt denotes we have not yet called Ffind_operation_coding_system. */
if (!NILP (tem))
{
- val = XCAR (XCDR (tem));
+ val = tem;
if (CONSP (val))
val = XCAR (val);
}
if (!NILP (tem))
{
- val = XCAR (XCDR (tem));
+ val = tem;
if (CONSP (val))
val = XCDR (val);
}
44777
(vector :nowait t))))
+(ert-deftest check-network-process-coding-system-bind ()
+ "Check that binding coding-system-for-{read,write} works."
+ (let* ((coding-system-for-read 'binary)
+ (coding-system-for-write 'utf-8-unix)
+ (server
+ (make-network-process
+ :name "server"
+ :server t
+ :noquery t
+ :family 'ipv4
+ :service t
+ :host 'local))
+ (coding (process-coding-system server)))
+ (should (eq (car coding) 'binary))
+ (should (eq (cdr coding) 'utf-8-unix))
+ (delete-process server)))
+
+(ert-deftest check-network-process-coding-system-no-override ()
+ "Check that coding-system-for-{read,write} is not overridden by :coding nil."
+ (let* ((coding-system-for-read 'binary)
+ (coding-system-for-write 'utf-8-unix)
+ (server
+ (make-network-process
+ :name "server"
+ :server t
+ :noquery t
+ :family 'ipv4
+ :service t
+ :coding nil
+ :host 'local))
+ (coding (process-coding-system server)))
+ (should (eq (car coding) 'binary))
+ (should (eq (cdr coding) 'utf-8-unix))
+ (delete-process server)))
+
+(ert-deftest check-network-process-coding-system-override ()
+ "Check that :coding non-nil overrides coding-system-for-{read,write}."
+ (let* ((coding-system-for-read 'binary)
+ (coding-system-for-write 'utf-8-unix)
+ (server
+ (make-network-process
+ :name "server"
+ :server t
+ :noquery t
+ :family 'ipv4
+ :service t
+ :coding 'georgian-academy
+ :host 'local))
+ (coding (process-coding-system server)))
+ (should (eq (car coding) 'georgian-academy))
+ (should (eq (cdr coding) 'georgian-academy))
+ (delete-process server)))
;;; network-stream-tests.el ends here