help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: start-process and set-process-filter sequence


From: Thierry Volpiatto
Subject: Re: start-process and set-process-filter sequence
Date: Thu, 14 Apr 2011 07:11:55 +0200
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.3.50 (gnu/linux)

William Xu <address@hidden> writes:

> Hi, 
>
> Because set-process-filter will be done after the process is created by
> start-process, it seems there is a possibility that the filter may miss
> some process output.  Consider this: 
>
>     (defun foo (proc output)
>       (setq a output))
>     
>     (let ((proc (start-process "ls" "ls" "ls")))
>       ;; (read-string "Mood: ")
>       (setq a nil)
>       (set-process-filter proc 'foo))
>
> Compare comment and uncomment the read-string line, `a' would be
> different.  
>
> Is there a way to set a process filter before the process starts? so
> that we won't miss any output.  
prog1

something like this:

--8<---------------cut here---------------start------------->8---
(prog1
    (start-process "ls" "ls" "ls")
  (set-process-filter (get-process "ls") 'foo)
  (setq a nil)
  ;(read-string "Mood: ")
  )
--8<---------------cut here---------------end--------------->8---

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]