unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Nathan R. DeGruchy" <nathan@degruchy.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: LdBeth <andpuke@foxmail.com>,
	"66395@debbugs.gnu.org" <66395@debbugs.gnu.org>
Subject: bug#66395: 28.2; Todo-mode locks up when trying to edit an entry
Date: Sat, 7 Oct 2023 23:20:51 +0000	[thread overview]
Message-ID: <8734ym6mul.fsf@ndegruchy-wlt> (raw)
In-Reply-To: <877cnyazsd.fsf@gmx.net>

Stephen Berman <stephen.berman@gmx.net> writes:

> On Sat, 7 Oct 2023 19:06:55 +0000 "Nathan R. DeGruchy" <nathan@degruchy.org> wrote:
>
>> I am trying to explore using 'todo-mode' as a todo list and while I can
>> see and create entries in todo-mode using the normal functions, trying
>> to edit an item seems to cause emacs to soft-lock. I can reproduce this
>> in a config-less emacs via `emacs -Q`.
>>
>> Basically, I have a todo-file at $HOME/.config/emacs/todo/tasks.todo,
>> this was created when using `todo-show` initially. The contents are not
>> very complex:
>>
>> (("Emacs" . [1 0 0 0]) ("Home" . [1 0 0 0]))
>> --==-- Emacs
>> [2023-10-07] Learn Todo Mode
>>
>> ==--== DONE
>> --==-- Home
>> [2023-10-07] Get new wiper blades
>>
>> ==--== DONE
>>
>> When on either of the items, if I hit 'e' to edit them, it causes emacs
>> to lock up, specifically around `todo-done-item-p()`. I found this out
>> by enabling `toggle-debug-on-quit`, reproducing the error, and the
>> C-g'ing out of the loop/lockup. I also tried to trace through the
>> todo-edit-item with edebug-defun. Stepping through, it seems to reach
>> the same predicate function and ... stop.
>>
>> I'm not sure where to go from here.
>
> On Sat, 07 Oct 2023 14:37:00 -0500 LdBeth <andpuke@foxmail.com> wrote:
>
>> As we have discussed on IRC, the nonstandard timestamp format is the cause.
>
> Yes.  This is a duplicate of bug#55284.  At the time that bug was
> reported, I didn't have time to try fixing it (being the todo-mode
> maintainer), and later, unfortunately, I forgot about it.  I'll try to
> look into it soon, but, as I noted in that bug thread, I think it's not
> easy to fix.  One issue is that todo-mode basically employs the same
> handling of date formats as diary-lib.el, and the ISO date style causes
> problems there too, see bug#55286.
>
>> The hang is cause by the while loop `todo-item-start' not properly handle fail
>> case, however.
>>
>> This patch would at least fix the hang.
>>
>> ---
>> LdBeth
>>
>> --- todo-mode.el.old	2023-10-07 14:28:59.000000000 -0500
>> +++ todo-mode.el	2023-10-07 14:30:20.000000000 -0500
>> @@ -5242,8 +5242,8 @@
>>  	   ;; Buffer is widened.
>>  	   (looking-at (regexp-quote todo-category-beg)))
>>      (goto-char (line-beginning-position))
>> -    (while (not (looking-at todo-item-start))
>> -      (forward-line -1))
>> +    (while (and (not (looking-at todo-item-start))
>> +                (= (forward-line -1) 0)))
>>      (point)))
>>
>>  (defun todo-item-end ()
>
> Thanks.  Even though this doesn't eliminate other problems with using
> the ISO date style in todo-mode (or in the Emacs Diary), since it does
> prevent the infinite loop here, it may be a good stopgap.
>
> Steve Berman

I guess I could also change back to 'american' or 'european' forms
instead of trying to force ISO8601. I appreciate the work being done.

-- 
Nathan DeGruchy
https://degruchy.org/
nathan@degruchy.org




  reply	other threads:[~2023-10-07 23:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 19:06 bug#66395: 28.2; Todo-mode locks up when trying to edit an entry Nathan R. DeGruchy
2023-10-07 19:25 ` Eli Zaretskii
2023-10-07 19:37 ` LdBeth
2023-10-07 21:27 ` Stephen Berman
2023-10-07 23:20   ` Nathan R. DeGruchy [this message]
2023-11-05 22:00   ` Stephen Berman
2023-11-12 14:10     ` bug#55284: " Stephen Berman

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8734ym6mul.fsf@ndegruchy-wlt \
    --to=nathan@degruchy.org \
    --cc=66395@debbugs.gnu.org \
    --cc=andpuke@foxmail.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs.git

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).