From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Poll: new keybinding for org-insert-structure-template? Date: Thu, 14 Dec 2017 13:19:33 -0800 Message-ID: <87vah9ovmi.fsf@ericabrahamsen.net> References: <87r2s3ctxh.fsf@ericabrahamsen.net> <87d13m3jt2.fsf@gmx.us> <87efo2wf0s.fsf@ericabrahamsen.net> <87y3m8s7ym.fsf@gmx.us> <87fu8gwfbr.fsf@nicolasgoaziou.fr> <87k1xs2h0h.fsf@gmx.us> <87h8svpt1r.fsf@ericabrahamsen.net> <87o9n11xxi.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePav7-0004Pa-Of for emacs-orgmode@gnu.org; Thu, 14 Dec 2017 16:19:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePav3-0005Il-Lq for emacs-orgmode@gnu.org; Thu, 14 Dec 2017 16:19:57 -0500 Received: from [195.159.176.226] (port=41044 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePav3-0005FY-EH for emacs-orgmode@gnu.org; Thu, 14 Dec 2017 16:19:53 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ePaur-0005pR-8v for emacs-orgmode@gnu.org; Thu, 14 Dec 2017 22:19:41 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Rasmus writes: > Eric Abrahamsen writes: > >> Rasmus writes: >> >>> Nicolas Goaziou writes: >>> >>>> Hello, >>>> >>>> Rasmus writes: >>>> >>>>> Nicolas, are there any public interfaces to make ox export like >>>>> interfaces? >>>> >>>> No, there isn't. However, Org provides `org-mks'. >>> >>> Good point. It isn’t quite as nice as the export dispatcher. Let’s wait >>> and see what Eric prefers. >> >> I don't have to own this! I don't have a strong feeling about it, and >> left to my own devices would just keep the single-character keys. > > It’s pretty nice and quick with only one character. > >> But I see why people would want more/longer keys, and better >> discoverability. > > Discoverability is nice to have, but it’s a secondary issue. > > >> The main desires are: >> >> 1. String keys of arbitrary length. >> 2. Discoverability: either a window of choices pops up automatically, or >> you can do it with TAB, etc. >> 3. Ideally, you don't have to hit an extra key to finish. >> >> Given that, it seems to me that `org-mks' is just fine. It doesn't do as >> much as the export dispatcher, but I don't see that it needs to. > > It doesn’t seem to offer a way to distinguish between a single "a" and > "ab". > > (org-mks '(("a" "a.. templates") > ("a" "export ascii" "") > ("ab" "abstract" "") > ("l" "latex" "")) > "Select a template" > "Template key: " > '(("q" "Abort"))) > > Perhaps the best way would be to automatically reserve upper case letters > for blocks with keys longer than one character, although that seems a bit > arbitrary. > > (org-mks '(("A" "a.. templates") > ("a" "export ascii" "") > ("Ab" "abstract" "") > ("l" "latex" "")) > "Select a template" > "Template key: " > '(("q" "Abort"))) Right, you can't have a string act as both a "sub-menu dispatcher" and a menu item at the same time. I don't see that it's a big deal, though. For the default value, at least, it's pretty clear how we would arrange the values: SRC and EXPORT need sub-menus, and everything else doesn't. Ie: '(("s" "Source Code") ("se" "Elisp" "src elisp") ("sp" "Python" "src python") ...etc ("e" "Export Block") ("eh" "HTML" "export html") ("el" "LaTeX" "export latex") ...etc ("v" "Verbatim" "verbatim") ("q" "Quote" "quote") ("E" "Example" "example") ...etc ) That's not so bad, is it? Eric