`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.
This commit is contained in:
Bastien Guerry 2010-09-03 15:35:15 +02:00
parent 8f173ce843
commit 4f95c5469c
1 changed files with 4 additions and 2 deletions

View File

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