From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Leaving out non-applicable commands on Mx Date: Fri, 8 Jan 2016 19:09:30 -0800 (PST) Message-ID: <4cc82ad0-5ce9-4aa7-9962-c2b155adb1b9@default> References: <87mvszdp6b.fsf@gnus.org> <8737u9kv6f.fsf@russet.org.uk> <87fuy7hdc6.fsf_-_@wanadoo.es> <87bn8vh8q4.fsf@wanadoo.es> <877fjjh51p.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452308996 17599 80.91.229.3 (9 Jan 2016 03:09:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 03:09:56 +0000 (UTC) To: =?utf-8?B?w5NzY2FyIEZ1ZW50ZXM=?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 09 04:09:44 2016 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 1aHjuR-0003Z5-Jq for ged-emacs-devel@m.gmane.org; Sat, 09 Jan 2016 04:09:43 +0100 Original-Received: from localhost ([::1]:38792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHjuQ-0002o4-TC for ged-emacs-devel@m.gmane.org; Fri, 08 Jan 2016 22:09:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHjuL-0002jC-Px for emacs-devel@gnu.org; Fri, 08 Jan 2016 22:09:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHjuG-0005W5-Ps for emacs-devel@gnu.org; Fri, 08 Jan 2016 22:09:37 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:23579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHjuG-0005VZ-JX for emacs-devel@gnu.org; Fri, 08 Jan 2016 22:09:32 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0939Vfq024809 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 9 Jan 2016 03:09:32 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u0939VcZ004369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 9 Jan 2016 03:09:31 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0939V2I030267; Sat, 9 Jan 2016 03:09:31 GMT In-Reply-To: <877fjjh51p.fsf@wanadoo.es> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:197872 Archived-At: > It is necessary to annotate the functions with the context they are > suppossed to work on. Something like >=20 > (defun foo-something () > "docstring" > (interactive) > (declare this-applies-to-foo-mode) > ...) (put 'foo-something 'applies-to-foo-mode) Or maybe: (put 'foo-something (cl-pushnew 'foo-mode (get 'foo-something 'applicable-modes))) > Doing that for every function is unnecessary work, so a method for > saying "all the functions defined on this .el file apply to foo-mode, > except foo-bar and foo-zoo" is a sensible enhancement. (We also could > exploit the fact that we know wich functions are autoladed. Most > autoloaded functions are context-free, while the non-autoloaded > functions on the same file are context-specific). >=20 > Maintaining all this information on an external resource is > unmanageable, it simply wont work. Why not? > So yes, the Elisp source files need > to be annotated (that's the work I'm volunteering for). If you can annotate them then you can put those annotations on their symbols as a property used by your new library, no? > For reading the annotations (and, possibly, for performance reasons, > applying the filter) modifications are required on some Emacs > infrastructure.=20 Why? What's wrong with `(get SYMBOL 'applies-to-foo-mode)'?