emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* FR: Tap stops in org-capture templates
@ 2010-11-14 23:53 Russell Adams
  2010-11-15  6:51 ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Russell Adams @ 2010-11-14 23:53 UTC (permalink / raw)
  To: emacs-orgmode

I reviewed the org-manual for capture, and noticed that we don't have
a way to specify tab stops. I use yasnippet all the time to enter
information, and I can tab from field to field.

Can capture do the same?

Here's an example from yasnippet:
----------------------------------------------------------------------
#contact : Add a contact w/ PROPERTY drawer
# --
** $1
   :PROPERTIES:
   :Company:      $2
   :Title:        $3
   :WorkEmail:    $4
   :WorkPhone:    $5
   :WorkMobile:   $7
   :WorkFax:      $8
   :WorkStreet:   $9
   :WorkCity:     $10
   :WorkState:    $11
   :WorkPostal:   $12
   :HomeEmail:    $13
   :HomePhone:    $14
   :HomeMobile:   $15
   :HomeStreet:   $16
   :HomeCity:     $17
   :HomeState:    $18
   :HomePostal:   $19
   :END:

$0
----------------------------------------------------------------------

Thanks!

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: FR: Tap stops in org-capture templates
  2010-11-14 23:53 FR: Tap stops in org-capture templates Russell Adams
@ 2010-11-15  6:51 ` Carsten Dominik
  2010-11-15 12:54   ` Russell Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2010-11-15  6:51 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode


On Nov 15, 2010, at 12:53 AM, Russell Adams wrote:

> I reviewed the org-manual for capture, and noticed that we don't have
> a way to specify tab stops. I use yasnippet all the time to enter
> information, and I can tab from field to field.
>
> Can capture do the same?

Hi Russel,

can't you just use a yasnippet in a capture buffer?

- Carsten

>
> Here's an example from yasnippet:
> ----------------------------------------------------------------------
> #contact : Add a contact w/ PROPERTY drawer
> # --
> ** $1
>  :PROPERTIES:
>  :Company:      $2
>  :Title:        $3
>  :WorkEmail:    $4
>  :WorkPhone:    $5
>  :WorkMobile:   $7
>  :WorkFax:      $8
>  :WorkStreet:   $9
>  :WorkCity:     $10
>  :WorkState:    $11
>  :WorkPostal:   $12
>  :HomeEmail:    $13
>  :HomePhone:    $14
>  :HomeMobile:   $15
>  :HomeStreet:   $16
>  :HomeCity:     $17
>  :HomeState:    $18
>  :HomePostal:   $19
>  :END:
>
> $0
> ----------------------------------------------------------------------
>
> Thanks!
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: FR: Tap stops in org-capture templates
  2010-11-15  6:51 ` Carsten Dominik
@ 2010-11-15 12:54   ` Russell Adams
  2010-11-15 13:01     ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Russell Adams @ 2010-11-15 12:54 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Nov 15, 2010 at 07:51:52AM +0100, Carsten Dominik wrote:
>
> On Nov 15, 2010, at 12:53 AM, Russell Adams wrote:
>
> >I reviewed the org-manual for capture, and noticed that we don't have
> >a way to specify tab stops. I use yasnippet all the time to enter
> >information, and I can tab from field to field.
> >
> >Can capture do the same?
>
> Hi Russel,
>
> can't you just use a yasnippet in a capture buffer?
>
> - Carsten

Certainly, if that's the preferred method.

Given that, I'm trying to get yasnippet to trigger via elisp when
capture creates the new buffer.

A template of "\n\ncontact%(yas/expand)" fails with:
condition-case: Capture abort: (wrong-type-argument char-or-string-p nil)


And a template of:
"\n\n%(yas/expand-snippet (yas/template-content (yas/get-template-by-uid 'org-mode \"contact\")))"

fails with:
condition-case: Capture template `c': The kill is not a (set of) tree(s) - please use <S-insertchar> to yank anyway

Anyone more familiar with elisp that can give me some insight?

Thanks.

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: FR: Tap stops in org-capture templates
  2010-11-15 12:54   ` Russell Adams
@ 2010-11-15 13:01     ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-11-15 13:01 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode


On Nov 15, 2010, at 1:54 PM, Russell Adams wrote:

> On Mon, Nov 15, 2010 at 07:51:52AM +0100, Carsten Dominik wrote:
>>
>> On Nov 15, 2010, at 12:53 AM, Russell Adams wrote:
>>
>>> I reviewed the org-manual for capture, and noticed that we don't  
>>> have
>>> a way to specify tab stops. I use yasnippet all the time to enter
>>> information, and I can tab from field to field.
>>>
>>> Can capture do the same?
>>
>> Hi Russel,
>>
>> can't you just use a yasnippet in a capture buffer?
>>
>> - Carsten
>
> Certainly, if that's the preferred method.

Hi Russel,

I meant it in an even simpler way, just type you yasnippet keyword and  
press
TAB to expand and fill in.

yas/expand-snippet relies on text in the buffer, and I don't think it  
returns the expanded template as a string either.

HTH

- Carsten

>
> Given that, I'm trying to get yasnippet to trigger via elisp when
> capture creates the new buffer.
>
> A template of "\n\ncontact%(yas/expand)" fails with:
> condition-case: Capture abort: (wrong-type-argument char-or-string-p  
> nil)
>
>
> And a template of:
> "\n\n%(yas/expand-snippet (yas/template-content (yas/get-template-by- 
> uid 'org-mode \"contact\")))"
>
> fails with:
> condition-case: Capture template `c': The kill is not a (set of)  
> tree(s) - please use <S-insertchar> to yank anyway
>
> Anyone more familiar with elisp that can give me some insight?
>
> Thanks.
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

end of thread, other threads:[~2010-11-15 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-14 23:53 FR: Tap stops in org-capture templates Russell Adams
2010-11-15  6:51 ` Carsten Dominik
2010-11-15 12:54   ` Russell Adams
2010-11-15 13:01     ` Carsten Dominik

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