From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: header argument :noweb-ref seems can't be resolved Date: Tue, 19 Dec 2017 04:59:49 +0000 Message-ID: References: <65580a97-24c4-a54c-655f-c37fcddd2cd1@gmail.com> <580C6094-17BE-44C7-8F4C-8BAF3113AA40@ucsd.edu> <8C1BE6FC-D004-49A9-82F5-03181061E848@ucsd.edu> <65375b87-03d9-45bb-6529-f5473c4d6af7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRA0q-0001Ju-Cp for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 00:00:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRA0n-0008HV-2K for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 00:00:20 -0500 Received: from iport-bcv4-out.ucsd.edu ([132.239.0.122]:63284) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRA0m-0007bm-EC for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 00:00:16 -0500 In-Reply-To: Content-Language: en-US Content-ID: 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: "numbchild@gmail.com" Cc: emacs-org-mode > On Dec 18, 2017, at 9:28 AM, numbchild@gmail.com wrote: >=20 > Hope someone can help here. >=20 OK. I think I have it. `org-babel-params-from-properties' uses `org-babel-c= urrent-src-block' to figure out where to look for properties. And o-b-c-s-b= -l is let bound in `org-babel-noweb-expand-references' to the src block loc= ation with the noweb reference, e.g. `<>'.=20 The problem can be illustrated like so. Put this in a buffer: #+begin_src org ,* abc :PROPERTIES: :header-args: :noweb-ref abcblocks :END: ,#+name: got-abc ,#+begin_src R 1+2 ,#+end_src ,* def #+end_src execute this: #+begin_src emacs-lisp (defun show-prob (obcsbl) (let ((org-babel-current-src-block-location obcsbl)) (assq :noweb-ref (nth 2 (org-babel-get-src-block-info))))) #+end_src Then put point in the got-abc src block and type=20 M-: (show-prob (point)) RET and you will see `(:noweb-ref . "abcblocks")' in the minibuffer. Now try=20 M-: (show-prob 1000) RET and the result is `nil'. The problem can be fixed by let-binding `org-babel-current-src-block-locati= on' to `beg-body' in `org-babel-noweb-expand-references' like this (org-babel-map-src-blocks nil (let* ((org-babel-current-src-block-location beg-body) (i (org-babel-get-src-block-info 'light))) =09 but maybe it is better to change `org-babel-params-from-properties'. WDYT? Chuck