emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* add blocks to org-structure-template-alist
@ 2018-04-27 22:24 Charles Millar
  2018-04-27 23:00 ` Nicolas Goaziou
  2018-04-27 23:09 ` Bastien
  0 siblings, 2 replies; 11+ messages in thread
From: Charles Millar @ 2018-04-27 22:24 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Hi,

in my .emacs I have a couple of (add-to-list 
'org-structure-template-alist) blocks of my own, for example

#+begin_src

(add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? 
:type \n#+end_src" ""))

#+end_src

which I used until a few months ago.

Is this correct of has the format changed?

Charlie Millar


[-- Attachment #2: Type: text/html, Size: 1092 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 22:24 add blocks to org-structure-template-alist Charles Millar
@ 2018-04-27 23:00 ` Nicolas Goaziou
  2018-04-27 23:12   ` Bastien
  2018-04-27 23:09 ` Bastien
  1 sibling, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2018-04-27 23:00 UTC (permalink / raw)
  To: Charles Millar; +Cc: emacs-orgmode

Hello,

Charles Millar <millarc@verizon.net> writes:

> Hi,
>
> in my .emacs I have a couple of (add-to-list 
> 'org-structure-template-alist) blocks of my own, for example
>
> #+begin_src
>
> (add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? 
> :type \n#+end_src" ""))
>
> #+end_src
>
> which I used until a few months ago.
>
> Is this correct of has the format changed?

In master branch, the format has changed. You may want to look at the
variable docstring.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 22:24 add blocks to org-structure-template-alist Charles Millar
  2018-04-27 23:00 ` Nicolas Goaziou
@ 2018-04-27 23:09 ` Bastien
  2018-04-28  0:43   ` Charles Millar
  1 sibling, 1 reply; 11+ messages in thread
From: Bastien @ 2018-04-27 23:09 UTC (permalink / raw)
  To: Charles Millar; +Cc: emacs-orgmode

Hi Charles,

Charles Millar <millarc@verizon.net> writes:

> Is this correct of has the format changed?

The format slightly changed, please check this option's docstring.

Also see ORG-NEWS here, which I just updated:

https://code.orgmode.org/bzg/org-mode/src/master/etc/ORG-NEWS#L65

Let me know if you think this is informative enough for other
users.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:00 ` Nicolas Goaziou
@ 2018-04-27 23:12   ` Bastien
  2018-04-27 23:22     ` Nicolas Goaziou
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bastien @ 2018-04-27 23:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Charles Millar

Hi Nicolas,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> In master branch, the format has changed.

With the new template mechanism, can we have rich templates like the
one Charles quotes?

  (add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? :type \n#+end_src" ""))

allowing cursor positioning, etc?

If yes, what pointer can we add to ORG-NEWS?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:12   ` Bastien
@ 2018-04-27 23:22     ` Nicolas Goaziou
  2018-04-28  6:16       ` Bastien
  2018-04-28  0:12     ` Eric Abrahamsen
  2018-04-29 20:34     ` Rasmus
  2 siblings, 1 reply; 11+ messages in thread
From: Nicolas Goaziou @ 2018-04-27 23:22 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Charles Millar

Hello,

Bastien <bzg@gnu.org> writes:

> With the new template mechanism, can we have rich templates like the
> one Charles quotes?
>
>   (add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? :type \n#+end_src" ""))
>
> allowing cursor positioning, etc?
>
> If yes, what pointer can we add to ORG-NEWS?

I don't know, but I would suggest to use Yasnippet or some other
specialized package for advanced templates like this one.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:12   ` Bastien
  2018-04-27 23:22     ` Nicolas Goaziou
@ 2018-04-28  0:12     ` Eric Abrahamsen
  2018-04-29 20:34     ` Rasmus
  2 siblings, 0 replies; 11+ messages in thread
From: Eric Abrahamsen @ 2018-04-28  0:12 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Nicolas Goaziou, Charles Millar

Bastien <bzg@gnu.org> writes:

> Hi Nicolas,
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> In master branch, the format has changed.
>
> With the new template mechanism, can we have rich templates like the
> one Charles quotes?
>
>   (add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? :type \n#+end_src" ""))
>
> allowing cursor positioning, etc?
>
> If yes, what pointer can we add to ORG-NEWS?

I think more complicated templating has gone into org-tempo.el, which
can be loaded separately, and uses the tempo package. The docstring of
`tempo-define-template' shows what's possible.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:09 ` Bastien
@ 2018-04-28  0:43   ` Charles Millar
  2018-04-28  6:22     ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Charles Millar @ 2018-04-28  0:43 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

Hi, again,

On 04/27/2018 07:09 PM, Bastien wrote:
> Hi Charles,
>
> Charles Millar <millarc@verizon.net> writes:
>
>> Is this correct of has the format changed?
> The format slightly changed, please check this option's docstring.
>
> Also see ORG-NEWS here, which I just updated:
>
> https://code.orgmode.org/bzg/org-mode/src/master/etc/ORG-NEWS#L65
>
> Let me know if you think this is informative enough for other
> users.
Prior to posting I did read the docstring for 
org-structure-template-alist in version 9.1.12 and I found nothing 
concerning "roll your own" templates. I have also read your org-news 
entry as well as the other replies.

It is not clear to me - is it possible to write my own, fairly simple 
template with a few modifications that are a result of some recent 
changes or, for example, are elements such as those in 
tempo-define-template now required?

Thanks.

Charlie Millar

[-- Attachment #2: Type: text/html, Size: 1593 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:22     ` Nicolas Goaziou
@ 2018-04-28  6:16       ` Bastien
  0 siblings, 0 replies; 11+ messages in thread
From: Bastien @ 2018-04-28  6:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Charles Millar

Hi Nicolas and Eric,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> I don't know, but I would suggest to use Yasnippet or some other
> specialized package for advanced templates like this one.

Thanks.

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I think more complicated templating has gone into org-tempo.el, which
> can be loaded separately, and uses the tempo package. The docstring of
> `tempo-define-template' shows what's possible.

I advertized both `tempo-define-template' and `yasnippet' in ORG-NEWS.

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-28  0:43   ` Charles Millar
@ 2018-04-28  6:22     ` Bastien
  2018-04-28 13:02       ` Charles Millar
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2018-04-28  6:22 UTC (permalink / raw)
  To: Charles Millar; +Cc: emacs-orgmode

Hi Charles,

Charles Millar <millarc@verizon.net> writes:

> It is not clear to me - is it possible to write my own, fairly simple
> template with a few modifications that are a result of some recent
> changes or, for example, are elements such as those in
> tempo-define-template now required?

you would need to use `tempo-define-template', yes.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-28  6:22     ` Bastien
@ 2018-04-28 13:02       ` Charles Millar
  0 siblings, 0 replies; 11+ messages in thread
From: Charles Millar @ 2018-04-28 13:02 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

Hi Bastien,

On 04/28/2018 02:22 AM, Bastien wrote:
> Hi Charles,
>
> Charles Millar <millarc@verizon.net> writes:
>
>> It is not clear to me - is it possible to write my own, fairly simple
>> template with a few modifications that are a result of some recent
>> changes or, for example, are elements such as those in
>> tempo-define-template now required?
> you would need to use `tempo-define-template', yes.
>
OK - something new to learn!

Thank you.

Charlie

[-- Attachment #2: Type: text/html, Size: 1009 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: add blocks to org-structure-template-alist
  2018-04-27 23:12   ` Bastien
  2018-04-27 23:22     ` Nicolas Goaziou
  2018-04-28  0:12     ` Eric Abrahamsen
@ 2018-04-29 20:34     ` Rasmus
  2 siblings, 0 replies; 11+ messages in thread
From: Rasmus @ 2018-04-29 20:34 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Nicolas,
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> In master branch, the format has changed.
>
> With the new template mechanism, can we have rich templates like the
> one Charles quotes?
>
>   (add-to-list 'org-structure-template-alist '("r" "#+begin_src rec :data? :type \n#+end_src" ""))
>
> allowing cursor positioning, etc?
>
> If yes, what pointer can we add to ORG-NEWS?

Not at the moment.

The particular example could be approximated with

    ("r" . "#+begin_src rec :data :type")

On the snippet expansion side, you can make whatever you want, see the
"<I" snippet.

It would require a different syntax to support more sophisticated blocks.

Rasmus

-- 
9000!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-29 20:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 22:24 add blocks to org-structure-template-alist Charles Millar
2018-04-27 23:00 ` Nicolas Goaziou
2018-04-27 23:12   ` Bastien
2018-04-27 23:22     ` Nicolas Goaziou
2018-04-28  6:16       ` Bastien
2018-04-28  0:12     ` Eric Abrahamsen
2018-04-29 20:34     ` Rasmus
2018-04-27 23:09 ` Bastien
2018-04-28  0:43   ` Charles Millar
2018-04-28  6:22     ` Bastien
2018-04-28 13:02       ` Charles Millar

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).