summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-09-08 00:13:12 -0600
committerEric Schulte <schulte.eric@gmail.com>2010-09-08 00:13:12 -0600
commit7dd72699a932fb93de28ee902b7f48b15606ba87 (patch)
treea68b226e60a6887fa427f0a5947b36728b5ecfd8
parente92a4b08138b929a7ba1be7553ea73d4117acbe9 (diff)
downloadorg-mode-7dd72699a932fb93de28ee902b7f48b15606ba87.tar.gz
a new function for jumping to the head of the current code block
* lisp/ob-keys.el (org-babel-key-bindings): adding key-binding for `org-babel-goto-src-block-head' * lisp/ob.el (org-babel-goto-src-block-head): jump to the head of the current code block
-rw-r--r--lisp/ob-keys.el2
-rw-r--r--lisp/ob.el8
2 files changed, 10 insertions, 0 deletions
diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el
index 5ed8967..ff730c6 100644
--- a/lisp/ob-keys.el
+++ b/lisp/ob-keys.el
@@ -58,6 +58,8 @@ functions which are assigned key bindings, and see
("\C-o" . org-babel-open-src-block-result)
("\C-v" . org-babel-expand-src-block)
("v" . org-babel-expand-src-block)
+ ("u" . org-babel-goto-src-block-head)
+ ("\C-u" . org-babel-goto-src-block-head)
("g" . org-babel-goto-named-src-block)
("r" . org-babel-goto-named-result)
("\C-r" . org-babel-goto-named-result)
diff --git a/lisp/ob.el b/lisp/ob.el
index f7d7050..f367f52 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1022,6 +1022,14 @@ If the point is not on a source block then return nil."
(point))))))
;;;###autoload
+(defun org-babel-goto-src-block-head ()
+ "Go to the beginning of the current code block."
+ (interactive)
+ ((lambda (head)
+ (if head (goto-char head) (error "not currently in a code block")))
+ (org-babel-where-is-src-block-head)))
+
+;;;###autoload
(defun org-babel-goto-named-src-block (name)
"Go to a named source-code block."
(interactive