diff options
author | Bastien Guerry <bzg@altern.org> | 2012-04-22 09:01:28 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-04-22 09:01:28 +0200 |
commit | ef956d71814236ad2034ba1b2856047d3c330bdc (patch) | |
tree | 6aeeb1c43d577a7b0e4864ace0df87e515d516e0 | |
parent | a1fd7c46269111a4aa4a414d1ca97a236d29583b (diff) | |
download | org-mode-ef956d71814236ad2034ba1b2856047d3c330bdc.tar.gz |
When clocking, Don't modify `frame-title-format' if it is a string.
* org-clock.el (org-clock-out, org-clock-cancel)
(org-clock-in): Don't modify `frame-title-format' if it is a
string.
Thanks to Mike McLean for reporting this and to Matt Lundin for
pointing at the problem in the code.
-rw-r--r-- | lisp/org-clock.el | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 25a36cf..7871f5b 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1209,8 +1209,9 @@ the clocking selection, associated with the letter `d'." (setq global-mode-string (append global-mode-string '(org-mode-line-string))))) ;; add to frame title - (when (or (eq org-clock-clocked-in-display 'frame-title) - (eq org-clock-clocked-in-display 'both)) + (when (and (or (eq org-clock-clocked-in-display 'frame-title) + (eq org-clock-clocked-in-display 'both)) + (listp frame-title-format)) (or (memq 'org-frame-title-string frame-title-format) (setq frame-title-format (append frame-title-format '(org-frame-title-string))))) @@ -1370,8 +1371,9 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (when (not (org-clocking-p)) (setq global-mode-string (delq 'org-mode-line-string global-mode-string)) - (setq frame-title-format - (delq 'org-frame-title-string frame-title-format)) + (when (listp frame-title-format) + (setq frame-title-format + (delq 'org-frame-title-string frame-title-format))) (force-mode-line-update) (if fail-quietly (throw 'exit t) (error "No active clock"))) (let (ts te s h m remove) @@ -1416,8 +1418,9 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (setq org-clock-idle-timer nil)) (setq global-mode-string (delq 'org-mode-line-string global-mode-string)) - (setq frame-title-format - (delq 'org-frame-title-string frame-title-format)) + (when (listp frame-title-format) + (setq frame-title-format + (delq 'org-frame-title-string frame-title-format))) (when org-clock-out-switch-to-state (save-excursion (org-back-to-heading t) @@ -1517,8 +1520,9 @@ UPDOWN tells whether to change 'up or 'down." (when (not (org-clocking-p)) (setq global-mode-string (delq 'org-mode-line-string global-mode-string)) - (setq frame-title-format - (delq 'org-frame-title-string frame-title-format)) + (when (listp frame-title-format) + (setq frame-title-format + (delq 'org-frame-title-string frame-title-format))) (force-mode-line-update) (error "No active clock")) (save-excursion ; Do not replace this with `with-current-buffer'. @@ -1531,8 +1535,9 @@ UPDOWN tells whether to change 'up or 'down." (move-marker org-clock-hd-marker nil) (setq global-mode-string (delq 'org-mode-line-string global-mode-string)) - (setq frame-title-format - (delq 'org-frame-title-string frame-title-format)) + (when (listp frame-title-format) + (setq frame-title-format + (delq 'org-frame-title-string frame-title-format))) (force-mode-line-update) (message "Clock canceled") (run-hooks 'org-clock-cancel-hook)) |