Re: run-hooks vs. run-mode-hooks.

2005-05-30 Thread Richard Stallman
> 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.

Re: run-hooks vs. run-mode-hooks.

2005-05-30 Thread Katsumi Yamaoka
>> In <[EMAIL PROTECTED]> >> Lute Kamstra <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> Katsumi Yamaoka wrote: > Ok, I'll make time to do that, m

Re: run-hooks vs. run-mode-hooks.

2005-05-28 Thread Richard Stallman
> (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? ___

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Katsumi Yamaoka
> Richard Stallman <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > Lute Kamstra <[EMAI

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Juanma Barranquero
> Better use: > >(defalias 'mymodule-function-in-doubt > (if (fboundp 'function-in-doubt) > 'function-in-doubt >(lambda (..) ...))) I was only highlighting the fact that defining functions from "future" Emacsen is Not Good, but yes, your way is better. Every non-contrive

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Miles Bader
Lute Kamstra <[EMAIL PROTECTED]> 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

RE: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Drew Adams
> (if (fboundp 'function-in-doubt) > (defalias 'mymodule-function-in-doubt 'function-in-doubt) > (defun mymodule-function-in-doubt ...)) Actually this form has the disadvantage that the byte-compiler would have to check which functions are defnied in every branch

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Stefan Monnier
> (if (fboundp 'function-in-doubt) > (defalias 'mymodule-function-in-doubt 'function-in-doubt) > (defun mymodule-function-in-doubt ...)) Actually this form has the disadvantage that the byte-compiler would have to check which functions are defnied in every branch. And snice it doesn't

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Lute Kamstra
Richard Stallman <[EMAIL PROTECTED]> 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

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Richard Stallman
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 d

Re: run-hooks vs. run-mode-hooks.

2005-05-27 Thread Juanma Barranquero
> Maybe Gnus can do something like: > > (or (fboundp 'run-mode-hooks) > (defalias 'run-mode-hooks 'run-hooks)) (Not in this case, that's already been fixed but) that would not be good. The usual answer is making your own lookalike: (if (fboundp 'function-in-doubt) (defalias 'mymodul

Re: run-hooks vs. run-mode-hooks.

2005-05-26 Thread Katsumi Yamaoka
> In <[EMAIL PROTECTED]> 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-ho

Re: run-hooks vs. run-mode-hooks.

2005-05-26 Thread Lute Kamstra
Katsumi Yamaoka <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > > * score-mode.el (gnus-score-mode): Use run-mode-hooks. Sorry a

Re: run-hooks vs. run-mode-hooks.

2005-05-26 Thread Katsumi Yamaoka
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 <[EMAIL PROTECTED]> * score-mode.el (gnus-score-mode): Use run-mode-hooks. Is it possible to use run-hooks in those Emacs versions

Re: run-hooks vs. run-mode-hooks.

2005-05-25 Thread Richard Stallman
This change is correct--please install it. ___ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel