[Top][All Lists]

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

Re: [O] function for inserting a block

From: address@hidden
Subject: Re: [O] function for inserting a block
Date: Wed, 15 Nov 2017 21:13:40 +0800

I think the function `org-insert-structure-template' also should respect the `org-babel-uppercase-example-markers'.
Besides, your new diff does not have a condition on `org-babel-uppercase-example-markers', you just use `upcase-initials` by default. Then the new `tempo` snippets will be uppercase, but the `org-insert-structure-template` inserted templates will be different.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 5:36 AM, Eric Abrahamsen <address@hidden> wrote:
"Thomas S. Dye" <address@hidden> writes:

> Eric Abrahamsen writes:
>> Rasmus <address@hidden> writes:
>>> Hi Eric,
>>> Eric Abrahamsen <address@hidden> writes:
>>>>> Also, Eric, it seems that org-structure-template-alist only supports a
>>>>> single letter for short-hands (the car of an entry in
>>>>> org-structure-template-alist is a char).  I used to have blocks like "<ab"
>>>>> expanding to an "abstract" special-block, which I guess isn’t possible
>>>>> anymore?
>>>> I hadn't thought of that. Really, all I ever wanted was to wrap things
>>>> in blocks...
>>>> I don't see any reason why org-structure-template-alist couldn't go back
>>>> to using string keys. Then we could use read-string, and wouldn't have
>>>> to have special <TAB> behavior -- a string that didn't exist in the
>>>> alist could just be used literally to make a block.
>>> I’d prefer that.  For some special blocks, a few characters might makes it
>>> more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.
>> Here's the simplest solution.
>> There still remains the fact that `org-structure-template-alist' has
>> changed format, and `org-try-structure-completion' no longer exists.
>> That may still annoy some people who were using the internals of the
>> process, but...
> Would something like this work?
> (defun org-try-structure-completion ()
>   (tempo-complete-tag))

Here's the newest version!

It incorporates Rasmus' org-tempo.el file, with modifications, and
Thomas' suggestion to re-instate `org-try-structure-completion', and,
erm, stardiviner's request to honor

Remaining issues:

1. The "org-include" tempo template doesn't work, for reasons I don't
   understand (I've never used tempo before). Nothing happens when I hit
2. Now it seems like there should be completion when prompting for a
   string key. Feature creep! But likely worthwhile feature creep.
3. I've rather rashly renamed the relevant customization options
   `org-structure-block-alist' (for blocks added via
   `org-insert-structure-template') and `org-structure-keyword-alist'
   (for keywords insertable via the tempo system). Perhaps this was a
   bad idea. If it's not a bad idea, maybe
   `org-insert-structure-template' should be renamed `org-insert-block'
   or something like that.
3. Docs need to be updated.

Comments welcome!


reply via email to

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