From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: Poll: new keybinding for org-insert-structure-template?
Date: Thu, 21 Dec 2017 10:16:48 +0100 [thread overview]
Message-ID: <87y3lwh24f.fsf@gmx.us> (raw)
In-Reply-To: 87k1xh4a7v.fsf@ericabrahamsen.net
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Rasmus <rasmus@gmx.us> writes:
>>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>
>>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>>
>>>>> Rasmus <rasmus@gmx.us> writes:
>>>>>
>>>>>> Kaushal Modi <kaushal.modi@gmail.com> writes:
>>>>>>
>>>>>>> On Fri, Dec 15, 2017 at 6:23 AM Rasmus <rasmus@gmx.us> wrote:
>>>>>>>
>>>>>>>> The only way it’s "bad" is in the sense it limits the flexibility of
>>>>>>>> snippets, like "<s". As you point out, if I add "<sr" as an "src R" block
>>>>>>>> I can no longer have "<s" as plain "src" block.
>>>>>
>>>>> 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 <TAB>
>>>> as an artificial "stop key" in the sub-menus. So "s" starts the "source
>>>> code" sub-menu, and a <TAB> 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
prev parent reply other threads:[~2017-12-21 9:17 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-10 0:23 Poll: new keybinding for org-insert-structure-template? Eric Abrahamsen
2017-12-10 11:26 ` Rasmus
2017-12-10 19:37 ` Eric Abrahamsen
2017-12-12 7:48 ` Rasmus
2017-12-12 7:55 ` Nicolas Goaziou
2017-12-12 13:49 ` Rasmus
2017-12-12 14:02 ` Key binding popup interface (Was: Re: Poll: new keybinding for org-insert-structure-template on org mode list) Kaushal Modi
2017-12-12 18:45 ` Key binding popup interface Eric S Fraga
2017-12-12 18:56 ` Kaushal Modi
2017-12-12 19:53 ` Alan E. Davis
2017-12-12 20:20 ` Eric Abrahamsen
2017-12-12 20:33 ` Kaushal Modi
2017-12-12 20:44 ` Eric Abrahamsen
2017-12-12 20:56 ` Kaushal Modi
2017-12-12 21:01 ` Stefan Monnier
2017-12-12 21:19 ` Kaushal Modi
2017-12-12 21:48 ` Stefan Monnier
2017-12-13 15:38 ` Kaushal Modi
2017-12-13 16:18 ` Stefan Monnier
2017-12-12 23:51 ` Robert Weiner
2017-12-13 15:40 ` Kaushal Modi
2017-12-13 16:25 ` Robert Weiner
2017-12-13 6:52 ` John Wiegley
2017-12-13 15:43 ` Kaushal Modi
2017-12-13 0:45 ` Poll: new keybinding for org-insert-structure-template? Eric Abrahamsen
2017-12-14 9:06 ` Rasmus
2017-12-14 21:19 ` Eric Abrahamsen
2017-12-15 11:22 ` Rasmus
2017-12-15 12:59 ` Kaushal Modi
2017-12-15 13:15 ` Rasmus
2017-12-15 17:40 ` Eric Abrahamsen
2017-12-18 18:23 ` Eric Abrahamsen
2017-12-19 11:40 ` Rasmus
2017-12-20 16:36 ` Eric Abrahamsen
2017-12-20 16:48 ` Eric Abrahamsen
2017-12-21 9:16 ` Rasmus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3lwh24f.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).