summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-11-20 20:35:34 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-11-20 20:35:34 +0100
commite80f24641cd27213aaf3fa6ae9b182eb5f8516a1 (patch)
tree0efcd1719c734cf71fdabe35ec8fc447623cbc14
parent62a7301a5e64403e4fdd7f50e9c5e6de614c23d5 (diff)
downloadorg-mode-e80f24641cd27213aaf3fa6ae9b182eb5f8516a1.tar.gz
Rebuild agenda after adding new diary entries
-rwxr-xr-xlisp/ChangeLog6
-rw-r--r--lisp/org-agenda.el9
-rw-r--r--lisp/org-datetree.el2
3 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b52512b..7d671cd 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
2009-11-20 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-agenda.el (org-agenda-diary-entry-in-org-file): Rebuild
+ agenda after adding new entry.
+
+ * org-datetree.el (org-datetree-find-day-create): Fix regular
+ expression.
+
* org.el (org-display-outline-path): Use a format specifier for
message, to avoid problems with heading containing `%'.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9a7244d..3fe6985 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6701,18 +6701,21 @@ The cursor may be at a date in the calendar, or in the Org agenda."
(cond
((equal char ?d)
(setq text (read-string "Day entry: "))
- (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
((equal char ?a)
(setq d1 (list (car d1) (nth 1 d1)
(read-number (format "Reference year [%d]: " (nth 2 d1))
(nth 2 d1))))
(setq text (read-string "Anniversary (use %d to show years): "))
- (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
((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))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
((equal char ?j)
(org-switch-to-buffer-other-window
(find-file-noselect org-agenda-diary-file))
diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el
index 2f3b19e..d7cf597 100644
--- a/lisp/org-datetree.el
+++ b/lisp/org-datetree.el
@@ -101,7 +101,7 @@ tree can be found."
(defun org-datetree-find-day-create (year month day)
(org-narrow-to-subtree)
- (let ((re (format "^\\*+[ \t]+%d-%02d-\\([01][0-9]\\)[ \t\n]" year month))
+ (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t\n]" year month))
match)
(goto-char (point-min))
(while (and (setq match (re-search-forward re nil t))