From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How to define a (derived) minor mode inaccessible to the user Date: Sat, 23 Jan 2021 14:08:54 +0100 Message-ID: <87zh0zreah.fsf@web.de> References: <87eeidlfmw.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16727"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 23 14:09:40 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3Ifc-0004CT-Jl for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 14:09:40 +0100 Original-Received: from localhost ([::1]:60892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Ifb-0006fT-KA for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 08:09:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3If7-0006fM-TZ for help-gnu-emacs@gnu.org; Sat, 23 Jan 2021 08:09:09 -0500 Original-Received: from mout.web.de ([212.227.15.14]:58807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3If4-00016Z-DG for help-gnu-emacs@gnu.org; Sat, 23 Jan 2021 08:09:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1611407335; bh=ZIthchLRfOPb9ZWklZ2vTcpwiqBjWgN5nKcpEpRfM20=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=nw2xk3SmvQ13CJ0ds/3GiKId/NWFQTxySyK7UoAdNIHL2msxUKJJVoyPRCcIfIIWd ytAEbd14revVRzzFV+mOYid2r9o/XRGVRHGiYE3xXeh+eNtlYbtbOU1T2CqHl3y23d rb6lFfguY/t8tBgVlHXxsydR9KOSDB2GYiBh9mPA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.218.223.115]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mrfou-1lokM71qWi-00nhdb; Sat, 23 Jan 2021 14:08:55 +0100 In-Reply-To: <87eeidlfmw.fsf@mbork.pl> (Marcin Borkowski's message of "Fri, 22 Jan 2021 06:11:51 +0100") X-Provags-ID: V03:K1:LHn1+fJoH8A/KhKgJvYqg5+Aaakk1y63iiED5LMJkx9VivMo9rj R3D9WT79QVui3rdFgjoHDIVHw+LFAKUvEzC/6V0DZZunOSSzqkpBCHXcQRxqlRCGnaSyV8f zQ8Ap5H6nmSU3HYadJ/FgN5sAtP4YyrZmvMxhY1ftmXokdf2qeEmPvKrtEt++vHbltVs2Pq 9F2kmAfPGBzOaU++GMg+A== X-UI-Out-Filterresults: notjunk:1;V03:K0:hQISqx4Calc=:Y8eI+IvygVWWxCFOVeiuFV oIeIiX4EeeBMwfxxxouR4P2DD96sXXO9wpOiFgb08fot/PYvz0U+5OQYSi5bAaJoqwM1WKafF uFZGheV1aEJ4k/2gyduUWI4TFtx+bMdrYTM8muJNlJN7/Wthb3OmjjIHP3A0bYjR4IANrKfZh 9RcJVbIXRocbpdF78F1Bv4MnpwKMFg8NCUj1c46DBVg4zO/safUdvbI/W5alAXrlAMxp4lQxz wZvUHBJiQm2ALylPOfkS/xbpjtnEQ/jp6N69fExspA+z9iVZhOkHMNEdlQx+4/Mjl8GGSMenf EeAfarLk6z+bp32mzlZJflVAF+cpBbUkdpMFTn1xvV8mIPQFq4bipi6UT3bmwF/xwmUaWBrma FUm+rB3WKoFQiKwDFv3HPZfRxPNAEf7g9iK3rQJ2/W6P7kIyZj7ByAjEhi6lfmxBRK+yepc8W BECd/eNJ3JEqySs9RPaIKl9Y5Es8YGhM5e8emO35X+nUjrnwqM5LJ1SA40zCI69X10veNLR9w SmwgWuLvbaCLGT/cfZ+EDZeF0OXc9F0dpTRBW//w87/eqcK84mP7vcTkgi7ErEWht/oUSysz9 MdBC0HZQS70yXLtelKuwjCDv08GOE7cH4OZqlrpkx3gLOWsce0pKyqxLucwM9ipcIaVmmPmyr quqAu1DYTJNJ0D5nc9hh8xb8dxvczIR8yjbWy94oKoZAMP1GC2urZSHuNh9zEylxitHN/VuGa duF0LvL2koAkA3JbzM+0+sH0LbcGsFgqMHteEuS6gjI6nyhT9pjHUEAiit9788JvG0vz7GSE Received-SPF: pass client-ip=212.227.15.14; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127328 Archived-At: Marcin Borkowski writes: > Hello everyone, > > I'd like to define a special-purpose major mode, derived from > `special-mode', in such a way that the user cannot set it using M-x. > (It is to be called via another command.) I wonder if that feature then does have to be defined as a regular mode at all, or if something else would fit: if there could be some other solution to what you want. Second point: If it's really bad for the user to enable the mode, give it a name like "*-helper-mode" or so, and I guess you could add something like (when (called-interactively-p 'any) (user-error "This mode is for internal use only")) to the mode function's body. Michael.