all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to get asynchronous notifications from Emacs ?
@ 2007-02-25 12:25 David Soulayrol
  2007-02-25 14:16 ` Matthew Flaschen
       [not found] ` <mailman.81.1172413015.7795.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: David Soulayrol @ 2007-02-25 12:25 UTC (permalink / raw)
  To: help-gnu-emacs

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.

I have discovered emacsclient and gnuserv which both allow me to send
synchronous orders to emacs, but I don't think they can solve my problem.

Do you know if such a tool exists ? If not, can you give me pointers or
preliminary help on how to write this in emacs lisp ? I think I'd have to
open a network connection, and then capture actions to send a message...

Thanks a lot.

David.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
  2007-02-25 12:25 How to get asynchronous notifications from Emacs ? David Soulayrol
@ 2007-02-25 14:16 ` Matthew Flaschen
       [not found] ` <mailman.81.1172413015.7795.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Flaschen @ 2007-02-25 14:16 UTC (permalink / raw)
  To: emacs


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]

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 .

Remember, emacs can do anything if you ask nicely enough.  Theoretical
limitations do not exist as with other programs. ;)

Matthew Flaschen


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
       [not found] ` <mailman.81.1172413015.7795.help-gnu-emacs@gnu.org>
@ 2007-02-26  8:43   ` David Soulayrol
  2007-02-26  9:49     ` Matthew Flaschen
  0 siblings, 1 reply; 8+ messages in thread
From: David Soulayrol @ 2007-02-26  8:43 UTC (permalink / raw)
  To: help-gnu-emacs

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.

> Remember, emacs can do anything if you ask nicely enough.  Theoretical
> limitations do not exist as with other programs. ;)

But it doesn't have a kitchen sink.


> Matthew Flaschen

Thanks.

David.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
  2007-02-26  8:43   ` David Soulayrol
@ 2007-02-26  9:49     ` Matthew Flaschen
  2007-02-26 16:42       ` Lennart Borgman (gmail)
       [not found]       ` <mailman.120.1172508176.7795.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew Flaschen @ 2007-02-26  9:49 UTC (permalink / raw)
  To: emacs


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]

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.

Matthew Flaschen


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
  2007-02-26  9:49     ` Matthew Flaschen
@ 2007-02-26 16:42       ` Lennart Borgman (gmail)
       [not found]       ` <mailman.120.1172508176.7795.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Lennart Borgman (gmail) @ 2007-02-26 16:42 UTC (permalink / raw)
  To: Matthew Flaschen; +Cc: emacs

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
       [not found]       ` <mailman.120.1172508176.7795.help-gnu-emacs@gnu.org>
@ 2007-02-27 20:37         ` David Soulayrol
  2007-02-27 20:52           ` Lennart Borgman (gmail)
       [not found]           ` <mailman.181.1172609581.7795.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: David Soulayrol @ 2007-02-27 20:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Le Mon, 26 Feb 2007 17:42:47 +0100, Lennart Borgman (gmail) a écrit:

> Matthew Flaschen wrote:
>
>> David Soulayrol wrote:
>>> 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.

I understand now well that gnuserv or emacsclient is only meant at sending
commands to a running instance of Emacs. What I miss is, as I said, to get
information in the opposite way: from Emacs to another process.

My goal is to embed Emacs in pida, a python IDE based on other components.
pida is currently able to embed vim and a pair of other editors.

I'm going to take the time to read about elisp and try to write the
missing piece of my puzzle. Thanks both of you for your help.

David.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
  2007-02-27 20:37         ` David Soulayrol
@ 2007-02-27 20:52           ` Lennart Borgman (gmail)
       [not found]           ` <mailman.181.1172609581.7795.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Lennart Borgman (gmail) @ 2007-02-27 20:52 UTC (permalink / raw)
  To: David Soulayrol; +Cc: help-gnu-emacs

David Soulayrol wrote:

> I'm going to take the time to read about elisp and try to write the
> missing piece of my puzzle. Thanks both of you for your help.


Read the section about hooks, in Emacs 22 (in late beta test):

    M-: (info "(elisp) Standard Hooks")

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get asynchronous notifications from Emacs ?
       [not found]           ` <mailman.181.1172609581.7795.help-gnu-emacs@gnu.org>
@ 2007-02-27 21:47             ` Thorsten Bonow
  0 siblings, 0 replies; 8+ messages in thread
From: Thorsten Bonow @ 2007-02-27 21:47 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Lennart" == Lennart Borgman <(gmail)" <lennart.borgman@gmail.com>> writes:


    Lennart> Read the section about hooks, in Emacs 22 (in late beta test):

    Lennart>    M-: (info "(elisp) Standard Hooks")

Since David asked what to do "[...] to get information in the opposite way: from
Emacs to another process [...]", I think that Chapter 37 of the Emacs lisp
manual: "Processes" is important, too.

It treats interaction with subprocesses or more general inter process
communication with signals or via networking.

Toto


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

"You know if you're going to make a wholesale generalization, say
it in German. It gives it that extra 'oomph.'" --Jon Stewart

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-27 21:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-25 12:25 How to get asynchronous notifications from Emacs ? David Soulayrol
2007-02-25 14:16 ` Matthew Flaschen
     [not found] ` <mailman.81.1172413015.7795.help-gnu-emacs@gnu.org>
2007-02-26  8:43   ` David Soulayrol
2007-02-26  9:49     ` Matthew Flaschen
2007-02-26 16:42       ` Lennart Borgman (gmail)
     [not found]       ` <mailman.120.1172508176.7795.help-gnu-emacs@gnu.org>
2007-02-27 20:37         ` David Soulayrol
2007-02-27 20:52           ` Lennart Borgman (gmail)
     [not found]           ` <mailman.181.1172609581.7795.help-gnu-emacs@gnu.org>
2007-02-27 21:47             ` Thorsten Bonow

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.