2010-06-11 23:02:42 +00:00
|
|
|
;;; ob-keys.el --- key bindings for org-babel
|
2009-12-30 01:53:43 +00:00
|
|
|
|
2010-06-25 16:20:39 +00:00
|
|
|
;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
2009-12-30 01:53:43 +00:00
|
|
|
|
|
|
|
;; Author: Eric Schulte
|
|
|
|
;; Keywords: literate programming, reproducible research
|
|
|
|
;; Homepage: http://orgmode.org
|
2010-12-10 17:43:10 +00:00
|
|
|
;; Version: 7.5
|
2009-12-30 01:53:43 +00:00
|
|
|
|
2010-06-25 16:20:39 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
2009-12-30 01:53:43 +00:00
|
|
|
|
2010-06-25 16:20:39 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2009-12-30 01:53:43 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2010-06-25 16:20:39 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2009-12-30 01:53:43 +00:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
2010-06-25 16:20:39 +00:00
|
|
|
|
2009-12-30 01:53:43 +00:00
|
|
|
;; You should have received a copy of the GNU General Public License
|
2010-06-25 16:20:39 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2009-12-30 01:53:43 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
2010-06-25 16:20:39 +00:00
|
|
|
;; Add org-babel keybindings to the org-mode keymap for exposing
|
|
|
|
;; org-babel functions. These will all share a common prefix. See
|
|
|
|
;; the value of `org-babel-key-bindings' for a list of interactive
|
|
|
|
;; functions and their associated keys.
|
2009-12-30 01:53:43 +00:00
|
|
|
|
|
|
|
;;; Code:
|
2010-06-11 23:02:42 +00:00
|
|
|
(require 'ob)
|
2009-12-30 01:53:43 +00:00
|
|
|
|
2010-05-13 05:41:13 +00:00
|
|
|
(defvar org-babel-key-prefix "\C-c\C-v"
|
2010-07-13 23:20:08 +00:00
|
|
|
"The key prefix for Babel interactive key-bindings.
|
2010-05-17 23:08:32 +00:00
|
|
|
See `org-babel-key-bindings' for the list of interactive babel
|
|
|
|
functions which are assigned key bindings, and see
|
|
|
|
`org-babel-map' for the actual babel keymap.")
|
2010-05-13 05:41:13 +00:00
|
|
|
|
2010-05-17 23:08:32 +00:00
|
|
|
(defvar org-babel-map (make-sparse-keymap)
|
2010-07-13 23:20:08 +00:00
|
|
|
"The keymap for interactive Babel functions.")
|
2010-05-13 05:41:13 +00:00
|
|
|
|
2010-06-23 18:24:33 +00:00
|
|
|
;;;###autoload
|
2010-05-17 23:08:32 +00:00
|
|
|
(defun org-babel-describe-bindings ()
|
2010-07-13 23:20:08 +00:00
|
|
|
"Describe all keybindings behind `org-babel-key-prefix'."
|
2010-05-17 23:08:32 +00:00
|
|
|
(interactive)
|
|
|
|
(describe-bindings org-babel-key-prefix))
|
|
|
|
|
2009-12-30 01:53:43 +00:00
|
|
|
(defvar org-babel-key-bindings
|
2010-07-12 04:35:58 +00:00
|
|
|
'(("p" . org-babel-previous-src-block)
|
|
|
|
("\C-p" . org-babel-previous-src-block)
|
|
|
|
("n" . org-babel-next-src-block)
|
|
|
|
("\C-n" . org-babel-next-src-block)
|
2010-08-05 17:45:13 +00:00
|
|
|
("e" . org-babel-execute-maybe)
|
|
|
|
("\C-e" . org-babel-execute-maybe)
|
2010-06-30 19:25:22 +00:00
|
|
|
("o" . org-babel-open-src-block-result)
|
|
|
|
("\C-o" . org-babel-open-src-block-result)
|
2010-07-12 04:35:58 +00:00
|
|
|
("\C-v" . org-babel-expand-src-block)
|
|
|
|
("v" . org-babel-expand-src-block)
|
2010-09-08 06:13:12 +00:00
|
|
|
("u" . org-babel-goto-src-block-head)
|
|
|
|
("\C-u" . org-babel-goto-src-block-head)
|
2010-07-12 04:35:58 +00:00
|
|
|
("g" . org-babel-goto-named-src-block)
|
|
|
|
("r" . org-babel-goto-named-result)
|
|
|
|
("\C-r" . org-babel-goto-named-result)
|
2010-05-13 05:41:13 +00:00
|
|
|
("\C-b" . org-babel-execute-buffer)
|
2010-05-17 23:08:32 +00:00
|
|
|
("b" . org-babel-execute-buffer)
|
2010-05-13 05:41:13 +00:00
|
|
|
("\C-s" . org-babel-execute-subtree)
|
2010-05-17 23:08:32 +00:00
|
|
|
("s" . org-babel-execute-subtree)
|
2010-09-19 20:47:49 +00:00
|
|
|
("\C-d" . org-babel-demarcate-block)
|
|
|
|
("d" . org-babel-demarcate-block)
|
2010-05-13 05:41:13 +00:00
|
|
|
("\C-t" . org-babel-tangle)
|
2010-05-17 23:08:32 +00:00
|
|
|
("t" . org-babel-tangle)
|
|
|
|
("\C-f" . org-babel-tangle-file)
|
|
|
|
("f" . org-babel-tangle-file)
|
2010-07-30 17:02:42 +00:00
|
|
|
("\C-l" . org-babel-load-in-session)
|
|
|
|
("l" . org-babel-load-in-session)
|
|
|
|
("\C-i" . org-babel-lob-ingest)
|
|
|
|
("i" . org-babel-lob-ingest)
|
2010-05-13 05:41:13 +00:00
|
|
|
("\C-z" . org-babel-switch-to-session)
|
2010-08-17 21:01:37 +00:00
|
|
|
("z" . org-babel-switch-to-session-with-code)
|
2010-05-17 23:08:32 +00:00
|
|
|
("\C-a" . org-babel-sha1-hash)
|
|
|
|
("a" . org-babel-sha1-hash)
|
2010-08-17 20:46:51 +00:00
|
|
|
("h" . org-babel-describe-bindings)
|
|
|
|
("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
|
2010-10-18 19:15:35 +00:00
|
|
|
("x" . org-babel-do-key-sequence-in-edit-buffer)
|
|
|
|
("\C-\M-h" . org-babel-mark-block))
|
2010-07-13 23:20:08 +00:00
|
|
|
"Alist of key bindings and interactive Babel functions.
|
|
|
|
This list associates interactive Babel functions
|
2010-05-17 23:08:32 +00:00
|
|
|
with keys. Each element of this list will add an entry to the
|
|
|
|
`org-babel-map' using the letter key which is the `car' of the
|
|
|
|
a-list placed behind the generic `org-babel-key-prefix'.")
|
2009-12-30 01:53:43 +00:00
|
|
|
|
2010-06-11 23:02:42 +00:00
|
|
|
(provide 'ob-keys)
|
2010-06-25 16:20:39 +00:00
|
|
|
|
|
|
|
;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
|
|
|
|
|
2010-06-11 23:02:42 +00:00
|
|
|
;;; ob-keys.el ends here
|