Gnus development mailing list
 help / color / mirror / Atom feed
* Re: run-hooks vs. run-mode-hooks.
       [not found] ` <E1DbBPR-00042J-1p@fencepost.gnu.org>
@ 2005-05-27  0:58   ` Katsumi Yamaoka
  2005-05-27  1:40     ` Lute Kamstra
  2005-05-27 14:20     ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-05-27  0:58 UTC (permalink / raw)
  Cc: emacs-devel, ding

Hi,

run-mode-hooks is only available in Emacs 22, while Gnus v5.11
still supports Emacs 20 and 21 (and No Gnus supports Emacs 21).

2005-05-26  Lute Kamstra  <lute@gnu.org>

	* score-mode.el (gnus-score-mode): Use run-mode-hooks.

Is it possible to use run-hooks in those Emacs versions?

Regards,



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27  0:58   ` run-hooks vs. run-mode-hooks Katsumi Yamaoka
@ 2005-05-27  1:40     ` Lute Kamstra
  2005-05-27  3:32       ` Katsumi Yamaoka
  2005-05-27 14:20     ` Richard Stallman
  1 sibling, 1 reply; 10+ messages in thread
From: Lute Kamstra @ 2005-05-27  1:40 UTC (permalink / raw)
  Cc: emacs-devel, ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> run-mode-hooks is only available in Emacs 22, while Gnus v5.11
> still supports Emacs 20 and 21 (and No Gnus supports Emacs 21).
>
> 2005-05-26  Lute Kamstra  <lute@gnu.org>
>
> 	* score-mode.el (gnus-score-mode): Use run-mode-hooks.

Sorry about that.

> Is it possible to use run-hooks in those Emacs versions?

Maybe Gnus can do something like:

(or (fboundp 'run-mode-hooks)
    (defalias 'run-mode-hooks 'run-hooks))

I saw that most hooks are run with gnus-run-hooks, which calls
run-hooks.  Maybe you can also define a gnus-run-mode-hooks that uses
run-mode-hooks instead and use that function for Gnus' major modes?

Lute.



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27  1:40     ` Lute Kamstra
@ 2005-05-27  3:32       ` Katsumi Yamaoka
  0 siblings, 0 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-05-27  3:32 UTC (permalink / raw)
  Cc: emacs-devel, ding

>>>>> In <87hdgp4fa1.fsf@xs4all.nl> Lute Kamstra wrote:

>> Is it possible to use run-hooks in those Emacs versions?

> Maybe Gnus can do something like:

> (or (fboundp 'run-mode-hooks)
>     (defalias 'run-mode-hooks 'run-hooks))

> I saw that most hooks are run with gnus-run-hooks, which calls
> run-hooks.  Maybe you can also define a gnus-run-mode-hooks that uses
> run-mode-hooks instead and use that function for Gnus' major modes?

I've added gnus-run-mode-hooks to both the Gnus trunk and the
v5-10 branch (synch'd with the Emacs trunk).  Thank you for the
good suggestion.



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27  0:58   ` run-hooks vs. run-mode-hooks Katsumi Yamaoka
  2005-05-27  1:40     ` Lute Kamstra
@ 2005-05-27 14:20     ` Richard Stallman
  2005-05-27 15:12       ` Lute Kamstra
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2005-05-27 14:20 UTC (permalink / raw)
  Cc: Lute.Kamstra.lists, ding, emacs-devel

    Is it possible to use run-hooks in those Emacs versions?

Yes, but it won't always be correct.

    Maybe Gnus can do something like:

    (or (fboundp 'run-mode-hooks)
	(defalias 'run-mode-hooks 'run-hooks))

Definitely not!  Gnus should not mess with the way Emacs defines
(or doesn't define) these functions!

Gnus should define a function called gnus-run-mode-hooks, which calls
run-mode-hooks if that is defined, otherwise run-hooks.  Then all the
modes in Gnus could use gnus-run-mode-hooks.



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27 14:20     ` Richard Stallman
@ 2005-05-27 15:12       ` Lute Kamstra
  2005-05-27 21:43         ` Miles Bader
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lute Kamstra @ 2005-05-27 15:12 UTC (permalink / raw)
  Cc: Katsumi Yamaoka, ding, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Maybe Gnus can do something like:
>
>     (or (fboundp 'run-mode-hooks)
> 	(defalias 'run-mode-hooks 'run-hooks))
>
> Definitely not!  Gnus should not mess with the way Emacs defines
> (or doesn't define) these functions!

It seems that that I was badly educated by code I read: I've quite
often seen the use of constructs like the one above.

> Gnus should define a function called gnus-run-mode-hooks, which calls
> run-mode-hooks if that is defined, otherwise run-hooks.  Then all the
> modes in Gnus could use gnus-run-mode-hooks.

That's what Katsumi did for gnus-score-mode.  Other major mode in Gnus
still use gnus-run-hooks which uses run-hooks.  Katsumi, could you fix
those modes in a similar way?

Lute.

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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27 15:12       ` Lute Kamstra
@ 2005-05-27 21:43         ` Miles Bader
  2005-05-27 23:48         ` Katsumi Yamaoka
  2005-05-28 11:52         ` Richard Stallman
  2 siblings, 0 replies; 10+ messages in thread
From: Miles Bader @ 2005-05-27 21:43 UTC (permalink / raw)
  Cc: ding

Lute Kamstra <Lute.Kamstra.lists@xs4all.nl> writes:
> It seems that that I was badly educated by code I read: I've quite
> often seen the use of constructs like the one above.

There is, or at least used to be, a fair amount of bad old code that
does stuff like that.  One of the worst offenders was (not sure if it's
been fixed) w3.

I remember lots of bug reports where the problem was eventually revealed
to be some package getting confused by w3's mucking around with the
namespace.

-Miles
-- 
Yo mama's so fat when she gets on an elevator it HAS to go down.

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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27 15:12       ` Lute Kamstra
  2005-05-27 21:43         ` Miles Bader
@ 2005-05-27 23:48         ` Katsumi Yamaoka
  2005-05-30  6:45           ` Katsumi Yamaoka
  2005-05-28 11:52         ` Richard Stallman
  2 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-05-27 23:48 UTC (permalink / raw)
  Cc: rms, ding, emacs-devel

> Richard Stallman <rms@gnu.org> writes:

>> Gnus should define a function called gnus-run-mode-hooks, which calls
>> run-mode-hooks if that is defined, otherwise run-hooks.  Then all the
>> modes in Gnus could use gnus-run-mode-hooks.

>>>>> In <87br6w8zzo.fsf@xs4all.nl>
>>>>>	Lute Kamstra <Lute.Kamstra.lists@xs4all.nl> wrote:

> That's what Katsumi did for gnus-score-mode.  Other major mode in Gnus
> still use gnus-run-hooks which uses run-hooks.  Katsumi, could you fix
> those modes in a similar way?

Ok, I'll make time to do that, maybe in Monday.

Regards,



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27 15:12       ` Lute Kamstra
  2005-05-27 21:43         ` Miles Bader
  2005-05-27 23:48         ` Katsumi Yamaoka
@ 2005-05-28 11:52         ` Richard Stallman
  2 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2005-05-28 11:52 UTC (permalink / raw)
  Cc: yamaoka, ding, emacs-devel

    >     (or (fboundp 'run-mode-hooks)
    > 	(defalias 'run-mode-hooks 'run-hooks))

    It seems that that I was badly educated by code I read: I've quite
    often seen the use of constructs like the one above.

Are there any examples in the Emacs sources?
If so, could you show me a few?



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-27 23:48         ` Katsumi Yamaoka
@ 2005-05-30  6:45           ` Katsumi Yamaoka
  2005-05-31  4:17             ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2005-05-30  6:45 UTC (permalink / raw)
  Cc: rms, ding, emacs-devel

>>>>>> In <87br6w8zzo.fsf@xs4all.nl>
>>>>>>	Lute Kamstra <Lute.Kamstra.lists@xs4all.nl> wrote:

>> Other major mode in Gnus still use gnus-run-hooks which uses
>> run-hooks.  Katsumi, could you fix those modes in a similar way?

>>>>> In <yotld5rccjry.fsf@jpl.org> Katsumi Yamaoka wrote:

> Ok, I'll make time to do that, maybe in Monday.

>>>>> In <E1DbfhH-0004Zk-BU@fencepost.gnu.org> Richard Stallman wrote:

>     Is it possible to use run-hooks in those Emacs versions?

> Gnus should define a function called gnus-run-mode-hooks, which calls
> run-mode-hooks if that is defined, otherwise run-hooks.  Then all the
> modes in Gnus could use gnus-run-mode-hooks.

I've done it in the Gnus trunk and the v5-10 branch.



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

* Re: run-hooks vs. run-mode-hooks.
  2005-05-30  6:45           ` Katsumi Yamaoka
@ 2005-05-31  4:17             ` Richard Stallman
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2005-05-31  4:17 UTC (permalink / raw)
  Cc: Lute.Kamstra.lists, ding, emacs-devel

    > Gnus should define a function called gnus-run-mode-hooks, which calls
    > run-mode-hooks if that is defined, otherwise run-hooks.  Then all the
    > modes in Gnus could use gnus-run-mode-hooks.

    I've done it in the Gnus trunk and the v5-10 branch.

Thank you.



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

end of thread, other threads:[~2005-05-31  4:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <874qcro5gv.fsf@xs4all.nl>
     [not found] ` <E1DbBPR-00042J-1p@fencepost.gnu.org>
2005-05-27  0:58   ` run-hooks vs. run-mode-hooks Katsumi Yamaoka
2005-05-27  1:40     ` Lute Kamstra
2005-05-27  3:32       ` Katsumi Yamaoka
2005-05-27 14:20     ` Richard Stallman
2005-05-27 15:12       ` Lute Kamstra
2005-05-27 21:43         ` Miles Bader
2005-05-27 23:48         ` Katsumi Yamaoka
2005-05-30  6:45           ` Katsumi Yamaoka
2005-05-31  4:17             ` Richard Stallman
2005-05-28 11:52         ` Richard Stallman

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 NNTP newsgroup(s).