Changeset 3841

Show
Ignore:
Timestamp:
2005年09月03日 04時16分05秒 (3 years ago)
Author:
horiguti
Message:

Refine process wrapper functions.
* nt/dot.emacs.jp: Alter sample setting of fakecygpty.

* src/process.c (Fmw32_set_pty_flag): New Lisp function.
(create_process): Correct data type of
Vmw32_process_expects_pty. Set process under setup to
Vmw32_process_under_setup.

* src/callproc.c (Vmw32_process_under_setup): New Lisp variable.
(Fcall_process): Set nil to Vmw32_process_under_setup.

* lisp/international/mw32misc.el (mw32-process-wrapper-alist): Alter
comment after the change of format.
(set-process-connection-type-pty): New function.
(find-process-wrapper-function): Handle new data structure.
(general-process-argument-editing-function): Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ChangeLog.Meadow

    r3839 r3841  
     12005-09-03  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * international/mw32misc.el (mw32-process-wrapper-alist): Alter 
     4        comment after the change of format. 
     5        (set-process-connection-type-pty): New function. 
     6        (find-process-wrapper-function): Handle new data structure. 
     7        (general-process-argument-editing-function): Ditto. 
     8 
    192005-09-02  Masayuki FUJII  <boochang@m4.kcn.ne.jp> 
    210 
     
    614 
    715        * international/mw32script.el (mw32script-resolve-script): Make 
    8         work buffer singlebyte to ensure return strings are singlebyte. 
     16        work buffer unibyte to ensure return strings are unibyte. 
    917 
    10182005-08-28  MIYOSHI Masanori  <miyoshi@meadowy.org> 
  • trunk/lisp/international/mw32misc.el

    r3805 r3841  
    884884 
    885885(defvar mw32-process-wrapper-alist nil 
    886       "Define association between prograpm to invoke and process wrapper. 
    887 The formt is ((PATTERN-OR-FUN . VAL) ...). 
     886      "Define association between program to invoke and process wrapper. 
     887The format is ((PATTERN-OR-FUN . VAL) ...). 
    888888PATTERN-OR-FUN is a regular expression matching a program name, 
    889889or a function checking a program name. 
     
    891891program name of the process and check if the process should be 
    892892invoked by a wrapper program. 
    893 VAL is a program name, or a cons of program names. 
    894 If VAL is a program name, it is always invoked as a wrapper program. 
    895 If VAL is a cons of program names, the car part is used when 
    896 process is connected on pipe, and the cdr part is used when pty. 
    897 Nil means no wrapper program. 
     893 
     894VAL is a wrapper description WRAPPER, or a cons of WRAPPER's. 
     895If VAL is a WRAPPER, it is always used as a wrapper description. 
     896If VAL is a cons of WRAPPER's, the car part is used when process 
     897is connected on pipe, and the cdr part is used when pty. 
     898 
     899If WRAPPER is a program name PROG, it is invoked as a wrapper 
     900program. 
     901If WRAPPER is a cons of PROG and lisp function LISPFUN, LISPFUN 
     902is called in the sequence of setting up the process. LISPFUN may 
     903refer to the two variables `mw32-process-expects-pty' and 
     904`mw32-process-under-setup'. 
     905  
     906Each WRAPPER may be nil. 
    898907 
    899908See also the function `find-process-wrapper-function'.") 
     
    918927          (setq elem nil))) 
    919928      (setq ret 
    920             (if (consp elem) 
     929            (if (and (consp elem) 
     930                     (or (consp (car elem)) 
     931                         (consp (cdr elem)) 
     932                         (not (functionp (cdr elem))))) 
     933                    ;;; pair of WRAPPER's 
    921934                (if mw32-process-expects-pty (cdr elem) (car elem)) 
     935                  ;;; a WRAPPER 
    922936              elem)) 
    923       (if (stringp ret) 
    924           (executable-find ret) 
    925         nil)))) 
     937      (cond 
     938       ((stringp ret) 
     939        (executable-find ret)) 
     940       ((and (consp ret) 
     941             (stringp (car ret)) 
     942             (functionp (cdr ret))) 
     943        (cons (executable-find (car ret)) (cdr ret))) 
     944       (t nil))))) 
     945 
     946(defun set-process-connection-type-pty () 
     947  "Set pty_flag of under-setup process to t." 
     948  (mw32-set-pty-flag 'pty mw32-process-under-setup)) 
    926949 
    927950(defun general-process-argument-editing-function 
     
    929952  (let* ((wrapper (find-process-wrapper-function (car argument))) 
    930953         (argtmp argument)) 
    931     (if wrapper 
    932         (setq argument (cons wrapper argument))) 
     954    (cond 
     955     ((stringp wrapper) 
     956      (setq argument (cons wrapper argument))) 
     957     ((consp wrapper) 
     958      (setq argument (cons (car wrapper) argument)) 
     959      (funcall (cdr wrapper)) 
     960      (setq wrapper (car wrapper)))) 
     961     
    933962    (setq argument (cond ((eq quoting 'msvc) 
    934963                          (msvc-process-argument-quoting argument)) 
  • trunk/nt/ChangeLog.Meadow

    r3839 r3841  
     12005-09-03  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * dot.emacs.jp: Alter sample setting of fakecygpty. 
     4 
    152005-09-02  Masayuki FUJII  <boochang@m4.kcn.ne.jp> 
    26 
  • trunk/nt/dot.emacs.ja

    r3766 r3841  
    223223;; (setq mw32-process-wrapper-alist 
    224224;;       '(("/\\(bash\\|tcsh\\|svn\\|ssh\\|gpg[esvk]?\\)\\.exe" . 
    225 ;;       (nil . "fakecygpty.exe")))) 
     225;;       (nil . ("fakecygpty.exe" . set-process-connection-type-pty))))) 
    226226 
    227227;;; 
  • trunk/src/ChangeLog.Meadow

    r3839 r3841  
     12005-09-03  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * process.c (Fmw32_set_pty_flag): New Lisp function. 
     4        (create_process): Correct data type of 
     5        Vmw32_process_expects_pty. Set process under setup to 
     6        Vmw32_process_under_setup. 
     7 
     8        * callproc.c (Vmw32_process_under_setup): New Lisp variable. 
     9        (Fcall_process): Set nil to Vmw32_process_under_setup. 
     10 
    1112005-09-02  Masayuki FUJII  <boochang@m4.kcn.ne.jp> 
    212 
  • trunk/src/callproc.c

    r3809 r3841  
    116116#ifdef MEADOW 
    117117int Vmw32_process_expects_pty; 
     118Lisp_Object Vmw32_process_under_setup; 
    118119#endif 
    119120 
     
    641642#ifdef MEADOW 
    642643    Vmw32_process_expects_pty = 0; 
     644    Vmw32_process_under_setup = Qnil; 
    643645#endif 
    644646    pid = child_setup (filefd, fd1, fd_error, (char **) new_argv, 
     
    17311733#ifdef MEADOW 
    17321734  DEFVAR_BOOL ("mw32-process-expects-pty", &Vmw32_process_expects_pty, 
    1733                doc: /* Indicate wheather invoking process expects pty. 
     1735               doc: /* Indicate wheather the process currently under startup sequence expects pty. 
    17341736This variable has meaning only within process argument edithing functions. 
    1735 See also `find-process-wrapper-function' and `general-process-argument-editing-function'. */); 
     1737See also `find-process-wrapper-function' and 
     1738`general-process-argument-editing-function'. */); 
    17361739  Vmw32_process_expects_pty = 1; 
     1740 
     1741  DEFVAR_LISP ("mw32-process-under-setup", &Vmw32_process_under_setup, 
     1742               doc: /* The process currently under startup sequence. 
     1743This variable has meaning only within process argument edithing functions. 
     1744See also `mw32-process-expects-pty'. */); 
     1745  Vmw32_process_under_setup = Qnil; 
    17371746#endif 
    17381747 
  • trunk/src/process.c

    r3809 r3841  
    17071707} 
    17081708 
     1709#ifdef MEADOW 
     1710DEFUN ("mw32-set-pty-flag", Fmw32_set_pty_flag, Smw32_set_pty_flag, 
     1711       1, 2, 0, 
     1712       doc: /* Set pty_flag of PROCESS for pty faking. 
     1713Set pty_flag if ISPTY is no-nil, and clear if nil. 
     1714PROCESS may be a process, a buffer, the name of a process or buffer, or 
     1715nil, indicating the current buffer's process. */) 
     1716  (ispty, process) 
     1717     Lisp_Object ispty, process; 
     1718{ 
     1719  Lisp_Object proc; 
     1720 
     1721  if (DATAGRAM_CONN_P (process)) 
     1722    return process; 
     1723 
     1724  proc = get_process (process); 
     1725 
     1726  if (NILP (ispty)) 
     1727    XPROCESS (proc)->pty_flag = 0; 
     1728  else 
     1729    XPROCESS (proc)->pty_flag = 1; 
     1730   
     1731  return process; 
     1732} 
     1733#endif 
    17091734/* This function is the unwind_protect form for Fstart_process.  If 
    17101735   PROC doesn't have its pid set, then we know someone has signaled 
     
    20922117#ifdef MEADOW 
    20932118 { 
    2094    extern Lisp_Object Vmw32_process_expects_pty; 
     2119   extern int Vmw32_process_expects_pty; 
     2120   extern Lisp_Object Vmw32_process_under_setup; 
     2121   Vmw32_process_under_setup = process; 
     2122 
    20952123   if (Vprocess_connection_type != Qnil) 
    20962124     Vmw32_process_expects_pty = 1; 
     
    68916919  defsubr (&Sprocess_list); 
    68926920  defsubr (&Sstart_process); 
     6921#ifdef MEADOW 
     6922  defsubr (&Smw32_set_pty_flag); 
     6923#endif 
    68936924#ifdef HAVE_SOCKETS 
    68946925  defsubr (&Sset_network_process_option);