This report describes and provides patches for four different bugs in todo-mode.el. Three of the bugs can result in todo-mode file format corruption, and the fourth is a documentation bug, so I think the fixes should all be installed in the release branch, and I'm asking for permission to do that. As with my previous todo-mode bugfix, which also went into the release branch (bug#63811), the patches touch only todo-mode.el and with them all todo-mode unit tests pass. The first bug is further instances of the bug in bug#63811 that made the todo-mode buffer manually editable and hence susceptible to file format corruption. In that bug report I only looked at item editing, but now I've reviewed all cases in todo-mode.el where buffer-read-only is set to nil and found that a number of them could give rise to the same issue. I have fixed these in the same way, by restricting the the scope of nil buffer-read-only. The second bug I encountered while testing one case of the buffer-read-only bugs: currently, when moving a block of done items to another category that does not already have done items, only the first moved done item gets relocated to the target category's done section; the remaining moved done items wrongly end up in the todo section of the following category in the file, and since these items are tagged as done, this breaks the format of non-done todo items. The patch makes sure the moved items are correctly relocated. The third bug I discovered after reading the report of bug#54612, which is about unintendend truncation of sexps resulting from the user globally setting print-length or print-level to a sufficiently small value. The internal file format of todo-mode makes crucial use of specially formatted sexps that are part of the file contents, and if these get truncated, that can break the required format and cause errors when using todo-mode commands. This is prevented by binding print-{length,level} to nil, as in the fix for bug#54612. The fourth bug is a doc bug: the doc string of one todo-mode user option refers to use of a todo-mode insertion command argument that, quite embarrassingly, is a remnant of an earlier state of my revision of todo-mode.el and was actually eliminated before the revision was merged into the Emacs trunk ten years ago. The patch replaces this obsolete doc string with a description of the current behavior (which fortunately is already correctly documented in the Todo mode info manual). Since these four bugs are conceptually independent of each other, I would like to install the fixes in separate commits; is that all right? 2023-06-26 Stephen Berman Avoid making todo mode buffers manually editable * todo-mode.el (todo-edit-item--header, todo-set-item-priority) (todo-move-item, todo-item-undone, todo-archive-done-item) (todo-set-category-number): Restrict the scope of nil buffer-read-only to the function calls that change buffer text, thereby preventing todo mode buffers from becoming manually editable and hence possibly corrupted when the minibuffer is in use.