From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maske Newsgroups: gmane.emacs.help Subject: Re: Help with hooks Date: Fri, 15 Sep 2023 15:46:29 +0200 Message-ID: <9e56b755-2540-d31b-68aa-c2500cb9fce1@gmail.com> References: <988fce74-dd23-b32f-cf7d-c48ac2783777@gmail.com> <87v8cpes6f.fsf@gmail.com> <9a1233e3-d710-c1b5-5ec5-ecc3958a279a@gmail.com> <871qf5lhwz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9544"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cc: help-gnu-emacs@gnu.org To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 15 15:52:45 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qh9FT-0002CQ-Lq for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 15 Sep 2023 15:52:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qh9Et-0005fJ-NX; Fri, 15 Sep 2023 09:52:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qh9Ej-0005eP-82 for help-gnu-emacs@gnu.org; Fri, 15 Sep 2023 09:51:59 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qh9Ef-00033Z-90 for help-gnu-emacs@gnu.org; Fri, 15 Sep 2023 09:51:56 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qh9Eb-00013H-1e for help-gnu-emacs@gnu.org; Fri, 15 Sep 2023 15:51:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Content-Language: en-GB In-Reply-To: <871qf5lhwz.fsf@gmail.com> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-1.473, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145130 Archived-At: 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 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)) > > -- > >