~protesilaos/tmr

3 2

Add hooks

Details
Message ID
<87bkw4h3c4.fsf@cassou.me>
DKIM signature
missing
Download raw message
Hi,

I think it would be good to add the hooks below to the code:

- tmr-timer-created-hook
- tmr-timer-completed-hook
- tmr-timer-cancelled-hook
- tmr-timer-removed-hook

For each hook, here are a few behaviors that could be attached by
default or just suggested to the user:

- call #'message with the timer's long description
- send a notification
- log to the log buffer
- refresh the tabulated view

For tmr-timer-cancelled-hook, we could also suggest removing the timer
from the list.

What do you think?

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Details
Message ID
<875ymc3053.fsf@protesilaos.com>
In-Reply-To
<87bkw4h3c4.fsf@cassou.me> (view parent)
DKIM signature
pass
Download raw message
> From: Damien Cassou <damien@cassou.me>
> Date: Wed, 11 May 2022 10:37:47 +0200
>
> Hi,

Hello Damien,

> I think it would be good to add the hooks below to the code:
>
> - tmr-timer-created-hook
> - tmr-timer-completed-hook
> - tmr-timer-cancelled-hook
> - tmr-timer-removed-hook
>
> For each hook, here are a few behaviors that could be attached by
> default or just suggested to the user:
>
> - call #'message with the timer's long description
> - send a notification
> - log to the log buffer
> - refresh the tabulated view
>
> For tmr-timer-cancelled-hook, we could also suggest removing the timer
> from the list.
>
> What do you think?

This makes perfect sense.  It gives us a cleaner design and provides
more flexibility to the user.

How should we go about it?  Are you working on patches or do you want me
to give it a try?

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<87o804f3jv.fsf@cassou.me>
In-Reply-To
<875ymc3053.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
Protesilaos Stavrou <info@protesilaos.com> writes:
> How should we go about it?  Are you working on patches or do you want me
> to give it a try?

I will do it unless you want to. I will decompose tmr.el into several
files in the same set of patches because these 2 changes go hand in
hand.

Best

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Details
Message ID
<871qx0ox8r.fsf@protesilaos.com>
In-Reply-To
<87o804f3jv.fsf@cassou.me> (view parent)
DKIM signature
pass
Download raw message
> From: Damien Cassou <damien@cassou.me>
> Date: Wed, 11 May 2022 18:16:04 +0200
>
> Protesilaos Stavrou <info@protesilaos.com> writes:
>> How should we go about it?  Are you working on patches or do you want me
>> to give it a try?
>
> I will do it unless you want to. I will decompose tmr.el into several
> files in the same set of patches because these 2 changes go hand in
> hand.

Okay.  Since you already have an idea, I suggest you do it.  I will help
test things and make changes to the manual.

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)