unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Sentinel interfering with compile's mode line update
@ 2005-12-02 19:10 Bill Wohler
  2005-12-02 21:54 ` Stefan Monnier
       [not found] ` <4390DAA6.70108@yahoo.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Bill Wohler @ 2005-12-02 19:10 UTC (permalink / raw)


I wrote a function to compile the MH-E manual and to start info when the
compilation finishes. As you all know, when (compile) runs, it adds
"Compiling" to all of the mode lines. When the compilation finishes,
this text is removed.

However, with the set-process-sentinel line in the function below, the
"Compiling" text is never removed from the mode line.

Is this a bug in compile, set-process-sentinel, or in my code?

I've replaced my function with "yow" to simplify the recipe. Run this
from the *scratch* buffer to reproduce. You don't need a Makefile.

  (defun bw-mh-info-recompile ()
    "Compile and display MH-E manual."
    (interactive)
    (compile "make")
    (set-process-sentinel (get-process "compilation") 'yow))


(Updated from CVS yesterday.)

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-02 19:10 Sentinel interfering with compile's mode line update Bill Wohler
@ 2005-12-02 21:54 ` Stefan Monnier
  2005-12-02 22:56   ` Bill Wohler
       [not found] ` <4390DAA6.70108@yahoo.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2005-12-02 21:54 UTC (permalink / raw)
  Cc: emacs-devel

> I wrote a function to compile the MH-E manual and to start info when the
> compilation finishes. As you all know, when (compile) runs, it adds
> "Compiling" to all of the mode lines. When the compilation finishes,
> this text is removed.

And this text is removed by ... the process sentinel.

> However, with the set-process-sentinel line in the function below, the
> "Compiling" text is never removed from the mode line.

Because you replace the process sentinel with another.


        Stefan

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-02 21:54 ` Stefan Monnier
@ 2005-12-02 22:56   ` Bill Wohler
  0 siblings, 0 replies; 8+ messages in thread
From: Bill Wohler @ 2005-12-02 22:56 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > I wrote a function to compile the MH-E manual and to start info when the
> > compilation finishes. As you all know, when (compile) runs, it adds
> > "Compiling" to all of the mode lines. When the compilation finishes,
> > this text is removed.
> 
> And this text is removed by ... the process sentinel.

Thanks very much! That was enough of a clue for me to find and call
compilation-sentinel from my sentinel. I'm not sure I like this, but at
least it works.

> > However, with the set-process-sentinel line in the function below, the
> > "Compiling" text is never removed from the mode line.
> 
> Because you replace the process sentinel with another.

Wouldn't it be better to add the sentinel to the existing sentinels?
Maybe it would be better to provide another function such as
add-process-sentinel that provides this capability. Then one doesn't
have to know the implementation details of the sentinelized process. If
I didn't have the sources (and your help), I would not have been able to
figure this out since nowhere in the documentation does it indicate that
compile uses a sentinel and that I needed to call compilation-sentinel
from my sentinel.

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

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

* Re: Sentinel interfering with compile's mode line update
       [not found] ` <4390DAA6.70108@yahoo.com>
@ 2005-12-02 23:56   ` Bill Wohler
  2005-12-03  1:31     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Bill Wohler @ 2005-12-02 23:56 UTC (permalink / raw)
  Cc: emacs-devel

Kevin Rodgers <ihs_4664@yahoo.com> wrote:

> Bill Wohler wrote:
> > I wrote a function to compile the MH-E manual and to start info when the
> > compilation finishes. As you all know, when (compile) runs, it adds
> > "Compiling" to all of the mode lines. When the compilation finishes,
> > this text is removed.
> 
> Isn't that what compilation-finish-function and
> compilation-finish-functions are for?

I suppose so, but they aren't described in the compile docstring, nor do
they appear in the compilation customization group. That's either an
oversight or they are implementation details and not meant to be used.

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-02 23:56   ` Bill Wohler
@ 2005-12-03  1:31     ` Stefan Monnier
  2005-12-03  1:49       ` Bill Wohler
  2005-12-03  9:26       ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2005-12-03  1:31 UTC (permalink / raw)
  Cc: Kevin Rodgers, emacs-devel

>> Isn't that what compilation-finish-function and
>> compilation-finish-functions are for?

> I suppose so, but they aren't described in the compile docstring, nor do
> they appear in the compilation customization group.

It could probably be added to compile's docstring, indeed.
But it should stay out of the customization group since it's an
elisp-level functionality, unless we can come up with the good suggestions
of functions to put on that hook.

> That's either an oversight or they are implementation details and not
> meant to be used.

Not all the hooks are documented in dosctrings.  Maybe they should, but
until then I recommend checking the elisp code (or apropos
"foo-.*-\(hook\|functions?\)").


        Stefan

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-03  1:31     ` Stefan Monnier
@ 2005-12-03  1:49       ` Bill Wohler
  2005-12-03  9:26       ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Bill Wohler @ 2005-12-03  1:49 UTC (permalink / raw)
  Cc: Kevin Rodgers, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> >> Isn't that what compilation-finish-function and
> >> compilation-finish-functions are for?
> 
> > That's either an oversight or they are implementation details and not
> > meant to be used.
> 
> Not all the hooks are documented in dosctrings.  Maybe they should, but
> until then I recommend checking the elisp code (or apropos
> "foo-.*-\(hook\|functions?\)").

I wonder why that didn't occur to me. Hmmm. Thanks.

Even so, this wouldn't have worked in this case either since I would
have used "compile" for "foo", not "compilation". That the prefix is
compilation instead of compile is perhaps a topic for another day ;-).

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-03  1:31     ` Stefan Monnier
  2005-12-03  1:49       ` Bill Wohler
@ 2005-12-03  9:26       ` Eli Zaretskii
  2005-12-03 12:33         ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2005-12-03  9:26 UTC (permalink / raw)
  Cc: ihs_4664, wohler, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 02 Dec 2005 20:31:18 -0500
> Cc: Kevin Rodgers <ihs_4664@yahoo.com>, emacs-devel@gnu.org
> 
> Not all the hooks are documented in dosctrings.

But we do try to list them all in the ELisp manual, right?

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

* Re: Sentinel interfering with compile's mode line update
  2005-12-03  9:26       ` Eli Zaretskii
@ 2005-12-03 12:33         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2005-12-03 12:33 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Sat, 03 Dec 2005 11:26:31 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: ihs_4664@yahoo.com, wohler@newt.com, emacs-devel@gnu.org
> 
> > From: Stefan Monnier <monnier@iro.umontreal.ca>
> > Date: Fri, 02 Dec 2005 20:31:18 -0500
> > Cc: Kevin Rodgers <ihs_4664@yahoo.com>, emacs-devel@gnu.org
> > 
> > Not all the hooks are documented in dosctrings.
> 
> But we do try to list them all in the ELisp manual, right?

I added compilation-finish-functions to the list in the "Standard
Hooks" appendix of the ELisp manual.

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

end of thread, other threads:[~2005-12-03 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02 19:10 Sentinel interfering with compile's mode line update Bill Wohler
2005-12-02 21:54 ` Stefan Monnier
2005-12-02 22:56   ` Bill Wohler
     [not found] ` <4390DAA6.70108@yahoo.com>
2005-12-02 23:56   ` Bill Wohler
2005-12-03  1:31     ` Stefan Monnier
2005-12-03  1:49       ` Bill Wohler
2005-12-03  9:26       ` Eli Zaretskii
2005-12-03 12:33         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

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).