From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.help Subject: start-process and set-process-filter sequence Date: Thu, 14 Apr 2011 11:10:20 +0800 Organization: the Church of Emacs Message-ID: <21glbp094jfn.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1302750699 18721 80.91.229.12 (14 Apr 2011 03:11:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2011 03:11:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 14 05:11:35 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QACxy-00010Q-C2 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Apr 2011 05:11:34 +0200 Original-Received: from localhost ([::1]:53286 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QACxx-00034I-Jt for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Apr 2011 23:11:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QACxs-000341-Um for help-gnu-emacs@gnu.org; Wed, 13 Apr 2011 23:11:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QACxr-0008D0-LX for help-gnu-emacs@gnu.org; Wed, 13 Apr 2011 23:11:28 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:59653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QACxr-0008CI-Fi for help-gnu-emacs@gnu.org; Wed, 13 Apr 2011 23:11:27 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QACxp-0000xM-Gl for help-gnu-emacs@gnu.org; Thu, 14 Apr 2011 05:11:25 +0200 Original-Received: from esprx01x.nokia.com ([192.100.124.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2011 05:11:25 +0200 Original-Received: from william.xwl by esprx01x.nokia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2011 05:11:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: esprx01x.nokia.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) Cancel-Lock: sha1:he1Ta/QFKp76CVnelS4ia1RzO/k= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80786 Archived-At: 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. -- William http://xwl.appspot.com