changeset 49223:26622fa0d099

Reworked 2003-01-12 change -- call a plist a plist! (QCplist): Renamed from QCvars. All uses changed. (Fprocess_plist): Replaces Fprocess_variable. Simplified. (Fset_process_plist): Replaces Fset_process_variable. Simplified. (syms_of_process): Intern, staticpro, defsubr these. (Fmake_network_process): Describe :plist arg. Removed :vars arg.
author Kim F. Storm <storm@cua.dk>
date Tue, 14 Jan 2003 09:55:27 +0000
parents bfa7cad7b524
children c0c09d77bace
files src/process.c
diffstat 1 files changed, 24 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Tue Jan 14 09:55:00 2003 +0000
+++ b/src/process.c	Tue Jan 14 09:55:27 2003 +0000
@@ -132,7 +132,7 @@
 Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype;
 Lisp_Object QClocal, QCremote, QCcoding;
 Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
-Lisp_Object QCsentinel, QClog, QCoptions, QCvars;
+Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
 Lisp_Object Qlast_nonmenu_event;
 /* QCfamily is declared and initialized in xfaces.c,
    QCfilter in keyboard.c.  */
@@ -1037,36 +1037,26 @@
   return Fplist_get (contact, key);
 }
 
-DEFUN ("process-variable", Fprocess_variable, Sprocess_variable,
-       1, 2, 0,
-       doc: /* Return the value of PROCESS' private variable VAR.
-If VARIABLE is omitted or nil, return plist with all PROCESS variables.  */)
-     (process, var)
-     register Lisp_Object process, var;
+DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
+       1, 1, 0,
+       doc: /* Return the plist of PROCESS.  */)
+     (process)
+     register Lisp_Object process;
 {
   CHECK_PROCESS (process);
-
-  if (NILP (var))
-    return XPROCESS (process)->private_vars;
-
-  return Fplist_get (XPROCESS (process)->private_vars, var);
+  return XPROCESS (process)->plist;
 }
 
-DEFUN ("set-process-variable", Fset_process_variable, Sset_process_variable,
-       3, 3, 0,
-       doc: /* Change value of PROCESS' private variable VAR to VAL, and return VAL.
-If VAR is nil, set all PROCESS' private variables according to plist VAL.  */)
-     (process, var, val)
-     register Lisp_Object process, var, val;
+DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
+       2, 2, 0,
+       doc: /* Replace the plist of PROCESS with PLIST.  */)
+     (process, plist)
+     register Lisp_Object process, plist;
 {
   CHECK_PROCESS (process);
-
-  XPROCESS (process)->private_vars
-    = (NILP (var)
-       ? val
-       : Fplist_put (XPROCESS (process)->private_vars, var, val));
-
-  return val;
+  CHECK_LIST (plist);
+
+  XPROCESS (process)->plist = plist;
 }
 
 #if 0 /* Turned off because we don't currently record this info
@@ -1434,7 +1424,7 @@
   record_unwind_protect (start_process_unwind, proc);
 
   XPROCESS (proc)->childp = Qt;
-  XPROCESS (proc)->private_vars = Qnil;
+  XPROCESS (proc)->plist = Qnil;
   XPROCESS (proc)->command_channel_p = Qnil;
   XPROCESS (proc)->buffer = buffer;
   XPROCESS (proc)->sentinel = Qnil;
@@ -2599,8 +2589,7 @@
 is the server process, CLIENT is the new process for the connection,
 and MESSAGE is a string.
 
-:vars VARS -- Initialize the process' private variables according to
-a list of variable/value pairs (VAR1 VAL1 VAR2 VAL2...).
+:plist PLIST -- Install PLIST as the new process' initial plist.
  
 :server BOOL -- if BOOL is non-nil, create a server process for the
 specified FAMILY, SERVICE, and connection type (stream or datagram).
@@ -2619,8 +2608,7 @@
 inherited from the server process' TYPE, FILTER and SENTINEL.
 - The client process' contact info is set according to the client's
 addressing information (typically an IP address and a port number).
-- The client process' private variables are initialized from the
-server's private variables.
+- The client process' plist is initialized from the server's plist.
 
 Notice that the FILTER and SENTINEL args are never used directly by
 the server process.  Also, the BUFFER argument is not used directly by
@@ -3183,7 +3171,7 @@
   p = XPROCESS (proc);
 
   p->childp = contact;
-  p->private_vars = Fcopy_sequence (Fplist_get (contact, QCvars));
+  p->plist = Fcopy_sequence (Fplist_get (contact, QCplist));
   
   p->buffer = buffer;
   p->sentinel = sentinel;
@@ -3616,7 +3604,7 @@
 #endif
 
   p->childp = contact;
-  p->private_vars = Fcopy_sequence (ps->private_vars);
+  p->plist = Fcopy_sequence (ps->plist);
 
   p->buffer = buffer;
   p->sentinel = ps->sentinel;
@@ -6343,8 +6331,8 @@
   staticpro (&QCstop);
   QCoptions = intern (":options");
   staticpro (&QCoptions);
-  QCvars = intern (":vars");
-  staticpro (&QCvars);
+  QCplist = intern (":plist");
+  staticpro (&QCplist);
     
   Qlast_nonmenu_event = intern ("last-nonmenu-event");
   staticpro (&Qlast_nonmenu_event);
@@ -6388,8 +6376,8 @@
   defsubr (&Sset_process_query_on_exit_flag);
   defsubr (&Sprocess_query_on_exit_flag);
   defsubr (&Sprocess_contact);
-  defsubr (&Sprocess_variable);
-  defsubr (&Sset_process_variable);
+  defsubr (&Sprocess_plist);
+  defsubr (&Sset_process_plist);
   defsubr (&Slist_processes);
   defsubr (&Sprocess_list);
   defsubr (&Sstart_process);