Hello,

Oleg Sivokon <olegsivo...@gmail.com> writes:

> I've been having this problem for a while, and now I think I found its
> culprit: The org-babel-ref-parse function will try to move the point in
> a wrong buffer (a temporary buffer with the contents of the buffer being
> exported), while doing so, it will not switch to this temporary buffer.
> Below is what I did to deal with it:
>
> (defun org-babel-ref-parse (assignment)
>   "Parse a variable ASSIGNMENT in a header argument.
> If the right hand side of the assignment has a literal value
> return that value, otherwise interpret as a reference to an
> external resource and find its value using
> `org-babel-ref-resolve'.  Return a list with two elements.  The
> first element of the list will be the name of the variable, and
> the second will be an emacs-lisp representation of the value of
> the variable."
>   (when (string-match org-babel-ref-split-regexp assignment)
>     (let ((var (match-string 1 assignment))
>         (ref (match-string 2 assignment)))
>       (cons (intern var)
>           (let ((out (save-excursion
>                        (when org-babel-current-src-block-location
>                ;; Added this line, to avoid
>                ;; "Marker points into wrong buffer" error
>                          (set-buffer (marker-buffer 
> org-babel-current-src-block-location))
>                          (goto-char org-babel-current-src-block-location))
>                        (org-babel-read ref))))

Using `with-current-buffer' is more appropriate since the change is
temporary.


Could you provide a patch using git format-patch, with a proper commit
message?

Thank you.


Regards,

-- 
Nicolas Goaziou

Reply via email to