From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: How to get asynchronous notifications from Emacs ? Date: Mon, 26 Feb 2007 17:42:47 +0100 Message-ID: <45E30E07.6050007@gmail.com> References: <45e1802d$0$28489$426a74cc@news.free.fr> <45e29dcd$0$32749$426a74cc@news.free.fr> <45E2AD3A.1080706@gatech.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1172508204 28367 80.91.229.12 (26 Feb 2007 16:43:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2007 16:43:24 +0000 (UTC) Cc: emacs To: Matthew Flaschen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 26 17:43:17 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HLiwO-0001pV-AN for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Feb 2007 17:43:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HLiwN-0003Wp-Re for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Feb 2007 11:43:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HLiwA-0003WP-UN for help-gnu-emacs@gnu.org; Mon, 26 Feb 2007 11:42:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HLiw8-0003Vw-Ee for help-gnu-emacs@gnu.org; Mon, 26 Feb 2007 11:42:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HLiw8-0003Vt-8k for help-gnu-emacs@gnu.org; Mon, 26 Feb 2007 11:42:52 -0500 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HLiw7-0007Mw-L5 for help-gnu-emacs@gnu.org; Mon, 26 Feb 2007 11:42:52 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:62213 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HLiw4-0005JW-9M; Mon, 26 Feb 2007 17:42:50 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 In-Reply-To: <45E2AD3A.1080706@gatech.edu> X-Antivirus: avast! (VPS 000717-1, 2007-02-26), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HLiw4-0005JW-9M. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1HLiw4-0005JW-9M 954d61faec77b67baa0284cd9202215c X-detected-kernel: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41483 Archived-At: Matthew Flaschen wrote: > David Soulayrol wrote: >> Le Sun, 25 Feb 2007 09:16:33 -0500, Matthew Flaschen a écrit: >> >>> David Soulayrol wrote: >>>> Hello, >>>> >>>> I'm looking for a way to obtain asynchronous notifications >>>> of emacs actions, like: buffer was closed, displayed buffer has changed, >>>> and so on. >>> Emacs has hooks for many actions. For example, kill-buffer-hook is run >>> when a buffer is closed. Run C-h f on kill-buffer-hook and add-hook, >>> and C-h v on after-change-functions. See also >>> http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_540.html and >>> http://www.gnu.org/software/emacs/manual/html_node/Hooks.html . >> I knew the principles in Emacs, but thanks a lot for this introduction. >> >> So I assume you are not aware of a tool which could be the companion of >> gnuserv for my needs ? I'll try to write this down. > > I'm afraid I don't know what gnuserv is. I use regular emacsclient, and > am fairly new to emacs in general. What exactly do you want to do? > I.E. what's your end goal? > >> But it doesn't have a kitchen sink. > > Patience. Well, if you want to communicate with the kitchen sink you can not do that (at least not in both directions) with emacsclient (or gnuclient, which is similar in spirit). Emacsclient will only send commands to Emacs, it does not take command from Emacs. What you should do is write a program that can talk and listen on standard output resp input. That program can then be run as an inferior process (Emacs parlang, a subprocess) in a buffer. Take a look for example at "shell" command in Emacs for example code. This way you do not have to buy an Emacs aware kitchen sink.