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: Mon, 14 May 2018 19:46:47 +0300 Message-ID: References: <87h8najrai.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]:59370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIGci-0001gR-IA for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIGcd-0007yu-HQ for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:46:56 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:42757) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIGcd-0007xj-As for emacs-orgmode@gnu.org; Mon, 14 May 2018 12:46:51 -0400 Received: from alpha.alpha (unknown [176.218.82.110]) (Authenticated sender: self@gkayaalp.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E863C40013 for ; Mon, 14 May 2018 18:46:47 +0200 (CEST) In-Reply-To: <87h8najrai.fsf@gmail.com> (Aaron Ecay's message of "Mon, 14 May 2018 14:33:09 +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: emacs-orgmode@gnu.org On 2018-05-14 14:33 +01, Aaron Ecay wrote: > Hi G=C3=B6ktu=C4=9F, > > This patch looks good, thanks. Of course, for merging to org core it > will need to be an actual patch and not advice. Certainly; this is meant as a =E2=80=98tangible=E2=80=99 example, and can e= asily be turned into a patch if you want to merge this. > There is also copyright > assignment to think of. Do you already have a FSF copyright assignment > on file? I have signed the assignment for GNU Emacs, and contributed a couple patches. IDK if that can be reused here though, but if not I can do the paperwork again. > 2018ko maiatzak 14an, G=C3=B6ktu=C4=9F Kayaalp-ek idatzi zuen: > > [...] > >> One =E2=80=98gotcha=E2=80=99 is that :edit-bindings requires a quoted li= st whereas the >> explicit quote is not necessary with ATTR_EDIT: >>=20 >> #+BEGIN_SRC elisp :edit-bindings '((lexical-binding t)) >> #+ATTR_EDIT: ((lexical-binding t)) > > That quote is required for the src block version is inherent in the > design of babel. For consistency, you could require (or at least permit > without requiring) a quote in the other case as well. I guess requiring that would be better given it can cause confusion if it works one way but not the other. > I think you could replace the (let (var val)...) form with: > > #+begin_src emacs-lisp > (pcase-dolist ((or (and (pred symbolp) var > (let val (buffer-local-value var source-buffer)= )) > `(,var ,val)) > varlist) > (set (make-local-variable var) val)) > #+end_src > > This silently skips varlist entries that are of the wrong shape, but it > would be possible to make it raise an error as in your version. I like > the pcase version better because it=CA=BCs shorter and has fewer nested > conditionals, but it=CA=BCs ultimately a matter of taste. Yeah I can integrate this. I was initially going to use pcase, but I can't understand how it works for the life of me. It's one of the two lisp macros together with loop that I can't get my head around. So, I will turn this into a patch, make the change regarding the initial quote, use pcase, and see how Nicolas responds to me about the #+ATTR_EDIT. --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp 024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427