summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-08-21 07:09:20 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-08-21 07:09:20 +0200
commit96bacc020bef95861543b34985c2cc1190fb918c (patch)
tree9ed031c9c190a44b11b7a42b9f661b09fbaea96a
parente50657d7cb33b3778a74b6864c1a4ebe8fc55d4d (diff)
downloadorg-mode-96bacc020bef95861543b34985c2cc1190fb918c.tar.gz
Fix adding context lines in agenda
* lisp/org-agenda.el (org-agenda-add-entry-text): Make sure we move forward even if there is no text to be added. Adding entry text with org-agenda-add-entry-text-maxlines greater than 0 could result in an infinite loop.
-rw-r--r--lisp/org-agenda.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 117b0bb..4bf38c6 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2627,7 +2627,9 @@ Drawers will be excluded, also the line with scheduling/deadline info."
(setq txt (org-agenda-get-some-entry-text
m org-agenda-add-entry-text-maxlines " > "))
(end-of-line 1)
- (if (string-match "\\S-" txt) (insert "\n" txt)))))))
+ (if (string-match "\\S-" txt)
+ (insert "\n" txt)
+ (or (eobp (forward-char 1)))))))))
(defun org-agenda-get-some-entry-text (marker n-lines &optional indent
&rest keep)