help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Querying available mode hooks in a given mode


From: Grant Rettke
Subject: Re: Querying available mode hooks in a given mode
Date: Mon, 14 Apr 2014 14:09:12 -0500

Hi Stefan et al,

On Sun, Apr 13, 2014 at 8:52 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> My goal is to, after a mode has been entered, to check whether
>>> a particular hook exists.  If it does or does not exist, then I will
>>> run some handler code.
>
> Can you give a concrete example?

Yes, it follows.

When I use Emacs Speaks Statistics [http://ess.r-project.org/], I like
all of my file buffers to be saved before evaluating any code in them,
so I wrote advice for 9 functions that provides this behavior. After
sharing that with the ESS list, one of the maintainers communicated to
me that in the development version of ESS there is a new hook that
will run when any of those 9 functions is called.

Since I'm on the MELPA version which behind that mainline dev version,
I wanted to write myself some code in my Emacs init file that upon
entering ESS mode would check if that hook exists, and it it does,
display a reminder to myself that I may migrate my code over to this
simpler approach.

Forgive my failures as a story teller; that is why I wanted to write that code.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]