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

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

Re: Help with hooks


From: Maske
Subject: Re: Help with hooks
Date: Fri, 15 Sep 2023 15:46:29 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

Hi, tpeplt

I think version 20220318.1618 is newer than  2.1.0. It's from MELPA.
Do you think I should go for the older version?

I can hear the sounds related to org-pomodoro start and finishing.

Anyway, I will try to associate those functions to a keybind, instead of a hook, so they work. Maybe I will come for help to do this :p

Thanks!

On 11/09/2023 1:36, tpeplt wrote:
Maske <maske1foro@gmail.com> writes:


Source Code
;; Defined in ~/.emacs.d/elpa/org-pomodoro-20220318.1618/org-pomodoro.el


This might have no effect on your problem, but when I looked at the
‘org-pomodoro’ package in the ‘melpa-stable’ repository
(http://stable.melpa.org/packages/), the version number for the package
is 2.1.0, rather than your package’s version number (20220318.1618).
Either this is an experimental version of the package or there is an
upgrade that you could install for ‘org-pomodoro’.

The function ‘org-pomodoro-start’ in the package calls ‘run-hooks’ using
‘org-pomodoro-started-hook’.  Is it possible that this function is not
being called in your setup?  You might want to call that function
directly to see whether it would cause the toggling that you want.
(Unfortunately, the package does not install any documentation to
describe how it should be used.)  In addition to running the hooks, the
package attempts to play a sound.  You might not hear the sound
depending on your configuration, but if you do hear the start sound,
then that should indicate that ‘org-pomodoro-start’ also attempted to
run the hooks.

Here is the definition of the function as it exists in org-pomodoro.el
version 2.1.0:

(defun org-pomodoro-start (&optional state)
   "Start the `org-pomodoro` timer.
The argument STATE is optional.  The default state is `:pomodoro`."
   (when org-pomodoro-timer (cancel-timer org-pomodoro-timer))

   ;; add the org-pomodoro-mode-line to the global-mode-string
   (unless global-mode-string (setq global-mode-string '("")))
   (unless (memq 'org-pomodoro-mode-line global-mode-string)
     (setq global-mode-string (append global-mode-string
                                      '(org-pomodoro-mode-line))))

   (org-pomodoro-set (or state :pomodoro))

   (when (eq org-pomodoro-state :pomodoro)
     (org-pomodoro-maybe-play-sound :start)
     (run-hooks 'org-pomodoro-started-hook))
   (org-pomodoro-update-mode-line)
   (org-agenda-maybe-redo))

--






reply via email to

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