Browse Source

Better error message when creating block diary entry but no mark exists

Carsten Dominik 15 years ago
parent
commit
e8fbed7bc1
2 changed files with 5 additions and 0 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 0
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-agenda-diary-entry-in-org-file): Add error
+	message when no block is selected.
+
 	* org-latex.el (org-export-latex-links): Check for protectedness
 	in the last matched character, not after the match.
 

+ 2 - 0
lisp/org-agenda.el

@@ -6671,6 +6671,8 @@ The cursor may be at a date in the calendar, or in the Org agenda."
       (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1))
      ((equal char ?b)
       (setq text (read-string "Block entry: "))
+      (unless (and d1 d2 (not (equal d1 d2)))
+	(error "No block of days selected"))
       (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2))
      ((equal char ?j)
       (org-switch-to-buffer-other-window