babel: smarter `org-babel-ref-split-args' -- fixes bug parsing indexed function-style...
[rgr-org-mode.git] / contrib / babel / lisp / org-babel-keys.el
blob006e815767f87820dbb308c7160b5adcf4f0ac99
1 ;;; org-babel-keys.el --- key bindings for org-babel
3 ;; Copyright (C) 2009 Eric Schulte
5 ;; Author: Eric Schulte
6 ;; Keywords: literate programming, reproducible research
7 ;; Homepage: http://orgmode.org
8 ;; Version: 0.01
10 ;;; License:
12 ;; This program 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, or (at your option)
15 ;; any later version.
17 ;; This program 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; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
29 ;; Add some org-babel keybindings to the org-mode keymap for exposing
30 ;; org-babel functions. These will all share the common C-c M-b
31 ;; prefix. See the value of `org-babel-key-bindings' for a list of
32 ;; interactive functions and their associated keys.
34 ;;; Code:
35 (require 'org-babel)
37 (defvar org-babel-key-prefix "\C-c\M-b"
38 "Prefix behind which all org-babel interactive key-binding will
39 be placed. See `org-babel-key-bindings' for the list of
40 interactive babel functions which are assigned key bindings.")
42 (defvar org-babel-key-bindings
43 '(("t" . org-babel-tangle)
44 ("T" . org-babel-tangle-file)
45 ("e" . org-babel-execute-src-block)
46 ("s" . org-babel-execute-subtree)
47 ("b" . org-babel-execute-buffer)
48 ("h" . org-babel-sha1-hash)
49 ("g" . org-babel-goto-named-source-block)
50 ("l" . org-babel-lob-ingest))
51 "Org-babel keybindings. This list associates interactive
52 org-babel functions with keys. Each element of this list will
53 add an entry to the `org-mode-map' using the letter key which is
54 the `car' of the a-list placed behind the generic
55 `org-babel-key-prefix'.")
57 (mapc (lambda (pair)
58 (message "%S" pair)
59 (define-key org-mode-map
60 (concat org-babel-key-prefix (car pair))
61 (cdr pair)))
62 org-babel-key-bindings)
64 (provide 'org-babel-keys)
65 ;;; org-babel-keys.el ends here