emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Oleg Sivokon <olegsivokon@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <87a8xgi27p.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <8761873tx7.fsf@gmail.com> (Oleg Sivokon's message of "Tue, 05 May 2015 18:50:28 +0300")

Hello,

Oleg Sivokon <olegsivokon@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	other threads:[~2015-05-07 20:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 15:50 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/)] Oleg Sivokon
2015-05-07 20:04 ` Nicolas Goaziou [this message]
2015-05-07 21:22   ` Oleg Sivokon
2015-05-08  8:24     ` Nicolas Goaziou
2015-05-08 13:18       ` Oleg Sivokon
2015-05-08 22:08         ` Nicolas Goaziou
2015-05-08 23:01           ` Oleg Sivokon
2015-05-09  9:04             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8xgi27p.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=olegsivokon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).