From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: stardiviner Newsgroups: gmane.emacs.help Subject: [QUESTION] How to use :filter in `make-process'? Date: Tue, 03 Mar 2020 15:49:52 +0800 Message-ID: <87r1y97u8v.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="126990"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.3.8; emacs 27.0.50 To: Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 03 08:58:10 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j92RO-000Wvx-7r for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 03 Mar 2020 08:58:10 +0100 Original-Received: from localhost ([::1]:43370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j92RN-0000fe-8I for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 03 Mar 2020 02:58:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34817) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j92R4-0000fW-6D for help-gnu-emacs@gnu.org; Tue, 03 Mar 2020 02:57:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j92R3-0006y8-3S for help-gnu-emacs@gnu.org; Tue, 03 Mar 2020 02:57:50 -0500 Original-Received: from [183.249.128.110] (port=12553 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j92Qx-0006wG-KF for help-gnu-emacs@gnu.org; Tue, 03 Mar 2020 02:57:48 -0500 Original-Received: by dark.localdomain (Postfix, from userid 1000) id 461AA2418BA; Tue, 3 Mar 2020 15:49:53 +0800 (CST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 183.249.128.110 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122514 Archived-At: =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I have an code example try to use :filter handler of make-process. ``` (let ((op-fn (lambda () (message "call the fn")))) (make-process :name "sleep command test" :command (list "sleep" "3") :filter `(lambda (proc event) (message "event catched!") (funcall ,op-fn)) :buffer "*sleep test*")) ``` I don't know how to use it correctly. Can you give some good examples of us= ing this `:filter' handler, and explain it a little?=20 Thanks in advanced. =2D --=20 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5eDCEUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsOYiQgAvbGnIiyR+SMjgf9Cr6ZQ5jSRcbwo cPDl8tsWSAZkv8sYCbdlPWsLSAGg8pipTP/jSsB2wSF2xALAkxntNGSLwfryQcO4 nmKsDuPE6W2VewB6D7WrAmMjNUrQi0b27Frev017wYIWnWE1nK6cSpzh69/V/rOE ACl+ReskQcv5lAhtHgBQXVmmqGvbrq0fbeZyqjIpw0MPACuRFjG03S+zPXIiE/Rn tKtIvnniMutz8qxx37soV5VpcBazG5rrSc3pFGTTMb/dreiqz7Bmxh/xlVJXgCec 2GYz1H1TxHuHD5MZLvzgOIkuiFVH71x4KcilEA/j+4ZsVacaVgCPBGPgNA=3D=3D =3DR9s9 =2D----END PGP SIGNATURE-----