From: "Göktuğ Kayaalp" <self@gkayaalp.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Inheriting some local variables from source code block editing buffers
Date: Mon, 14 May 2018 19:34:39 +0300 [thread overview]
Message-ID: <ygmfu2ui4bk.fsf@gkayaalp.com> (raw)
In-Reply-To: <87bmdizb7k.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 14 May 2018 14:13:51 +0200")
On 2018-05-14 14:13 +02, Nicolas Goaziou <mail@nicolasgoaziou.fr> 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 ‘org-babel-get-src-block-info’ does not exist 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 ‘org-edit-*’
functions apart from ‘org-edit-src-code’ in org-src.el seem to process
header arguments, and nor does ‘org-src--edit-element’.
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))) ;=> nil
(cl-remove-if-not #'symbolp (cadr (org-element-at-point)))
;=> (: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.
--
İ. Göktuğ Kayaalp <https://www.gkayaalp.com/>
024C 30DD 597D 142B 49AC
40EB 465C D949 B101 2427
next prev parent reply other threads:[~2018-05-14 16:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-29 17:19 Inheriting some local variables from source code block editing buffers Göktuğ Kayaalp
2018-04-29 22:09 ` Bastien
2018-05-01 3:30 ` Göktuğ Kayaalp
2018-05-01 8:43 ` Nicolas Goaziou
2018-05-01 8:45 ` Nicolas Goaziou
2018-05-01 11:41 ` Göktuğ Kayaalp
2018-05-01 11:55 ` Nicolas Goaziou
[not found] ` <ygmvac7lcl1.fsf@gkayaalp.com>
2018-05-01 14:00 ` Nicolas Goaziou
2018-05-01 16:37 ` Aaron Ecay
[not found] ` <ygmin87kwua.fsf@gkayaalp.com>
2018-05-01 19:35 ` Aaron Ecay
2018-05-01 20:04 ` Göktuğ Kayaalp
2018-05-01 20:53 ` Aaron Ecay
2018-05-01 22:12 ` Göktuğ Kayaalp
2018-05-01 22:19 ` Aaron Ecay
2018-05-01 22:26 ` Göktuğ Kayaalp
2018-05-02 10:16 ` Nicolas Goaziou
2018-05-02 19:52 ` Göktuğ Kayaalp
2018-05-01 11:45 ` Göktuğ Kayaalp
2018-05-14 5:44 ` Göktuğ Kayaalp
2018-05-14 12:13 ` Nicolas Goaziou
2018-05-14 16:34 ` Göktuğ Kayaalp [this message]
2018-05-14 16:47 ` Nicolas Goaziou
2018-05-15 18:36 ` Göktuğ Kayaalp
2018-05-18 21:48 ` Göktuğ Kayaalp
2018-05-19 12:26 ` Nicolas Goaziou
2018-05-21 14:20 ` Aaron Ecay
2018-05-14 13:33 ` Aaron Ecay
2018-05-14 16:46 ` Göktuğ Kayaalp
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=ygmfu2ui4bk.fsf@gkayaalp.com \
--to=self@gkayaalp.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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).