From mboxrd@z Thu Jan 1 00:00:00 1970 From: Devin Homan Subject: Re: org-timer-set-timer org-notify message and sound arguments Date: Tue, 03 Sep 2013 17:51:54 -0800 Message-ID: <5226923A.5050803@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VH2Im-0000bA-8e for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 21:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VH2Id-0004yV-QV for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 21:54:36 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:39727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VH2Id-0004yR-JH for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 21:54:27 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz10so7222398pad.16 for ; Tue, 03 Sep 2013 18:54:26 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Here is a `git diff -p org-timer.el' of the changes that I am proposing. diff --git a/lisp/org-timer.el b/lisp/org-timer.el index 2351c4c..cb0ce45 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -93,6 +93,25 @@ nil current timer is not displayed" (defvar org-timer-cancel-hook nil "Hook run before countdown timer is canceled.") +(defvar org-timer-message nil + "Message displayed after countdown timer reaches zero. If + org-timer-message is not a string, then the default message + will be displayed.") + +(defcustom org-timer-clock-sound t + "Sound to play after the countdown timer reaches zero. +Possible values are: + +nil No sound played +t Standard Emacs beep +file name Play this sound file, fall back to beep" + :group 'org-time + ;; type is equivalent to `org-clock-sound' + :type '(choice + (const :tag "No sound" nil) + (const :tag "Standard beep" t) + (file :tag "Play sound file"))) + ;;;###autoload (defun org-timer-start (&optional offset) "Set the starting time for the relative timer to now. @@ -400,6 +419,7 @@ replace any running timer." (let* ((mins (string-to-number (match-string 0 minutes))) (secs (* mins 60)) (hl (cond + ((stringp org-timer-message) org-timer-message) ((string-match "Org Agenda" (buffer-name)) (let* ((marker (or (get-text-property (point) 'org-marker) (org-agenda-error))) @@ -429,7 +449,7 @@ replace any running timer." (run-with-timer secs nil `(lambda () (setq org-timer-current-timer nil) - (org-notify ,(format "%s: time out" hl) t) + (org-notify ,(format "%s: time out" hl) ,org-timer-clock-sound) (setq org-timer-timer-is-countdown nil) (org-timer-set-mode-line 'off) (run-hooks 'org-timer-done-hook))))