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
This commit is contained in:
Eric Schulte 2010-09-08 00:13:12 -06:00
parent e92a4b0813
commit 7dd72699a9
2 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -1021,6 +1021,14 @@ If the point is not on a source block then return nil."
(looking-at org-babel-src-block-regexp))
(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."