John Kitchin writes:

I like this kind of keyboard shortcut: For python: <p TAB C-w For emacs-lisp <el TAB C-w

I agree, this is the best method. Although probably you mean C-y instead of C-w.

For the record, this requires you to set up `org-structure-template-alist' to include python and emacs-lisp. For example, I use p and E, for python and emacs-lisp, so in my .emacs I have:

#+BEGIN_SRC emacs-lisp
 (eval-after-load "org"
        '(progn
           (add-to-list 'org-structure-template-alist
                        '("E"
                          "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"
"<src lang=\\"emacs-lisp\\">\n\n?</src>"))
           (add-to-list 'org-structure-template-alist
                        '("p"
                          "#+BEGIN_SRC python\n?\n#+END_SRC"
"<src lang=\\"python\\">\n\n?</src>"))))
#+END_SRC

I even use the method in message-mode, for writing emails with code, like I just did now =)

Best,

--
Jorge.


Reply via email to