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: Tue, 01 May 2018 23:04:00 +0300 Message-ID: References: <874ljt3bs0.fsf@gnu.org> <87h8nrkbpw.fsf@nicolasgoaziou.fr> <878t93ioa1.fsf@nicolasgoaziou.fr> <87bmdzbad6.fsf@gmail.com> <876047b257.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]:55550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDbVQ-0004QJ-QW for emacs-orgmode@gnu.org; Tue, 01 May 2018 16:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDbVN-0002xF-HY for emacs-orgmode@gnu.org; Tue, 01 May 2018 16:04:08 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:53409) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDbVN-0002w4-A9 for emacs-orgmode@gnu.org; Tue, 01 May 2018 16:04:05 -0400 In-Reply-To: <876047b257.fsf@gmail.com> (Aaron Ecay's message of "Tue, 01 May 2018 20:35:00 +0100") 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: Aaron Ecay Cc: emacs-orgmode@gnu.org On 2018-05-01 20:35 +01, Aaron Ecay 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=E2=84=A2= 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=CA=BCs best to use =E2=80=9Creply all=E2=80=9D 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... --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp 024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427