Republish org-odt-20111011.tar
[org-mode/org-jambu.git] / lisp / ob-keys.el
blob67943e8d378b77dfb9b32530eddd8219bfeb5cf2
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-c" . org-babel-check-src-block)
77 ("c" . org-babel-check-src-block)
78 ("\C-l" . org-babel-load-in-session)
79 ("l" . org-babel-load-in-session)
80 ("\C-i" . org-babel-lob-ingest)
81 ("i" . org-babel-lob-ingest)
82 ("\C-z" . org-babel-switch-to-session)
83 ("z" . org-babel-switch-to-session-with-code)
84 ("\C-a" . org-babel-sha1-hash)
85 ("a" . org-babel-sha1-hash)
86 ("h" . org-babel-describe-bindings)
87 ("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
88 ("x" . org-babel-do-key-sequence-in-edit-buffer)
89 ("\C-\M-h" . org-babel-mark-block))
90 "Alist of key bindings and interactive Babel functions.
91 This list associates interactive Babel functions
92 with keys. Each element of this list will add an entry to the
93 `org-babel-map' using the letter key which is the `car' of the
94 a-list placed behind the generic `org-babel-key-prefix'.")
96 (provide 'ob-keys)
98 ;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
100 ;;; ob-keys.el ends here