Release 7.5
[org-mode/org-tableheadings.git] / lisp / ob-keys.el
blobfd2bce89b513c141d146ab4e291bfb0353ca8f4a
1 ;;; ob-keys.el --- key bindings for org-babel
3 ;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
5 ;; Author: Eric Schulte
6 ;; Keywords: literate programming, reproducible research
7 ;; Homepage: http://orgmode.org
8 ;; Version: 7.5
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;; Add org-babel keybindings to the org-mode keymap for exposing
28 ;; org-babel functions. These will all share a common prefix. See
29 ;; the value of `org-babel-key-bindings' for a list of interactive
30 ;; functions and their associated keys.
32 ;;; Code:
33 (require 'ob)
35 (defvar org-babel-key-prefix "\C-c\C-v"
36 "The key prefix for Babel interactive key-bindings.
37 See `org-babel-key-bindings' for the list of interactive babel
38 functions which are assigned key bindings, and see
39 `org-babel-map' for the actual babel keymap.")
41 (defvar org-babel-map (make-sparse-keymap)
42 "The keymap for interactive Babel functions.")
44 ;;;###autoload
45 (defun org-babel-describe-bindings ()
46 "Describe all keybindings behind `org-babel-key-prefix'."
47 (interactive)
48 (describe-bindings org-babel-key-prefix))
50 (defvar org-babel-key-bindings
51 '(("p" . org-babel-previous-src-block)
52 ("\C-p" . org-babel-previous-src-block)
53 ("n" . org-babel-next-src-block)
54 ("\C-n" . org-babel-next-src-block)
55 ("e" . org-babel-execute-maybe)
56 ("\C-e" . org-babel-execute-maybe)
57 ("o" . org-babel-open-src-block-result)
58 ("\C-o" . org-babel-open-src-block-result)
59 ("\C-v" . org-babel-expand-src-block)
60 ("v" . org-babel-expand-src-block)
61 ("u" . org-babel-goto-src-block-head)
62 ("\C-u" . org-babel-goto-src-block-head)
63 ("g" . org-babel-goto-named-src-block)
64 ("r" . org-babel-goto-named-result)
65 ("\C-r" . org-babel-goto-named-result)
66 ("\C-b" . org-babel-execute-buffer)
67 ("b" . org-babel-execute-buffer)
68 ("\C-s" . org-babel-execute-subtree)
69 ("s" . org-babel-execute-subtree)
70 ("\C-d" . org-babel-demarcate-block)
71 ("d" . org-babel-demarcate-block)
72 ("\C-t" . org-babel-tangle)
73 ("t" . org-babel-tangle)
74 ("\C-f" . org-babel-tangle-file)
75 ("f" . org-babel-tangle-file)
76 ("\C-l" . org-babel-load-in-session)
77 ("l" . org-babel-load-in-session)
78 ("\C-i" . org-babel-lob-ingest)
79 ("i" . org-babel-lob-ingest)
80 ("\C-z" . org-babel-switch-to-session)
81 ("z" . org-babel-switch-to-session-with-code)
82 ("\C-a" . org-babel-sha1-hash)
83 ("a" . org-babel-sha1-hash)
84 ("h" . org-babel-describe-bindings)
85 ("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
86 ("x" . org-babel-do-key-sequence-in-edit-buffer)
87 ("\C-\M-h" . org-babel-mark-block))
88 "Alist of key bindings and interactive Babel functions.
89 This list associates interactive Babel functions
90 with keys. Each element of this list will add an entry to the
91 `org-babel-map' using the letter key which is the `car' of the
92 a-list placed behind the generic `org-babel-key-prefix'.")
94 (provide 'ob-keys)
96 ;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
98 ;;; ob-keys.el ends here