ferfebles / redtick

Smallest emacs pomodoro timer (1 char)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to log the number of timers completed

se4u opened this issue · comments

commented

First of all thanks for the great app.

I was wondering if you could say what will be the easiest way to update redtick, so that it shows the number of pomodairo cycles completed alongside the timer character ? Or does it have this functionality already?

I can't modify the code to write the number of pomodoros alongside the timer, because... this will not be the "Smallest emacs pomodoro timer (1 char)" that I promise in the title of this minor-mode.

But I think that it's an interesting add on, and I've changed the popup that you see when you put your mouse on the timer character. Now you can see the number of completed pomodoros in the popup.

If you really want to add a (ugly :-) number to this clean mode line minor-mode, It's a trivial change to redtick--propertize, something like the third line in this code:

(defun redtick--propertize (bar bar-color)
  "Propertize BAR with BAR-COLOR, help echo, and click action."
  (propertize (format "%s.%s" redtick--completed-pomodoros bar)
              'face `(:inherit mode-line :foreground ,bar-color)
              'help-echo '(redtick--popup-message redtick--pomodoro-started-at
                                                  redtick--pomodoro-description)
              'pointer 'hand
              'local-map (make-mode-line-mouse-map 'mouse-1 'redtick)))

Please tell us if this code works for you, and thanks for using this!! :-)

commented

Thanks for adding the number of poms completed to the popup, that's enough for me.

Thanks again.
Pushpendre

On 03-Nov-2016, at 3:16 PM, ferfebles wrote:

I can't modify the code to write the number of pomodoros alongside the timer, because... this will not be the "Smallest emacs pomodoro timer (1 char)" that I promise in the title of this minor-mode.

But I think that it's an interesting add on, and I've changed the popup that you see when you put your mouse in front of the timer character. Now you can see the number of completed pomodoros in the popup.

If you really want to add a (ugly :-) number to this clean mode line minor-mode, It's a trivial change to redtick--propertize, something like the third line in this code:

(defun redtick--propertize (bar bar-color)
"Propertize BAR with BAR-COLOR, help echo, and click action."
(propertize (format "%s.%s" redtick--completed-pomodoros bar)
'face `(:inherit mode-line :foreground ,bar-color)
'help-echo '(redtick--popup-message redtick--pomodoro-started-at
redtick--pomodoro-description)
'pointer 'hand
'local-map (make-mode-line-mouse-map 'mouse-1 'redtick)))
Please tell us if this code works for you, and thanks for using this!! :-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Glad to help :-)