changeset 4729:428d7c571110

Fix issue145: accept nil in default-process-coding-system.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 02 Nov 2009 12:09:13 +0900
parents 90dbf8e772b6
children 0e5b32398bac
files src/ChangeLog src/process.c
diffstat 2 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Nov 01 20:21:11 2009 +0900
+++ b/src/ChangeLog	Mon Nov 02 12:09:13 2009 +0900
@@ -1,3 +1,15 @@
+2009-11-02  Stephen Turnbull  <stephen@xemacs.org>
+
+	Fix issue145.
+
+	* process.c: Remove abbreviated comments on exported Lisp
+	variables, and point to docstrings.
+	(init_process_io_handles): Allow Vdefault_network_coding_system
+	and Vdefault_process_coding_system to be nil.
+	(Vdefault_network_coding_system):
+	(Vdefault_process_coding_system):
+	Document that these variables may be nil.
+
 2009-10-26  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* config.h.in (REALPATH_CORRECTS_CASE): 
--- a/src/process.c	Sun Nov 01 20:21:11 2009 +0900
+++ b/src/process.c	Mon Nov 02 12:09:13 2009 +0900
@@ -112,32 +112,23 @@
    process objects. Processes are not GC-protected through this! */
 struct hash_table *usid_to_process;
 
-/* List of process objects. */
+/* Read-only to Lisp.  See DEFUN Fprocess_list. */
 Lisp_Object Vprocess_list;
 
+/* Lisp variables; see docstrings below. */
 Lisp_Object Vnull_device;
-
-/* Cons of coding systems used to initialize process I/O on a newly-
-   created process. */
 Lisp_Object Vdefault_process_coding_system;
-/* Same for a network connection. */
 Lisp_Object Vdefault_network_coding_system;
-
 Lisp_Object Qprocess_error;
 Lisp_Object Qnetwork_error;
-
 Fixnum debug_process_io;
-
 Lisp_Object Vshell_file_name;
-
-/* The environment to pass to all subprocesses when they are started.
-   This is in the semi-bogus format of ("VAR=VAL" "VAR2=VAL2" ... )
- */
 Lisp_Object Vprocess_environment;
 
 /* Make sure egetenv() not called too soon */
 int env_initted;
 
+/* Internal Lisp variable. */
 Lisp_Object Vlisp_EXEC_SUFFIXES;
 
 
@@ -523,7 +514,7 @@
 
   if (flags & STREAM_NETWORK_CONNECTION)
     {
-      if (!CONSP (Vdefault_network_coding_system) ||
+      if (!LISTP (Vdefault_network_coding_system) ||
 	  NILP (incode = (find_coding_system_for_text_file
 			  (Fcar (Vdefault_network_coding_system), 1))) ||
 	  NILP (outcode = (find_coding_system_for_text_file
@@ -534,7 +525,7 @@
     }
   else
     {
-      if (!CONSP (Vdefault_process_coding_system) ||
+      if (!LISTP (Vdefault_process_coding_system) ||
 	  NILP (incode = (find_coding_system_for_text_file
 			  (Fcar (Vdefault_process_coding_system), 1))) ||
 	  NILP (outcode = (find_coding_system_for_text_file
@@ -2656,15 +2647,17 @@
   DEFVAR_LISP ("default-process-coding-system",
 	       &Vdefault_process_coding_system /*
 Cons of coding systems used for process I/O by default.
+May also be nil, interpreted as (nil . nil).
 The car part is used for reading (decoding) data from a process, and
 the cdr part is used for writing (encoding) data to a process.
 */ );
-  /* This below will get its default set correctly in code-init.el. */
+  /* Better, system-dependent defaults are set in code-init.el. */
     Vdefault_process_coding_system = Fcons (Qundecided, Qnil);
 
   DEFVAR_LISP ("default-network-coding-system",
 	       &Vdefault_network_coding_system /*
 Cons of coding systems used for network I/O by default.
+May also be nil, interpreted as (nil . nil).
 The car part is used for reading (decoding) data from a process, and
 the cdr part is used for writing (encoding) data to a process.
 */ );
@@ -2685,6 +2678,9 @@
 Initialized from the SHELL environment variable.
 */ );
 
+  /* ben? thinks the format of this variable is "semi-bogus".
+     sjt doesn't agree, since it captures a restriction that is
+     present in POSIX shells, after all. */
   DEFVAR_LISP ("process-environment", &Vprocess_environment /*
 List of environment variables for subprocesses to inherit.
 Each element should be a string of the form ENVVARNAME=VALUE.