emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: org-babel-ref-parse needs to set current buffer to the buff


From: Nicolas Goaziou
Subject: Re: [O] Bug: org-babel-ref-parse needs to set current buffer to the buffer of the marker [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]
Date: Thu, 07 May 2015 22:04:26 +0200

Hello,

Oleg Sivokon <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]