unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* interaction with "internal" emacs processes.
@ 2005-10-06 15:44 mak kwak
  2005-10-06 16:25 ` Friedrich Laher
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: mak kwak @ 2005-10-06 15:44 UTC (permalink / raw)


Halo
My question is rather general.
Quite often I have a need of controling some internal emacs processes. By "internal process" i mean an action that is not listed by `M-x list-processes' but still seems to be and independant process. Examples are: action invoked by `M-x ediff-directories' or `M-x cvs-checkout'.
My question is: can I interact somehow with those emacs "internal processes" ? Especially I would like to deffer invocations of a lisp function after "internal process" is finished.

Example:
(defun my-cvs-checkout-example ()
""
(call-interactively 'cvs-checkout)
(message "checking out cvs repository finished") ;;. I want it be run as cvs-checkout is finished and here it is not.
)


I expect that sometimes there is a special hook that is run after something is finished, but sometimes there is no such hook ( like here for example ). I also did not find any `wait' elisp function that would wait for other function to be finished.

My question is: are there any mechanisms in elisp that make such things be possible.
Greetings


----------------------------------------------------
Zapraszamy na sesję naukową "Społeczeństwo
obywatelskie - nowe imię solidarności" 8 października w Gdańsku.
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fsesja.html&sid=526

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

* Re: interaction with "internal" emacs processes.
  2005-10-06 15:44 interaction with "internal" emacs processes mak kwak
@ 2005-10-06 16:25 ` Friedrich Laher
  2005-10-06 17:56 ` Kevin Rodgers
       [not found] ` <mailman.10118.1128621534.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Friedrich Laher @ 2005-10-06 16:25 UTC (permalink / raw)


perhaps "advise" ?

mak kwak wrote:

>Halo
>My question is rather general.
>Quite often I have a need of controling some internal emacs processes. By "internal process" i mean an action that is not listed by `M-x list-processes' but still seems to be and independant process. Examples are: action invoked by `M-x ediff-directories' or `M-x cvs-checkout'.
>My question is: can I interact somehow with those emacs "internal processes" ? Especially I would like to deffer invocations of a lisp function after "internal process" is finished.
>
>Example:
>(defun my-cvs-checkout-example ()
>""
>(call-interactively 'cvs-checkout)
>(message "checking out cvs repository finished") ;;. I want it be run as cvs-checkout is finished and here it is not.
>)
>
>
>I expect that sometimes there is a special hook that is run after something is finished, but sometimes there is no such hook ( like here for example ). I also did not find any `wait' elisp function that would wait for other function to be finished.
>
>My question is: are there any mechanisms in elisp that make such things be possible.
>Greetings
>
>
>----------------------------------------------------
>Zapraszamy na sesję naukową "Społeczeństwo
>obywatelskie - nowe imię solidarności" 8 października w Gdańsku.
>http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fsesja.html&sid=526
>
>
>
>
>_______________________________________________
>Help-gnu-emacs mailing list
>Help-gnu-emacs@gnu.org
>http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
>  
>

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

* Re: interaction with "internal" emacs processes.
  2005-10-06 15:44 interaction with "internal" emacs processes mak kwak
  2005-10-06 16:25 ` Friedrich Laher
@ 2005-10-06 17:56 ` Kevin Rodgers
       [not found] ` <mailman.10118.1128621534.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2005-10-06 17:56 UTC (permalink / raw)


mak kwak wrote:
 > Example:
 > (defun my-cvs-checkout-example ()
 > ""
 > (call-interactively 'cvs-checkout)
 > (message "checking out cvs repository finished") ;;. I want it be run 
as cvs-checkout is finished and here it is not.
 > )
 >
 > I expect that sometimes there is a special hook that is run after
 > something is finished, but sometimes there is no such hook ( like here
 > for example ). I also did not find any `wait' elisp function that
 > would wait for other function to be finished.

defadvice.el is exactly for situations where Emacs doesn't provide a
hook:

(defadvice cvs-checkout (after message activate)
   "Display a message when finished."
   (message "cvs-checkout finished"))

-- 
Kevin Rodgers

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

* Re: interaction with "internal" emacs processes.
@ 2005-10-07 14:19 mak kwak
  0 siblings, 0 replies; 7+ messages in thread
From: mak kwak @ 2005-10-07 14:19 UTC (permalink / raw)



Thank You Friedrich and Kevin for response.
I will go that way.
Greetings.

Dnia 6-10-2005 o godz. 19:56 Kevin Rodgers napisał(a):
> mak kwak wrote:
>  > Example:
>  > (defun my-cvs-checkout-example ()
>  > ""
>  > (call-interactively 'cvs-checkout)
>  > (message "checking out cvs repository finished") ;;. I want it be run 
> as cvs-checkout is finished and here it is not.
>  > )
>  >
>  > I expect that sometimes there is a special hook that is run after
>  > something is finished, but sometimes there is no such hook ( like here
>  > for example ). I also did not find any `wait' elisp function that
>  > would wait for other function to be finished.
> 
> defadvice.el is exactly for situations where Emacs doesn't provide a
> hook:
> 
> (defadvice cvs-checkout (after message activate)
>    "Display a message when finished."
>    (message "cvs-checkout finished"))
> 
> -- 
> Kevin Rodgers
> 
> 
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> 

----------------------------------------------------
Zapraszamy na sesję naukową "Społeczeństwo
obywatelskie - nowe imię solidarności" 8 października w Gdańsku.
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fsesja.html&sid=526

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

* Re: interaction with "internal" emacs processes.
       [not found] ` <mailman.10118.1128621534.20277.help-gnu-emacs@gnu.org>
@ 2005-10-07 17:06   ` rgb
  2005-10-11 15:02     ` Thien-Thi Nguyen
  2005-10-11  3:56   ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: rgb @ 2005-10-07 17:06 UTC (permalink / raw)



>  > (defun my-cvs-checkout-example ()
>  > ""
>  > (call-interactively 'cvs-checkout)
>  > (message "checking out cvs repository finished") ;;. I want it be run
> as cvs-checkout is finished and here it is not.
>  > )
>  >
> defadvice.el is exactly for situations where Emacs doesn't provide a
> hook:
>
> (defadvice cvs-checkout (after message activate)
>    "Display a message when finished."
>    (message "cvs-checkout finished"))
>
I'm totally lost on this line of thought.
How is it possible that any function f-b could execute before
f-a completes.

(f-a)
(f-b)

Your statement implies that the advice on f-a (i.e. f-c)
somehow won't execute until after f-b completes.

(defadvise foo (after f-b) (f-c))
(f-a)
(f-b)

Otherwise what's the point of needing advise?
You could just put the functionality of f-c in f-b
(which is what the OP said didn't work).

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

* Re: interaction with "internal" emacs processes.
       [not found] ` <mailman.10118.1128621534.20277.help-gnu-emacs@gnu.org>
  2005-10-07 17:06   ` rgb
@ 2005-10-11  3:56   ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2005-10-11  3:56 UTC (permalink / raw)


>> Example:
>> (defun my-cvs-checkout-example ()
>> ""
>> (call-interactively 'cvs-checkout)
>> (message "checking out cvs repository finished") ;;. I want it be run as
>    cvs-checkout is finished and here it is not.
>> )
>> 
>> I expect that sometimes there is a special hook that is run after
>> something is finished, but sometimes there is no such hook ( like here
>> for example ). I also did not find any `wait' elisp function that
>> would wait for other function to be finished.

PCL-CVS runs the command asynchronously, so upon completion of the
underlying cvs process, Emacs runs the process's sentinel function (which
in PCL-CVS parses the process's output to update the *cvs* buffer).

I'm not sure what you want to do exactly, but maybe you want to implement
your own cvs-checkout which does something extra after the checkout is
finished, in which case you should probably reimplement the function, using
cvs-mode-run (which takes a :postproc argument where you can specify code to
be executed after the command terminates).


        Stefan

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

* Re: interaction with "internal" emacs processes.
  2005-10-07 17:06   ` rgb
@ 2005-10-11 15:02     ` Thien-Thi Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Thien-Thi Nguyen @ 2005-10-11 15:02 UTC (permalink / raw)


"rgb" <rbielaws@i1.net> writes:

> How is it possible that any function f-b could execute
> before f-a completes.

probably it was a typo (posting-grade code).  anyway, "completes" is
insufficient to describe asynchronous operation, for which there is one
starting point, but multiple ending points; the programmer can control
the interaction of the ending points in various ways.

thi

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

end of thread, other threads:[~2005-10-11 15:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-06 15:44 interaction with "internal" emacs processes mak kwak
2005-10-06 16:25 ` Friedrich Laher
2005-10-06 17:56 ` Kevin Rodgers
     [not found] ` <mailman.10118.1128621534.20277.help-gnu-emacs@gnu.org>
2005-10-07 17:06   ` rgb
2005-10-11 15:02     ` Thien-Thi Nguyen
2005-10-11  3:56   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2005-10-07 14:19 mak kwak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).