From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Question about handling file deletion Date: Fri, 28 Jun 2013 10:36:56 +0200 Message-ID: <87d2r6zl5j.fsf@rosalinde.fritz.box> References: <87zjud5aej.fsf@rosalinde.fritz.box> <87mwqc5wja.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372408631 9660 80.91.229.3 (28 Jun 2013 08:37:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 08:37:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 28 10:37:11 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsUB3-0002Dr-I0 for ged-emacs-devel@m.gmane.org; Fri, 28 Jun 2013 10:37:09 +0200 Original-Received: from localhost ([::1]:59584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsUB3-0006zx-44 for ged-emacs-devel@m.gmane.org; Fri, 28 Jun 2013 04:37:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsUAx-0006zh-0i for emacs-devel@gnu.org; Fri, 28 Jun 2013 04:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsUAu-0002rG-CO for emacs-devel@gnu.org; Fri, 28 Jun 2013 04:37:02 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:60665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsUAu-0002r3-30 for emacs-devel@gnu.org; Fri, 28 Jun 2013 04:37:00 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.20]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LfDpm-1UUT5O12JU-00okuO for ; Fri, 28 Jun 2013 10:36:58 +0200 Original-Received: (qmail invoked by alias); 28 Jun 2013 08:36:57 -0000 Original-Received: from i59F56E38.versanet.de (EHLO rosalinde.fritz.box) [89.245.110.56] by mail.gmx.net (mp020) with SMTP; 28 Jun 2013 10:36:57 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19h41hA3Gdhc1kkGq0CqQ9sWBPMLJ6w9Yu8+q7jRc JT0NfzaKEIweFz User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161177 Archived-At: On Wed, 26 Jun 2013 21:42:19 -0400 Stefan Monnier 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