not yet working
This commit is contained in:
parent
7984724a2b
commit
ec38cffff0
|
@ -269,6 +269,20 @@ If the point is not on a source block then return nil."
|
||||||
(goto-char top) (looking-at org-babel-src-block-regexp)
|
(goto-char top) (looking-at org-babel-src-block-regexp)
|
||||||
(point))))))
|
(point))))))
|
||||||
|
|
||||||
|
(defun org-babel-goto-named-source-block (&optional name)
|
||||||
|
"Go to a named source-code block."
|
||||||
|
(interactive "ssource-block name: ")
|
||||||
|
(let ((S (format "#+srcname: %s" name)))
|
||||||
|
(if point
|
||||||
|
;; taken from `org-open-at-point'
|
||||||
|
(progn
|
||||||
|
(switch-to-buffer-other-window
|
||||||
|
(org-get-buffer-for-internal-link (current-buffer)))
|
||||||
|
(org-mark-ring-push)
|
||||||
|
(condition-case nil (org-link-search (format "#+srcname: %s" name))
|
||||||
|
(error (progn (widen) (org-link-search (format "#+srcname: %s" name))))))
|
||||||
|
(message "source-code block '%s' not found in this buffer" name))))
|
||||||
|
|
||||||
(defun org-babel-find-named-block (name)
|
(defun org-babel-find-named-block (name)
|
||||||
"Find a named source-code block.
|
"Find a named source-code block.
|
||||||
Return the location of the source block identified by
|
Return the location of the source block identified by
|
||||||
|
@ -277,11 +291,10 @@ according to org-babel-named-src-block-regexp."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let ((case-fold-search t)
|
(let ((case-fold-search t)
|
||||||
(regexp (org-babel-named-src-block-regexp-for-name name)) msg)
|
(regexp (org-babel-named-src-block-regexp-for-name name)) msg)
|
||||||
(unless (or (re-search-forward regexp nil t)
|
(goto-char (point-min))
|
||||||
(re-search-backward regexp nil t))
|
(when (or (re-search-forward regexp nil t)
|
||||||
(progn (setq msg (format "source-code block '%s' not found in this buffer" name))
|
(re-search-backward regexp nil t))
|
||||||
(message msg) (error msg))))
|
(match-beginning 0)))))
|
||||||
(point)))
|
|
||||||
|
|
||||||
(defun org-babel-find-named-result (name)
|
(defun org-babel-find-named-result (name)
|
||||||
"Return the location of the result named NAME in the current
|
"Return the location of the result named NAME in the current
|
||||||
|
|
|
@ -122,6 +122,8 @@ and the results to be collected in the same table.
|
||||||
At the same time I introduced org-babel-named-src-block-regexp, to
|
At the same time I introduced org-babel-named-src-block-regexp, to
|
||||||
match src-blocks with srcname.
|
match src-blocks with srcname.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
** TODO support for working with =*Org Edit Src Example*= buffers [1/4]
|
** TODO support for working with =*Org Edit Src Example*= buffers [1/4]
|
||||||
*** TODO set buffer-local-process variables appropriately [DED]
|
*** TODO set buffer-local-process variables appropriately [DED]
|
||||||
I think something like this would be great. You've probably
|
I think something like this would be great. You've probably
|
||||||
|
|
Loading…
Reference in New Issue