summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-12 13:08:14 +0100
committerBastien Guerry <bzg@altern.org>2011-02-12 13:08:14 +0100
commit6d6d24581daab97c885270ee816c8a3362a2ffa3 (patch)
treeb21700f34092b088d9f5a70b9a0cb17a921c6f5a
parent3a04522ef15a385c5113d30c99252268196b113c (diff)
downloadorg-mode-6d6d24581daab97c885270ee816c8a3362a2ffa3.tar.gz
Put multiline diary entries on a single line.
* org-agenda.el (org-get-entries-from-diary): Put multiline diary entries on a single line when lines don't start with a diary time. This was requested by Suvayu Ali.
-rw-r--r--lisp/org-agenda.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 2c81184..668e979 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4323,7 +4323,14 @@ of what a project is and how to check if it stuck, customize the variable
;; Add prefix to each line and extend the text properties
(if (zerop (buffer-size))
(setq entries nil)
- (setq entries (buffer-substring (point-min) (- (point-max) 1)))))
+ (setq entries (buffer-substring (point-min) (- (point-max) 1)))
+ (setq entries
+ (with-temp-buffer
+ (insert entries) (goto-char (point-min))
+ (while (re-search-forward "\n[ \t]+\\(.+\\)$" nil t)
+ (unless (save-match-data (string-match diary-time-regexp (match-string 1)))
+ (replace-match (concat "; " (match-string 1)))))
+ (buffer-string)))))
(set-buffer-modified-p nil)
(kill-buffer diary-fancy-buffer)))
(when entries