Release 7.01e
[org-mode/org-tableheadings.git] / lisp / ob-keys.el
blobb38b621ce0337a86a4075371b89f75d81ac9ebaf
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.01e
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-src-block)
56 ("\C-e" . org-babel-execute-src-block)
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 ("g" . org-babel-goto-named-src-block)
62 ("r" . org-babel-goto-named-result)
63 ("\C-r" . org-babel-goto-named-result)
64 ("\C-b" . org-babel-execute-buffer)
65 ("b" . org-babel-execute-buffer)
66 ("\C-s" . org-babel-execute-subtree)
67 ("s" . org-babel-execute-subtree)
68 ("\C-t" . org-babel-tangle)
69 ("t" . org-babel-tangle)
70 ("\C-f" . org-babel-tangle-file)
71 ("f" . org-babel-tangle-file)
72 ("\C-l" . org-babel-lob-ingest)
73 ("l" . org-babel-lob-ingest)
74 ("\C-z" . org-babel-switch-to-session)
75 ("z" . org-babel-switch-to-session)
76 ("\C-a" . org-babel-sha1-hash)
77 ("a" . org-babel-sha1-hash)
78 ("h" . org-babel-describe-bindings))
79 "Alist of key bindings and interactive Babel functions.
80 This list associates interactive Babel functions
81 with keys. Each element of this list will add an entry to the
82 `org-babel-map' using the letter key which is the `car' of the
83 a-list placed behind the generic `org-babel-key-prefix'.")
85 (provide 'ob-keys)
87 ;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
89 ;;; ob-keys.el ends here