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: Undesired interactive call of major mode command Date: Sat, 22 Nov 2014 15:23:27 +0100 Message-ID: <87lhn3gvq8.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416666264 20467 80.91.229.3 (22 Nov 2014 14:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2014 14:24:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 22 15:24:13 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 1XsBbh-0008Oa-5F for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2014 15:24:13 +0100 Original-Received: from localhost ([::1]:45593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsBbg-0001mi-LT for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2014 09:24:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsBbL-0001mL-7A for emacs-devel@gnu.org; Sat, 22 Nov 2014 09:23:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsBbD-0003SY-Ng for emacs-devel@gnu.org; Sat, 22 Nov 2014 09:23:51 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:40303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsBbD-0003SH-GN for emacs-devel@gnu.org; Sat, 22 Nov 2014 09:23:43 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XsBbC-0008Fz-Dw for emacs-devel@gnu.org; Sat, 22 Nov 2014 15:23:42 +0100 Original-Received: from i59f54e13.versanet.de ([89.245.78.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Nov 2014 15:23:42 +0100 Original-Received: from stephen.berman by i59f54e13.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Nov 2014 15:23:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i59f54e13.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:178009 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. I'm not sure how best to deal with this. Three alternatives have occurred to me. (i) Tell users: "Don't do that." (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). But this has the problem that, as soon as todo-mode is invoked, the current buffer changes to Todo mode; this is because todo-mode is defined with define-derived-mode. (iii) The only way I can see to avoid this is not to use define-derived-mode. Then I could also make todo-mode noninteractive. Of course, this goes against the convention that major modes have a major mode command. But there are precedents, e.g. dired-mode. Is there a best-practice recommendation for this situation, or is there another alternative I've overlooked? I'd be grateful for any advice. Steve Berman