UP | HOME

Org API

Table of Contents

Org-Src API functions (org-src.el)

org-src-associate-babel-session info

Associate edit buffer with comint session.

org-src-construct-edit-buffer-name org-buffer-name lang

Construct the buffer name for a source editing buffer.

org-src-do-at-code-block &rest body

Execute a command from an edit buffer in the Org-mode buffer.

org-src-do-key-sequence-at-code-block &optional key

Execute key sequence at code block in the source Org buffer. The command bound to key in the Org-babel key map is executed remotely with point temporarily at the start of the code block in the Org buffer.

This command is not bound to a key by default, to avoid conflicts with language major mode bindings. To bind it to C-c @ in all language major modes, you could use

(add-hook 'org-src-mode-hook
          (lambda () (define-key org-src-mode-map "\C-c@"
                  'org-src-do-key-sequence-at-code-block)))

In that case, for example, C-c @ t issued in code edit buffers would tangle the current Org code block, C-c @ e would execute the block and C-c @ h would display the other available Org-babel commands.

org-src-edit-buffer-p &optional buffer

Test whether buffer (or the current buffer if buffer is nil) is a source block editing buffer.

org-src-font-lock-fontify-block lang start end

Fontify code block. This function is called by emacs automatic fontification, as long as org-src-fontify-natively is non-nil. For manual fontification of code blocks see org-src-fontify-block and org-src-fontify-buffer

org-src-fontify-block

Fontify code block at point.

org-src-fontify-buffer

Fontify all code blocks in the current buffer

org-src-get-lang-mode lang

Return major mode that should be used for lang. lang is a string, and the returned major mode is a symbol.

org-src-mode &optional arg

Minor mode for language major mode buffers generated by org. This minor mode is turned on in two situations:

  • when editing a source code snippet with "C-c '".
  • When formatting a source code snippet for export with htmlize.

There is a mode hook, and keybindings for org-edit-src-exit and org-edit-src-save

org-src-native-tab-command-maybe

Perform language-specific TAB action. Alter code block according to effect of TAB in the language major mode.

org-src-tangle arg

Tangle the parent buffer.

Documentation from the http://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.