summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2010-09-03 15:35:15 +0200
committerBastien Guerry <bzg@altern.org>2010-09-03 15:35:15 +0200
commit4f95c5469c214169b0b0f37dceacdf0a1b785add (patch)
tree9195281e8d4cf4fff00c366ce8ff72db8e7c0e68
parent8f173ce8434a540adbddd9cd81cf380a18894767 (diff)
downloadorg-mode-4f95c5469c214169b0b0f37dceacdf0a1b785add.tar.gz
`org-timer-set-timer': allow to run even before the first heading.
In this case, the notification will tell the user in what file the timer was set.
-rw-r--r--lisp/org-timer.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index 80b8cd9..313d4f0 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -366,9 +366,11 @@ replace any running timer."
(widen)
(goto-char pos)
(org-show-entry)
- (org-get-heading))))
+ (or (ignore-errors (org-get-heading))
+ (concat "File:" (file-name-nondirectory (buffer-file-name)))))))
((eq major-mode 'org-mode)
- (org-get-heading))
+ (or (ignore-errors (org-get-heading))
+ (concat "File:" (file-name-nondirectory (buffer-file-name)))))
(t (error "Not in an Org buffer"))))
timer-set)
(if (or (and org-timer-current-timer