summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-11-10 10:44:25 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-11-10 10:44:25 +0100
commite8fbed7bc14d560301d497a39837ff26420eab1d (patch)
tree98dde32032cdee8056dbd75854d83c9da75806f4
parent204a2631167a908c76d95fc5b5b5cd9c6fe6e3cd (diff)
downloadorg-mode-e8fbed7bc14d560301d497a39837ff26420eab1d.tar.gz
Better error message when creating block diary entry but no mark exists
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-agenda.el2
2 files changed, 5 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 74a6685..048d2ac 100755
--- a/lisp/ChangeLog
+++ b/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.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 7623906..708b193 100644
--- a/lisp/org-agenda.el
+++ b/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