[Top][All Lists]

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

[Orgmode] Re: [Babel] Macro for begin_src?

From: Nathan Neff
Subject: [Orgmode] Re: [Babel] Macro for begin_src?
Date: Sat, 17 Apr 2010 08:56:28 -0500

On Sat, Apr 17, 2010 at 6:03 AM, Štěpán Němec <address@hidden> wrote:
Dan Davison <address@hidden> writes:
>> Thanks!  I'm having trouble triggering the yasnippets using the TAB key, so
> I'm
>> just using the GUI menu.
>> Do you literally type "src" (no quotes), then press Tab?
> Yeah, but there's some magic code needed, which is also on Bernt's
> page.
>   (add-hook 'org-mode-hook
>             (lambda ()
>               ;; yasnippet
>               (make-variable-buffer-local 'yas/trigger-key)
>               (setq yas/trigger-key [tab])
>               (define-key yas/keymap [tab] 'yas/next-field-group)))

I'm guessing what you really want there is

(set (make-local-variable 'yas/trigger-key) [tab])

instead of

>               (make-variable-buffer-local 'yas/trigger-key)
>               (setq yas/trigger-key [tab])


Do you guys un-map your TAB key so that it doesn't run org-cycle?
My TAB key will correctly trigger yas/insert-snippet in emacs-lisp mode.
However, in org-mode my TAB key is still mapped to org-cycle, even if I add the org-mode hook using the code above.


The difference is that in the latter case you're making
`yas/trigger-key' be automatically buffer-local for *all* buffers, not
only in the buffer you're setting it (see e.g. the docstring of


reply via email to

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