From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Poll: new keybinding for org-insert-structure-template? Date: Thu, 21 Dec 2017 10:16:48 +0100 Message-ID: <87y3lwh24f.fsf@gmx.us> 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> <87vah9ovmi.fsf@ericabrahamsen.net> <87po7gxmka.fsf@gmx.us> <87k1xoxhbl.fsf@gmx.us> <877etnq48m.fsf@ericabrahamsen.net> <877etjlwsw.fsf@ericabrahamsen.net> <87mv2ft081.fsf@gmx.us> <87wp1h4ars.fsf@ericabrahamsen.net> <87k1xh4a7v.fsf@ericabrahamsen.net> 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]:47493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRwyP-0004pt-I7 for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 04:17:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRwyK-0005Yf-MK for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 04:17:05 -0500 Received: from [195.159.176.226] (port=45522 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRwyK-0005Wf-Fo for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 04:17:00 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eRwwG-0006s7-MM for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 10:14:52 +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 Eric Abrahamsen writes: > Eric Abrahamsen writes: > >> Rasmus writes: >> >>> Eric Abrahamsen writes: >>> >>>> Eric Abrahamsen writes: >>>> >>>>> Rasmus writes: >>>>> >>>>>> Kaushal Modi writes: >>>>>> >>>>>>> On Fri, Dec 15, 2017 at 6:23 AM Rasmus wrote: >>>>>>> >>>>>>>> The only way it’s "bad" is in the sense it limits the flexibility of >>>>>>>> snippets, like ">>>>>>> I can no longer have ">>>> >>>>> I don't see any way around that. Any system that allows string keys of >>>>> arbitrary length is going to run into that problem. >>>> >>>> One possible fix, a bit arbitrary: in the default value, provide >>>> as an artificial "stop key" in the sub-menus. So "s" starts the "source >>>> code" sub-menu, and a after that simply inserts "#+begin_src", and >>>> leaves point after that. >>> >>> Yeah, I tried to suggest that earlier (unless I didn’t say it), but I >>> might not have expressed the idea in an understandable manner :) >> >> Maybe I missed it! >> >>> I think that would be the best approach, but there’s no infrastructure >>> that I know of that does this ATM (but I haven’t had a lot of time lately, >>> so my knowledge on this issue is limited!). >> >> Can't we do this with tempo? It will have to be "handmade", not >> automatic, but: >> >> '(("s" "Source Code") >> ("se" "Elisp" "src elisp") >> ("sp" "Python" "src python") >> ("TAB" "Empty" "src ") >> ...etc >> ("e" "Export Block") >> ("eh" "HTML" "export html") >> ("el" "LaTeX" "export latex") >> ("TAB" "Empty" "export ") >> ...etc >> ("v" "Verbatim" "verbatim") >> ("q" "Quote" "quote") >> ("E" "Example" "example") >> ...etc >> ) > > Ahem, should have actually tried that first: > > (org-mks > '(("s" "Source Code") > ("se" "Elisp" "src elisp") > ("sp" "Python" "src python") > ("s\t" "Empty" "src ") > ("e" "Export Block") > ("eh" "HTML" "export html") > ("el" "LaTeX" "export latex") > ("s\t" "Empty" "export ") > ("v" "Verbatim" "verbatim") > ("q" "Quote" "quote") > ("E" "Example" "example")) > "Insert Block" "Block: ") > > It's a bit ugly, but it works... Great find; I didn’t realize we can use tab here! I’ll try to build the mks list automatically. It will be a bit annoying, as we’ll have to figure out valid keys for things like "prop". Rasmus -- Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio