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: Göktuğ Kayaalp
Subject: Re: [O] Inheriting some local variables from source code block editing buffers
Date: Tue, 01 May 2018 23:04:00 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On 2018-05-01 20:35 +01, Aaron Ecay <address@hidden> wrote:
> Thinking about it some more, lexical binding is not a good case for
> this feature, since it has to be set not only in the edit buffer, but
> also when C-c C-c is used in the org-mode buffer to evaluate the src
> block.  The :lexical header arg (which I did not know about) works for
> the latter but not the former.  To complete the picture, Someone™ needs
> to implement a org-babel-edit-prep:emacs-lisp function which looks for
> :lexical yes in the header arguments and sets the value in the edit
> buffer appropriately.

I can (and plan to) take on that task once a design is agreed upon.  I
don't really know much about Org internals, but I think I can figure
out.

> If lexical-binding is the major motivating factor, then maybe the above
> is enough.  My original suggestion was for something like:
>
> #+begin_src emacs-lisp :edit-vars ((fill-column 72) (other-var other-val))
>   ...
> #+end_src
>
> This would set the variables in the edit buffer in the (hopefully)
> obvious way.  It is not implemented yet, though.

I do like that syntax.  A minor addition might be for the case when one
wants to pass the value of a variable local to the org buffer to the
editing buffer:

-*- fill-column: 65; indent-tabs-mode: nil -*-
#+edit-vars: (indent-tabs-mode)
#+begin_src emacs-lisp :edit-vars (fill-column (lexical-binding t))
;; here, when editing, fill-column is 65, lexical binding is t
;; and indent-tabs-mode is nil
#+end_src

> PS Itʼs best to use “reply all” and include the org mode mailing list in
> replies, to make sure everyone following the thread sees all the
> messages.

Whoops! Sorry, yeah, I have been hitting the wrong keybinding for the
last couple of messages I think...

-- 
İ. Göktuğ Kayaalp       <https://www.gkayaalp.com/>
                         024C 30DD 597D 142B 49AC
                         40EB 465C D949 B101 2427



reply via email to

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