From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: [PATCH] ob-core: check argument to goto-char Date: Sat, 30 Apr 2016 10:38:31 -0700 Message-ID: References: <87d1p79x17.fsf@eknet.org> Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="0-1924494454-1462037913=:791" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awYr4-000724-F7 for emacs-orgmode@gnu.org; Sat, 30 Apr 2016 13:39:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awYqs-00052v-GE for emacs-orgmode@gnu.org; Sat, 30 Apr 2016 13:38:53 -0400 Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:31481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awYqr-0004xQ-2f for emacs-orgmode@gnu.org; Sat, 30 Apr 2016 13:38:46 -0400 In-Reply-To: <87d1p79x17.fsf@eknet.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Eike Cc: emacs-orgmode This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1924494454-1462037913=:791 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Sat, 30 Apr 2016, Eike wrote: > > Hi, > > I have some code that uses `org-babel-insert-result' and I've found that > evaluating for example > > (org-babel-insert-result "a") > > results in an error. Although not explicitly marked as such, `org-babel-insert-result' seems intended as an internal function for processing babel RESULTs. > The reason is that `goto-char' is called with a nil > argument. When your snippet is in a src block or inline src block, there is no error. Also, no error when point is in a src block and you run the snippet with : M-x eval-expression RET (org-babel-insert-result "a") RET So, it looks like you are trying to evaluate the snippet above when point is not in a src block. AFAICS, there is no guarantee that such usage will succeed. Failure in such uses seems more like a feature than a bug. > I simply put the snippet in a `when' clause, but since the > function is quite large I'm not so sure if it's now doing always the > correct thing. At least my org files seem still to work…. > > I've added the patch in case it is ok to be applied. Maybe someone can > have a look at it. > See http://orgmode.org/worg/org-contribute.html for details on how to contribute. Also, running `make test' on new code is a good idea. If you can explain what you are trying to achieve, someone may suggest a fix that does not require retooling babel internals. Or if you can provide an ECM that suggests a bug in babel, then someone may suggest a better fix. HTH, Chuck --0-1924494454-1462037913=:791--