Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!topaz.rutgers.edu!gaynor From: gaynor@topaz.rutgers.edu.UUCP Newsgroups: comp.emacs Subject: Re: help - make GNU display-time NOT use a pty Message-ID: <14531@topaz.rutgers.edu> Date: Mon, 7-Sep-87 22:42:07 EDT Article-I.D.: topaz.14531 Posted: Mon Sep 7 22:42:07 1987 Date-Received: Tue, 8-Sep-87 06:20:22 EDT References: <16402@teknowledge-vaxc.ARPA> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 65 Mike Khaw (mkhaw@teknowledge-vaxc.arpa) writes: > [I want the variable process-connection-type to always be nil when > the function display-time is evaluated. How should I do this?] If you're able to modify time.el, surround the body with a let statement which temporarily redefines process-connection-type to the proper value. So the following defun ;; <- Look! Semi-colons in their natural habitat! (defun display-time () "Hi Mom!" ) becomes ;; <- Look! Semi-colons in their natural habitat! ;; ;; Also, not that `display-time' has been modified so that when ;; evaluated, the variable `process-connection-type' is always nil ;; (hence, the process is always connected with a pipe rather than a ;; pty). This has been done by surrounding it's body with a `let' ;; expression, in which the varlist temporarily redefines the variable ;; `process-connection-type' to nil. The body of this `let' statement ;; is the old body of the function. (defun display-time (args-n-what-not) "Hi Mom!" (let ((process-connection-type nil)) ;; NEW LINE ) ;; NEW LINE ) If you are not able or don't want to modify time.el, jam this in the appropriate place(s). It essentially does the same thing as above, except dynamically. Evaluate this form, only after display-time is defined properly. Once. ;; Modify the function `display-time' so that when evaluated, the ;; variable `process-connection-type' is always nil (hence, the ;; process is always connected with a pipe rather than a pty). The ;; way we're going to pull this off is to redefine `display-time' by ;; replacing it's body with a `let' expression, in which the varlist ;; temporarily redefines the variable process-connection-type to nil. ;; The body of this `let' statement is the old body of the function. (let ((fn (symbol-function 'display-time))) (rplacd (cdr fn) (list (append '(let ((process-connection-type nil))) (cdr (cdr fn)))))) Hope this helps. VOICE: Andy Gaynor (Silver) PHONE: 201-545-0458 INTERNET: gaynor@topaz.rutgers.edu ICBM: 40 34 N / 74 45 W UUCP: ...!!rutgers!topaz.rutgers.edu!gaynor ROOF: 81 Hassart Street, New Brunswick, NJ 08901 _____ _____ \ / "While Bill wrestles the alligator, \---/ \d/ I'll poor myself another martini..." \d/ V - Marlin Perkins V | | __|__ __|__