emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Göktuğ Kayaalp" <self@gkayaalp.com>
To: emacs-orgmode@gnu.org
Subject: Re: Inheriting some local variables from source code block editing buffers
Date: Mon, 14 May 2018 19:46:47 +0300	[thread overview]
Message-ID: <ygmbmdii3rc.fsf@gkayaalp.com> (raw)
In-Reply-To: <87h8najrai.fsf@gmail.com> (Aaron Ecay's message of "Mon, 14 May 2018 14:33:09 +0100")

On 2018-05-14 14:33 +01, Aaron Ecay <aaronecay@gmail.com> wrote:
> Hi Göktuğ,
>
> 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 ‘tangible’ example, and can easily 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öktuğ Kayaalp-ek idatzi zuen:
>
> [...]
>
>> One ‘gotcha’ is that :edit-bindings requires a quoted list whereas the
>> explicit quote is not necessary with ATTR_EDIT:
>> 
>> #+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ʼs shorter and has fewer nested
> conditionals, but itʼs 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.

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

      reply	other threads:[~2018-05-14 16:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-29 17:19 Inheriting some local variables from source code block editing buffers Göktuğ Kayaalp
2018-04-29 22:09 ` Bastien
2018-05-01  3:30   ` Göktuğ Kayaalp
2018-05-01  8:43     ` Nicolas Goaziou
2018-05-01  8:45       ` Nicolas Goaziou
2018-05-01 11:41       ` Göktuğ Kayaalp
2018-05-01 11:55         ` Nicolas Goaziou
     [not found]           ` <ygmvac7lcl1.fsf@gkayaalp.com>
2018-05-01 14:00             ` Nicolas Goaziou
2018-05-01 16:37           ` Aaron Ecay
     [not found]             ` <ygmin87kwua.fsf@gkayaalp.com>
2018-05-01 19:35               ` Aaron Ecay
2018-05-01 20:04                 ` Göktuğ Kayaalp
2018-05-01 20:53                   ` Aaron Ecay
2018-05-01 22:12                     ` Göktuğ Kayaalp
2018-05-01 22:19                       ` Aaron Ecay
2018-05-01 22:26                       ` Göktuğ Kayaalp
2018-05-02 10:16                         ` Nicolas Goaziou
2018-05-02 19:52                           ` Göktuğ Kayaalp
2018-05-01 11:45       ` Göktuğ Kayaalp
2018-05-14  5:44 ` Göktuğ Kayaalp
2018-05-14 12:13   ` Nicolas Goaziou
2018-05-14 16:34     ` Göktuğ Kayaalp
2018-05-14 16:47       ` Nicolas Goaziou
2018-05-15 18:36         ` Göktuğ Kayaalp
2018-05-18 21:48           ` Göktuğ Kayaalp
2018-05-19 12:26             ` Nicolas Goaziou
2018-05-21 14:20             ` Aaron Ecay
2018-05-14 13:33   ` Aaron Ecay
2018-05-14 16:46     ` Göktuğ Kayaalp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ygmbmdii3rc.fsf@gkayaalp.com \
    --to=self@gkayaalp.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).