emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "Tory S. Anderson" <webdev@toryanderson.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: clock-in from org-agenda freezes thread when enforce + todo keywords [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]
Date: Tue, 22 Jun 2021 20:14:53 +0800	[thread overview]
Message-ID: <877dim3xky.fsf@localhost> (raw)
In-Reply-To: <87h7i52tca.fsf@byu.edu>

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

webdev@toryanderson.com (Tory S. Anderson) writes:
> Steps to reproduce:
> 1. load emacs with the use-package declaration below
> 2. visit =M-x org-agenda<RET>a3. Clock in to the "Parent" item on the agenda by highlighting it and doing =C-c C-x <TAB>   -- thread will freeze indefinitely, although in toy example you can break free with C-g   


The patch is attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Avoid-infinite-loop-in-org-agenda-dim-blocked-tasks.patch --]
[-- Type: text/x-diff, Size: 1265 bytes --]

From 5c4a699e5a8d9ce6045d0ce710dcf14b9a92d2d8 Mon Sep 17 00:00:00 2001
Message-Id: <5c4a699e5a8d9ce6045d0ce710dcf14b9a92d2d8.1624364038.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Tue, 22 Jun 2021 20:10:16 +0800
Subject: [PATCH] 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.
 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 44acd035a..b5fc0179a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4107,7 +4107,9 @@ (defun org-agenda-dim-blocked-tasks (&optional _invisible)
 	    (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")))

  reply	other threads:[~2021-06-22 12:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 23:27 Bug: clock-in from org-agenda freezes thread when enforce + todo keywords [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)] Tory S. Anderson
2021-06-22 12:14 ` Ihor Radchenko [this message]
2021-07-01 16:26   ` Timothy
2021-07-02 14:14     ` Ihor Radchenko
2021-09-25 15:17   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877dim3xky.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=webdev@toryanderson.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).