From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Capture template stopped working: nil Date: Sat, 01 Jul 2017 11:03:37 +0200 Message-ID: <87mv8o4jh2.fsf@nicolasgoaziou.fr> References: <7d3e8e78-24ff-f8ba-8931-38014f109b66@xgm.de> <87d19r51fy.fsf@nicolasgoaziou.fr> <87y3sfdf95.fsf@gnu.org> <87h8z3zuhl.fsf@nicolasgoaziou.fr> <87efu7zrmr.fsf@bzg.fr> <878tkfzr17.fsf@nicolasgoaziou.fr> <87a84pslz2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dREJg-00016X-Rs for emacs-orgmode@gnu.org; Sat, 01 Jul 2017 05:03:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dREJf-0002O9-Tn for emacs-orgmode@gnu.org; Sat, 01 Jul 2017 05:03:48 -0400 In-Reply-To: <87a84pslz2.fsf@gnu.org> (Bastien's message of "Fri, 30 Jun 2017 14:23:29 +0200") 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: Bastien Cc: Florian Lindner , emacs-orgmode@gnu.org Hello, Bastien writes: > Nicolas Goaziou writes: > >> Bastien Guerry writes: >> >>> May I ask you why `eval' in the code base is problematic? >> >> Because 1. it is hideous, 2. it doesn't cope well with lexical >> binding. > > Can you provide with an example on how `eval' can lead to trouble > due to lexical binding for the org-capture configuration? > > I'm trying to understand. I never said `eval' could lead to trouble due to lexical binding in Org capture configuration. I said `eval' is a problem in the code base, notwithstanding its location. Moreover, allowing Sexp in a capture template is really abusing homoiconicity of the language. As soon as the S-exp becomes mildly complex, the resulting template is unreadable. OTOH, using a function right from the start clarifies the structure of the template. The occasional `(concat a b)' is not a sufficient reason, IMO, to allow `eval' there. We should encourage saner practices. >> Using `eval' should be made with extreme parcimony and for very >> consensual reasons. > > Yes, but unless we fix a realistic bug, not bothering the user with > backward-incompatible changes should take over IMHO. Let's consider `eval' in the code base a coding design bug, then. A clearer code base (e.g., more comments, less obscure variable names, more expressive syntax) is something we should strive for. Anyway, this is a rather small incompatible change we're talking about here. In particular, it doesn't change document syntax. It's a straightforward modification of some configuration. Not as bad as it sounds, really. Note we already did the same for `org-file-apps' in Org 9.0 (although the reason was different). Regards, -- Nicolas Goaziou