From 96bacc020bef95861543b34985c2cc1190fb918c Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sat, 21 Aug 2010 07:09:20 +0200 Subject: [PATCH] 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. --- lisp/org-agenda.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 117b0bbf1..4bf38c6c2 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)