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: Sat, 22 Nov 2014 11:15:15 -0500 Message-ID: References: <87lhn3gvq8.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416672950 28764 80.91.229.3 (22 Nov 2014 16:15:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2014 16:15:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 22 17:15:43 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 1XsDLa-0006TH-33 for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2014 17:15:42 +0100 Original-Received: from localhost ([::1]:45904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsDLZ-00075o-A6 for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2014 11:15:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsDLN-00075S-DM for emacs-devel@gnu.org; Sat, 22 Nov 2014 11:15:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsDLF-0000g5-UK for emacs-devel@gnu.org; Sat, 22 Nov 2014 11:15:29 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:39870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsDLF-0000fi-QS for emacs-devel@gnu.org; Sat, 22 Nov 2014 11:15:21 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAMGFF7P006677; Sat, 22 Nov 2014 11:15:16 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 96AD743AC; Sat, 22 Nov 2014 11:15:15 -0500 (EST) In-Reply-To: <87lhn3gvq8.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Sat, 22 Nov 2014 15:23:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.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 RV5133=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5133> : inlines <1554> : streams <1346829> : uri <1835707> 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:178022 Archived-At: > Bug#19112 reports an error resulting from typing `M-x todo-mode RET'. > The real issue (at least for me, as the maintainer of Todo mode) is not > the error but that todo-mode, although it is the "major mode command", > is not intended to be invoked interactively. There are several such major-modes. It's OK if doing M-x foo-mode RET doesn't really "do the right thing" in that case, as long as it doesn't burp loudly. > deal with this. Three alternatives have occurred to me. > (i) Tell users: "Don't do that." That's a good first step. > (ii) Add to todo-mode the condition > (called-interactively-p 'any) and if it returns t either show a message > saying how to enter todo mode or simply call the intended (and > documented) Todo mode entry command (todo-show). Better just emit a message. > But this has the problem that, as soon as todo-mode is invoked, the > current buffer changes to Todo mode; Why is it a problem that the current buffer changed to todo-mode? Stefan