Avoid infinite loop in org-agenda-dim-blocked-tasks

* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): When the blocked
task is the last line in agenda buffer and no trailing newline is
present, (move-beginning-of-line 2) would not move the point causing
infinite loop.  Now, such case is handled correctly.
This commit is contained in:
Ihor Radchenko 2021-06-22 20:10:16 +08:00 committed by Bastien
parent 3f5605e66c
commit 6a2c48704b
1 changed files with 3 additions and 1 deletions

View File

@ -4042,7 +4042,9 @@ dimming them."
(overlay-put ov 'face 'org-agenda-dimmed-todo-face))
(when invisible
(org-agenda-filter-hide-line 'todo-blocked)))
(move-beginning-of-line 2))))
(if (= (point-max) (line-end-position))
(goto-char (point-max))
(move-beginning-of-line 2)))))
(when (called-interactively-p 'interactive)
(message "Dim or hide blocked tasks...done")))