From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Ordering of command completions Date: Sun, 07 Dec 2014 22:47:48 +0100 Message-ID: References: <87d27vicq7.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417988913 743 80.91.229.3 (7 Dec 2014 21:48:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2014 21:48:33 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 07 22:48:27 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 1Xxjgn-0001or-7Q for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2014 22:48:25 +0100 Original-Received: from localhost ([::1]:59283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxjgm-0001bi-TJ for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2014 16:48:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxjgd-0001bS-PH for emacs-devel@gnu.org; Sun, 07 Dec 2014 16:48:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxjgX-0006nM-Fn for emacs-devel@gnu.org; Sun, 07 Dec 2014 16:48:15 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:50398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxjgX-0006ma-93 for emacs-devel@gnu.org; Sun, 07 Dec 2014 16:48:09 -0500 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XxjgD-0008Ta-4k for emacs-devel@gnu.org; Sun, 07 Dec 2014 22:47:49 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEV4dnxzcncRDxA+PD9o Z2uAfoKMipEvLS9SUlXAwMcGR+RzAAACQ0lEQVQ4jW3TMY/TMBQHcEc06G6zpRR1Djodu+9I16iW CFsqsBFbkc4W2dAVZEaqdDAbEiJSvi3/ZydtD+Ghw/v1Pb9nO0wGJbTrxrQGR0tjsafQRbDGRqjz BAP9TGAu4VwL1QDHemncv+AIFCdwu6Iwp3gCkRO0RdOvL2CNTZbdONitCtJ/p6Ah2MsQ1BLFbdaE 6rF8HecwBEh5C9gtmh7wMs3nmAcc0e3QFqhUluWSxiagWtRnq0JFcI94rg3zXkoCt1VUqSy/5Yyx CdYRmt4TfGEZT7CX8iNKESBe/riEn4BFE/cuOZ9LQe7OGa8YE5xTVzEFg0xwyATjuYlAfXXjpwhf WSYE0xNg+qOzBbq6Q32OMVzHblMtHFjRhAOLC5XGMwSllEA0iwkDq9Im64B7AeiW4s5t2KKaUwhy TUfubC9Zhj1nqAmscw+9BAjVVPGIQyxlnF1JLMxZKNwp3YqqOTKKECK0GWBe+BMyE+iYclohTIL+ sMt5NSewWlNKXdRCzNITOIsUiooEJAmiCDzrX1pvMd/qKWijdyK2MWcYa1vcGbpjc3xql96XwGRt gnABVCrX+j/AeIaGOcchFFQrAh002/h9qLne4lDQNO3tI7wpb/fro2AtzkGoFw9SVh5vS7d4NT5+ pHRH2fPxHe6OMj4DKEUROIz6m4BuZoLTZ50AV/9hguX0VUvvqwjuGUE3rMI1xTfYO2Vgy4Ye9tXj zTj+6aVPpUz6sNtuvCrvF03o44NiMU5fFJ7l+4MoaHCSv4DicIqoTqaTAAAAAElFTkSuQmCC X-Now-Playing: SS Motsol's _Parallel Pleasures_: "(untitled)" X-Hashcash: 1:23:141207:emacs-devel@gnu.org::MxZ2yf/zhz9hVE0T:000000000000000000000000000000000000000000J4Vu In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 07 Dec 2014 22:33:54 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-MailScanner-ID: 1XxjgD-0008Ta-4k MailScanner-NULL-Check: 1418593670.64548@BdAmA+pyBqCkOrTT8xlRgw 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:179313 Archived-At: I've done ten minutes of exploratory hacking to see whether it would be a lot of work to get this to work. The `declare' solution turns out to be rather trivial, apparently. The patch below is all that's needed to add a new `declare' form. And then, after marking some stuff up, we just have to make the `M-x' completion function examine the `mode' `function-get' value, and compare it to the current modes in effect. So if we decide to do something like this, getting the framework in place is very little work. Annotating all of Emacs is a bit larger (ahem), but it can be done gradually, and `M-x TAB' would work a bit better each week... diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 8bf63ea..098f1c4 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -105,6 +105,11 @@ The return value of this function is not used." ''pure (list 'quote val))) "If non-nil, the compiler can replace calls with their return value. This may shift errors from run-time to compile-time.") + (list 'mode + #'(lambda (f _args val) + (list 'function-put (list 'quote f) + ''mode (list 'quote val))) + "If non-nil, this command belongs in a specific mode, or a list of modes.") (list 'side-effect-free #'(lambda (f _args val) (list 'function-put (list 'quote f) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no