From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: Inheriting some local variables from source code block editing buffers Date: Tue, 01 May 2018 20:35:00 +0100 Message-ID: <876047b257.fsf@gmail.com> References: <874ljt3bs0.fsf@gnu.org> <87h8nrkbpw.fsf@nicolasgoaziou.fr> <878t93ioa1.fsf@nicolasgoaziou.fr> <87bmdzbad6.fsf@gmail.com> 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]:49591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDb3M-0006KY-UA for emacs-orgmode@gnu.org; Tue, 01 May 2018 15:35:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDb3I-0007Oz-5T for emacs-orgmode@gnu.org; Tue, 01 May 2018 15:35:09 -0400 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:43025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDb3H-0007Op-UT for emacs-orgmode@gnu.org; Tue, 01 May 2018 15:35:04 -0400 Received: by mail-wr0-x22d.google.com with SMTP id v15-v6so11681288wrm.10 for ; Tue, 01 May 2018 12:35:03 -0700 (PDT) In-Reply-To: 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: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp Cc: emacs-orgmode@gnu.org 2018ko maiatzak 1an, G=C3=B6ktu=C4=9F Kayaalp-ek idatzi zuen: [...] >> The approach that should be taken should be to use a header argument to >> specify an alist of variables and values to set in src block edit buffer= s. >> Then the usual methods (info "(org) Using header arguments") could be us= ed >> to control the feature globally, per-buffer, per-language, per-subtree, >> and per-individual source block. >=20 > I agree. But note that what I want to do is to set some buffer local > variables in the special block editing buffer. The header argument > ":lexical yes" seems to not affect the editing buffer 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=E2=84=A2 n= eeds 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. 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. Aaron PS It=CA=BCs best to use =E2=80=9Creply all=E2=80=9D and include the org mo= de mailing list in replies, to make sure everyone following the thread sees all the messages. --=20 Aaron Ecay