I have encountered several bugs in todo-mode when creating and editing todo items. I have fixes for them and since I'm the todo-mode maintainer I intend to push them to the Savannah repo when I get a bug number and clearance for which branch to push to. The bugs are long-standing, at least since Emacs 28 and probably earlier. The fixes touch no code outside of todo-mode.el and seem low-risk; in my testing they work as expected. I've attached a diff against emacs-29 below (the todo-mode.el files in current emacs-29 and master are identical). One of the bugs is that, when editing an item's date-time header string, which uses replace-match, the match data can get clobbered, e.g. by using dabbrev-expand while editing. (In bug#42976 I had fixed the same bug just for editing a done item comment, but at the time didn't notice that it can also happen when editing the item header string.) The other bugs all have to do with the fact that you can switch from the buffer in which an item is entered or edited (mainly the minibuffer, but for editing also a special indirect buffer of the todo-mode buffer) to the todo-mode buffer and there, move point to another item (with `n' or `p') or to another todo category in the todo file (with `f' or `b'). This possibility is useful in order, for example, to copy text from another item to use in the item you are creating or editing (you could, of course, do that before invoking the item insertion or editing command, then there's no problem). But when you move point in this way and then switch back to the editing buffer without moving point back to where it was when you invoked the item insertion or editing command, this can cause problems ranging from relatively harmless though annoying, such as misplacement of the inserted or edited item (you can always relocate the item later in todo-mode, when you notice the misplacement), to serious, such as unintentionally replacing data and even corruption of the todo-mode file format. The latter can happen in three ways: (1) Type `ee' on an item in todo-mode to edit it in the minibuffer and before typing RET to complete the edit, switch back to the todo-mode buffer, type `f' to display the next category in the todo file, then switch back to the minibuffer and complete the edit. The edited item does not replace the item on which `ee' was invoked but instead is entered into the category moved to as the first item, replacing the item that was there before. (2) In a todo category that has done items, type `ih' ("insert here") to insert a new item into the todo buffer on the line at point, and before completing the item (by typing RET in the minibuffer), switch to the todo-mode buffer, display the done items (`v'), move point (e.g. with `n') to one of the done items, then switch back to the minibuffer and complete with RET. The item will be inserted in the done items section but it doesn't have the form of a done item, so you can't repair the mistake using todo-mode commands, and also the calculated category counts of todo and done items now conflict with the resulting distribution of the items in the category. (3) The todo-mode buffer is read-only most of the time and is supposed to be changed only by using todo-mode commands, which temporarily make it writeable. However, the item editing commands `ee' (for item text) and `ec' (for done item comments) currently already make the todo-mode buffer writeable when the minibuffer is being used for editing, and if you then switch to the todo-mode buffer, you can corrupt it by inserting newlines or yanking arbitrary text (but self-inserting keys remain disabled in todo-mode). In GNU Emacs 29.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.6) of 2023-05-27 built on strobelfssd Repository revision: 5e7c826bfa5cb7459f5b162b498af1c57c4578e6 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Linux From Scratch r11.3-100-systemd Configured using: 'configure -C --with-xwidgets 'CFLAGS=-Og -g3'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB