Selaa lähdekoodia

`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.
Bastien Guerry 15 vuotta sitten
vanhempi
commit
4f95c5469c
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      lisp/org-timer.el

+ 4 - 2
lisp/org-timer.el

@@ -366,9 +366,11 @@ replace any running timer."
 		     (widen)
 		     (widen)
 		     (goto-char pos)
 		     (goto-char pos)
 		     (org-show-entry)
 		     (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)
 		((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"))))
 		(t (error "Not in an Org buffer"))))
 	   timer-set)
 	   timer-set)
       (if (or (and org-timer-current-timer
       (if (or (and org-timer-current-timer