emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Check org-timer-display in org-timer-set-mode-line when, value is 'off
@ 2012-08-28 12:03 Muchenxuan Tong
  2012-08-29 17:56 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Muchenxuan Tong @ 2012-08-28 12:03 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Check org-timer-display in org-timer-set-mode-line when, value is 'off
  2012-08-28 12:03 [PATCH] Check org-timer-display in org-timer-set-mode-line when, value is 'off Muchenxuan Tong
@ 2012-08-29 17:56 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-08-29 17:56 UTC (permalink / raw)
  To: Muchenxuan Tong; +Cc: emacs-orgmode

Muchenxuan Tong <demon386@gmail.com> writes:

> 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.

Applied, thanks a lot for the fix and the changelog!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-29 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 12:03 [PATCH] Check org-timer-display in org-timer-set-mode-line when, value is 'off Muchenxuan Tong
2012-08-29 17:56 ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).