emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about handling file deletion


From: Stephen Berman
Subject: Re: Question about handling file deletion
Date: Fri, 28 Jun 2013 10:36:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

On Wed, 26 Jun 2013 21:42:19 -0400 Stefan Monnier <address@hidden> wrote:

>> But while the user presumably knows the file is missing, Todo mode
>> doesn't, and that can lead to errors, especially if a live buffer is
>> still holding the content of the deleted file and the user calls
>> a Todo command to manipulate the buffer.
>
> What kind of errors?

E.g. bug#14688.  If you have debug-on-error enabled, you get the two
backtraces Leo reported (wrong-type-argument due to (find-file-noselect
nil), followed by file-error "Removing old name" "no such file or
directory" due to calling delete-file on the file that was already
deleted).  But if debug-on-error is disabled, you just get "Removing old
name: no such file or directory, /data/steve/.emacs.d/todo/Todo.todo" in
the echo area and above it a buffer in Todo mode whose name is the todo
file you just created.  If you try to add a category, you get
"find-file-noselect: Wrong type argument: stringp, nil".  If you
mistakenly think there is a category and try to navigate with `f' or
`b', you get "todo-forward-category: Arithmetic error"; if you try to
insert an item with e.g. `i i' you get prompted but after typing the
item text and hitting RET, you get "todo-basic-insert-item: Args out of
range: 1, 2".  Similar errors and other odd behavior can occur if you
leave the Todo mode buffer live after deleting the file, and can arise
later, after adding more todo files and using other commands.  So I
guess I have to bite the bullet and make Todo mode catch these errors.

Steve Berman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]