Make sure going to last capture also works after refile
[org-mode/org-jambu.git] / lisp / ob-keys.el
blob2cc523a21b2f88b2a6285331067ac037a8e488c1
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: 0.01
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 `org-babel-key-prefix' variable holds the key prefix
37 behind which all org-babel interactive key-binding are placed.
38 See `org-babel-key-bindings' for the list of interactive babel
39 functions which are assigned key bindings, and see
40 `org-babel-map' for the actual babel keymap.")
42 (defvar org-babel-map (make-sparse-keymap)
43 "The keymap holding key bindings for interactive org-babel
44 functions.")
46 ;;;###autoload
47 (defun org-babel-describe-bindings ()
48 "Describe all key binding placed behind the
49 `org-babel-key-prefix' prefix."
50 (interactive)
51 (describe-bindings org-babel-key-prefix))
53 (defvar org-babel-key-bindings
54 '(("e" . org-babel-execute-src-block)
55 ("\C-e" . org-babel-execute-src-block)
56 ("o" . org-babel-open-src-block-result)
57 ("\C-o" . org-babel-open-src-block-result)
58 ("\C-p" . org-babel-expand-src-block)
59 ("p" . org-babel-expand-src-block)
60 ("g" . org-babel-goto-named-source-block)
61 ("\C-b" . org-babel-execute-buffer)
62 ("b" . org-babel-execute-buffer)
63 ("\C-s" . org-babel-execute-subtree)
64 ("s" . org-babel-execute-subtree)
65 ("\C-t" . org-babel-tangle)
66 ("t" . org-babel-tangle)
67 ("\C-f" . org-babel-tangle-file)
68 ("f" . org-babel-tangle-file)
69 ("\C-l" . org-babel-lob-ingest)
70 ("l" . org-babel-lob-ingest)
71 ("\C-z" . org-babel-switch-to-session)
72 ("z" . org-babel-switch-to-session)
73 ("\C-a" . org-babel-sha1-hash)
74 ("a" . org-babel-sha1-hash)
75 ("h" . org-babel-describe-bindings))
76 "Alist associating key bindings with interactive Org-babel
77 functions. This list associates interactive org-babel functions
78 with keys. Each element of this list will add an entry to the
79 `org-babel-map' using the letter key which is the `car' of the
80 a-list placed behind the generic `org-babel-key-prefix'.")
82 (provide 'ob-keys)
84 ;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
86 ;;; ob-keys.el ends here