emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Inheriting some local variables from source code block editing b


From: Bastien
Subject: Re: [O] Inheriting some local variables from source code block editing buffers
Date: Mon, 30 Apr 2018 00:09:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Göktuğ,

thanks for your patch.

Kayaalp <address@hidden> writes:

> when editing a source block, passing some local variables from the
> original buffer into the buffer in which the source code is edited might
> be useful.  My use case is passing the value of ‘lexical-binding’ when
> editing Elisp source code blocks in my literate .emacs so that I don't
> mistakenly evaluate code in a non-lexical environment thinking it's the
> opposite instead.

Yes, I see how this can be useful in this case.

Do you have other examples on local variables that would be useful to
pass on when editing code in Org Src buffers?

> I've implemented this with the patch attached to this message, if it's
> deemed useful, I can revise it for inclusion upstream (just wanted to
> see what you think about the idea with this one).

Note that in the particular case of lexical-binding and emacs-lisp
blocks, there is the :lexical block parameter -- of course, this is
for execution, not edition, but you can use it as a clue on whether
the block supposes lexical binding or not.

In general, instead of inheriting values from the Org's buffer, I'd
allow users to set the values independantly -- for example, the cdr
of elements in `org-babel-load-languages', instead of being `t' all
the time (because nil makes no sense to me), could contain an alist
of variables and their local values when editing and... executing.

This is: *if* we find cases that seem generic enough.

What do you think?

-- 
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]