From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Undesired interactive call of major mode command Date: Sun, 23 Nov 2014 22:56:16 -0500 Message-ID: References: <87lhn3gvq8.fsf@rosalinde.fritz.box> <87ppceop33.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416801408 26353 80.91.229.3 (24 Nov 2014 03:56:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Nov 2014 03:56:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 24 04:56:41 2014 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 1XsklU-0001kO-HU for ged-emacs-devel@m.gmane.org; Mon, 24 Nov 2014 04:56:40 +0100 Original-Received: from localhost ([::1]:50729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsklU-00089U-7V for ged-emacs-devel@m.gmane.org; Sun, 23 Nov 2014 22:56:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsklJ-00080x-EJ for emacs-devel@gnu.org; Sun, 23 Nov 2014 22:56:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsklB-00041h-UY for emacs-devel@gnu.org; Sun, 23 Nov 2014 22:56:29 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsklB-00041T-R4 for emacs-devel@gnu.org; Sun, 23 Nov 2014 22:56:21 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAO3uGsp008177; Sun, 23 Nov 2014 22:56:16 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 45BEEAE0A5; Sun, 23 Nov 2014 22:56:16 -0500 (EST) In-Reply-To: <87ppceop33.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Sat, 22 Nov 2014 23:19:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5134=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5134> : inlines <1555> : streams <1347317> : uri <1835821> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:178143 Archived-At: > - If you call todo-mode in an empty non-file buffer, you get the error > (wrong-type-argument arrayp nil) because todo-mode calls > (file-truename (buffer-file-name)) (this was the error of bug#19112). Signaling such an error is indeed a bug here. Better emit a message. > - If you call todo-mode in a non-empty buffer (whether or not it is > visiting a file (except a Todo mode file, of course), you get the > Todo mode error "Invalid or missing todo-categories sexp", because the > buffer text does not conform to the Todo mode file format. That's probably OK. > - If you call todo-mode in a buffer visiting an empty file, you get no > error, but since the buffer is then in Todo mode, if you invoke any > Todo mode command you'll get an error, again because of the invalid > file format for Todo mode. Of course, an alternative might be to move some of the code outside of todo-mode to some other function. Stefan