From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Limit what M-x TAB lists? Date: Thu, 26 Dec 2013 16:24:23 +0100 Message-ID: <87wqirhbyw.fsf@building.gnus.org> References: <87bo03itkn.fsf@building.gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388071844 31320 80.91.229.3 (26 Dec 2013 15:30:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Dec 2013 15:30:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 26 16:30:51 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 1VwCte-0006Pb-LT for ged-emacs-devel@m.gmane.org; Thu, 26 Dec 2013 16:30:50 +0100 Original-Received: from localhost ([::1]:46007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwCte-00085w-83 for ged-emacs-devel@m.gmane.org; Thu, 26 Dec 2013 10:30:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwCtW-0007oR-K4 for emacs-devel@gnu.org; Thu, 26 Dec 2013 10:30:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwCtR-0007KN-9y for emacs-devel@gnu.org; Thu, 26 Dec 2013 10:30:42 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:42811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwCtQ-0007KE-LO for emacs-devel@gnu.org; Thu, 26 Dec 2013 10:30:37 -0500 Original-Received: from 2.148.235.122.tmi.telenormobil.no ([2.148.235.122] helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VwCtB-0002Rb-Qu; Thu, 26 Dec 2013 16:30:22 +0100 In-Reply-To: (Stefan Monnier's message of "Thu, 26 Dec 2013 09:58:25 -0500") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1VwCtB-0002Rb-Qu MailScanner-NULL-Check: 1388676622.05892@KYTVLWyaFms4WlAijsbO0g X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:166893 Archived-At: Stefan Monnier writes: >> 2) New form like (command-interactive 'vc-mode "p") > > More generally, move the "sanity checks" performed at the beginning of > some commands to a special place so they can be run without actually > calling the function. IOW add a "callable" predicate alongside the > interactive-spec that M-x could then use to filter out > inapplicable commands. Hm, yes, that would be nice. Then multi-mode commands like `quit-window' could have a complex predicate that does the right thing, while very mode-specific commands like `gnus-summary-catchup-to-here' could have a simple (mode-only) predicate. If these predicates become very complex, then `M-x fooTAB' would become exceedingly slow, though... > Of course, this will require many changes in many packages before it > becomes really useful. Yes, but modes could be converted gradually, and things would get better and better as time passes... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/