From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muchenxuan Tong Subject: [PATCH] Check org-timer-display in org-timer-set-mode-line when, value is 'off Date: Tue, 28 Aug 2012 20:03:33 +0800 Message-ID: <503CB395.3020908@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6KWI-0007AV-3q for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 08:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6KWE-0008Mu-Ot for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 08:03:46 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:38390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6KWE-0008Mb-IV for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 08:03:42 -0400 Received: by pbbro12 with SMTP id ro12so9542112pbb.0 for ; Tue, 28 Aug 2012 05:03:40 -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 Check org-timer-display in org-timer-set-mode-line when value is 'off * lisp/org-timer.el (org-timer-set-mode-line): Check org-timer-display when value is 'off. This solves the error of (org-timer-set-mode-line 'off) when org-timer-display is 'mode-line. In this case frame-title-format may not be a list. TINYCHANGE --- lisp/org-timer.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org-timer.el b/lisp/org-timer.el index 551dbea..92aaf1c 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -304,10 +304,14 @@ VALUE can be `on', `off', or `pause'." (when org-timer-mode-line-timer (cancel-timer org-timer-mode-line-timer) (setq org-timer-mode-line-timer nil)) - (setq global-mode-string - (delq 'org-timer-mode-line-string global-mode-string)) - (setq frame-title-format - (delq 'org-timer-mode-line-string frame-title-format)) + (when (or (eq org-timer-display 'mode-line) + (eq org-timer-display 'both)) + (setq global-mode-string + (delq 'org-timer-mode-line-string global-mode-string))) + (when (or (eq org-timer-display 'frame-title) + (eq org-timer-display 'both)) + (setq frame-title-format + (delq 'org-timer-mode-line-string frame-title-format))) (force-mode-line-update)) ((equal value 'pause) (when org-timer-mode-line-timer -- 1.7.12