From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?G=C3=B6ktu=C4=9F_Kayaalp?= Subject: Re: Inheriting some local variables from source code block editing buffers Date: Mon, 14 May 2018 19:34:39 +0300 Message-ID: References: <87bmdizb7k.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIGQw-0003IW-Na for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:34:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIGQt-00020R-Jf for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:34:46 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:34837) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIGQt-0001xd-Cx for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:34:43 -0400 In-Reply-To: <87bmdizb7k.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 14 May 2018 14:13:51 +0200") 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On 2018-05-14 14:13 +02, Nicolas Goaziou wrote: > You shouldn't add another "attr" keyword, which is reserved for export > back-ends. Actually, every Babel header can be located either on the > block opening line, e.g., > > #+begin_src emacs-lisp :some-property some-value > > or as an affiliated #+header: keyword, e.g., > > #+header: :some-property some-value > #+begin_src emacs-lisp > > > Note that "#+header:" keywords are supported everywhere, without > modifying the parser, e.g., > > #+header: :some-property some-value > A paragraph. The attr was meant for BEGIN_EXPORT blocks because it seems to me that an equivalent of =E2=80=98org-babel-get-src-block-info=E2=80=99 does not ex= ist for those blocks, and that function _only_ works with BEGIN_SRC blocks. Is there a function available or would I have to write one to do this? Looking all over the Org manual searching for BEGIN_(LATEX|HTML), I haven't seen once a header argument used with a block that is not a BEGIN_SRC block, in neither of the forms. And none of the =E2=80=98org-edi= t-*=E2=80=99 functions apart from =E2=80=98org-edit-src-code=E2=80=99 in org-src.el seem= to process header arguments, and nor does =E2=80=98org-src--edit-element=E2=80=99. I can't find any documentation on Org-mode's internal APIs and how different parts fit together, so I'm having to figure things out reading source code. The following form returns nil for the following examples: (plist-get :header (cadr (org-element-at-point))) ;=3D> nil (cl-remove-if-not #'symbolp (cadr (org-element-at-point))) ;=3D> (:type :begin :end :value :post-blank :post-affiliated :header :parent nil) #+header: :edit-bindings '((lexical-binding t)) #+BEGIN_EXPORT latex #+END_EXPORT #+BEGIN_EXPORT latex :edit-bindings '((lexical-binding t)) #+END_EXPORT #+BEGIN_SRC elisp :edit-bindings '((lexical-binding t)) #+END_SRC #+header: :edit-bindings '((lexical-binding t)) #+BEGIN_SRC elisp #+END_SRC > Also, for integration in Org mode proper, some testing would be more > than welcome If this feature will be included upstream, I can make this into a patch instead of an advice and add the related docs and tests. This was meant as a concrete example of the concept. --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp 024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427