>> Vitalie Spinu >> on Wed, 05 Jun 2013 15:49:08 +0200 wrote: VS> Hi, VS> ESS has a visual debugger that depends on the availability of source VS> references. It would be very nice if the debugger could step directly VS> through org buffers. VS> ESS was detecting org-src-edit buffers and redirecting references to VS> original org file for already quite a while. That because of the VS> availability of org-edit-src-beg-marker in src-edit VS> buffers. Unfortunately similar functionality is not available in babel. VS> I attach a patch that would allow ess-eval-buffer from ob-R.el to access VS> the location of the currently executed block through a temporary stored VS> marker in org-babel-current-exec-src-block-head. VS> Vitalie VS> Modified lisp/ob-core.el VS> diff --git a/lisp/ob-core.el b/lisp/ob-core.el VS> index 8d26c4e..653975a 100644 VS> --- a/lisp/ob-core.el VS> +++ b/lisp/ob-core.el VS> @@ -251,7 +251,7 @@ references; a process which could likely result in the execution VS> of other code blocks. VS> Returns a list VS> - (language body header-arguments-alist switches name indent)." VS> + (language body header-arguments-alist switches name indent block-head)." VS> (let ((case-fold-search t) head info name indent) VS> ;; full code block VS> (if (setq head (org-babel-where-is-src-block-head)) VS> @@ -274,7 +274,7 @@ Returns a list VS> ;; resolve variable references and add summary parameters VS> (when (and info (not light)) VS> (setf (nth 2 info) (org-babel-process-params (nth 2 info)))) VS> - (when info (append info (list name indent))))) VS> + (when info (append info (list name indent head))))) VS> (defvar org-current-export-file) ; dynamically bound VS> (defmacro org-babel-check-confirm-evaluate (info &rest body) VS> @@ -535,6 +535,8 @@ can not be resolved.") VS> ;;; functions VS> (defvar call-process-region) VS> +(defvar org-babel-current-exec-src-block-head nil VS> + "Marker to the currently processed src block.") VS> ;;;###autoload VS> (defun org-babel-execute-src-block (&optional arg info params) VS> @@ -562,6 +564,7 @@ block." VS> (let* ((params (if params VS> (org-babel-process-params merged-params) VS> (nth 2 info))) VS> + (org-babel-current-exec-src-block-head (nth 6 info)) VS> (cachep (and (not arg) (cdr (assoc :cache params)) VS> (string= "yes" (cdr (assoc :cache params))))) VS> (new-hash (when cachep (org-babel-sha1-hash info))) VS> @@ -1592,7 +1595,7 @@ If the point is not on a source block then return nil." VS> (< top initial) (< initial bottom) VS> (progn (goto-char top) (beginning-of-line 1) VS> (looking-at org-babel-src-block-regexp)) VS> - (point)))))) VS> + (point-marker)))))) VS> ;;;###autoload VS> (defun org-babel-goto-src-block-head ()