emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Poll: new keybinding for org-insert-structure-template?


From: Eric Abrahamsen
Subject: Re: [O] Poll: new keybinding for org-insert-structure-template?
Date: Thu, 14 Dec 2017 13:19:33 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Rasmus <address@hidden> writes:

> Eric Abrahamsen <address@hidden> writes:
>
>> Rasmus <address@hidden> writes:
>>
>>> Nicolas Goaziou <address@hidden> writes:
>>>
>>>> Hello,
>>>>
>>>> Rasmus <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]