emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] function for inserting a block


From: Bastien Guerry
Subject: Re: [O] function for inserting a block
Date: Wed, 08 Nov 2017 15:34:11 +0100
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/27.0 (gnu/linux)

Hi Nicolas,

Nicolas Goaziou <address@hidden> writes:

> Bastien <address@hidden> writes:
>
>> is there a simple mechanism in Emacs core to restore the same
>> functionnality?
>
> Of course, it is called Abbrev mode: (info "(emacs)Abbrev
> Concepts").

Abbrev only expands on words constituents, so "<s" would not work.

> You may also use (info "(autotype)Using Skeletons") for more advanced
> uses.

I see.  So combining the two, we would have something like this:

(define-skeleton org-skeleton-src-block
     "" nil
     >
     "#+begin_src" \n
     _ \n
     "#+end_src")

(define-abbrev org-mode-abbrev-table "<s"
      "" 'org-skeleton-src-block)

... modulo the restriction on "<s" mentioned above.

I need to think about this and Kaushal proposal to see if we can
come up with a simple and backward-compatible solution.

Already thanks for the pointers.

-- 
 Bastien



reply via email to

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