From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id NOASAD7hzF6qEAAA0tVLHw (envelope-from ) for ; Tue, 26 May 2020 09:28:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6PrvNj3hzF7JAwAA1q6Kng (envelope-from ) for ; Tue, 26 May 2020 09:28:29 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 513389400B1 for ; Tue, 26 May 2020 09:28:29 +0000 (UTC) Received: from localhost ([::1]:46512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdVso-0001Vj-KT for larch@yhetil.org; Tue, 26 May 2020 05:28:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdVsT-0001VX-EU for emacs-orgmode@gnu.org; Tue, 26 May 2020 05:28:05 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:36654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdVsS-0002Ut-Im; Tue, 26 May 2020 05:28:05 -0400 Received: by mail-pj1-x1036.google.com with SMTP id q24so1044943pjd.1; Tue, 26 May 2020 02:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=74tXPOF00hEKwjodJcoJLKOo0TNHo9EcFEwfxDRWku8=; b=t7/bczlp22fM4xukVZ3xVMd/E8hJNviNv8T7eoqq7LHlVIeK2xj7yK0kzGucZV0PFx WCRjQhb7XMsKBCDI6YH4V/t+Ae14Ed5TQA1IyabhZva1cpXO5QTEu9iuVxD5CZeOOQzR cXHsa5+cFGH3iapXW8slLxqrW3agrdNHhJA/FQrCy2kk+HkbLIVp5UezugiuCmaR68kR tIcIaYd0U4bThdQ+QEgTc2AkOF0+oZj0xYrxEeYj8VorxVIt92GvNa9Ybij6c9ARkA7Y VyWsrVmFu9sCrmApX1GvIUpdsaviczW+aSBIVZ22Q+4lLROyEhRCkzqTw+Q3CGtsKRuM Y65A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=74tXPOF00hEKwjodJcoJLKOo0TNHo9EcFEwfxDRWku8=; b=n3GkCs5m0QeAXgSWTA5nuZ+/AE+USKCNXEuyUKtBgNwY1jOzx5JyhrUB/cixMRAaOU a8dLRARZKbaR0GiLReFAh7PqFJJXwuPYtEgxVHUbSOdoOvn3SoeK7DtWZk25TJ+3TR2r dNZ6Lh61KJkAmQpNrI88NVKdAaemJtap+gefY4XKbnXOw2Q3aitAjoYgveoWVv3DeO7a 0HAtnZ32VEI9Arlrhvfrejq6bebkSGQkRo5bZz2SDVKZcpTKqMEj1BrZj2wcV+OZDEzw fApzRUeXpQE4uo+2cDFFsaJyi3L1tJDRa6S+nuh0LFXEQ5YJRZ0NlUsqJvxvznYL4dFp gvdQ== X-Gm-Message-State: AOAM530ZSQ5JyBwlWrp3d4csDZ9QmuCgSBdCkLd8dZ8bNLBXkK/vxzBZ HYh8fxPtjl166ErsBnZdv2IopgqYaDQ= X-Google-Smtp-Source: ABdhPJzpzndAkqraNwK0BLQz062o7bcsw4/5kL8hftoWZF/xYifadIlaxz2mMQd2xYUY366NsJSDfQ== X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr225911pll.278.1590485282705; Tue, 26 May 2020 02:28:02 -0700 (PDT) Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id p10sm4397393pgh.61.2020.05.26.02.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 02:28:02 -0700 (PDT) From: TEC To: Nicolas Goaziou Subject: Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \] Date: Tue, 26 May 2020 17:23:21 +0800 References: <87wo4z6sec.fsf@nicolasgoaziou.fr> <87mu5v6oy2.fsf@nicolasgoaziou.fr> User-agent: mu4e 1.4.6; emacs 26.3 In-reply-to: <87mu5v6oy2.fsf@nicolasgoaziou.fr> Message-ID: <87lflf82qp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x1036.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=t7/bczlp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: OF2HYB3wbNgQ Nicolas Goaziou writes: > Without hesitation, the first form is nicer. The second one is > just abusing let-binding. I die a little just by looking at it. I'll make an attempt to avoid killing you then :P > See `rx' macro. S-exp regexps are usually easier to read (after > an initial struggle), and less likely to introduce subtle bugs. > For long regexps, this is important. For this one, either way is > fine. I'll just remove the -p and be done with it then. > Well. Ideally, let-binding should enclose the minimum part of > the code that needs the binding. Sometimes, an exception is > tolerated, because the code would contain too many nested > let-forms. But, conversely, you shouldn't stuff every local > variable at the beginning of the function and be done with it. > > In this particular case, there's no reason to stuff the `length' > call at the top of the function when you need it later on, on a > well-defined S-exp. IOW, it is more idiomatic to just add a > let-binding around the appropriate (add-text-properties ...). Somehow it feels like overkill to have (let (contents-length (length contents)) ...) when it's only used twice :P > But it should be ", so remove newlines." Gah! >> I recall being asked to list modified/added functions, what >> else do I need? > > Nothing else. Should be good then, as far as I can tell. >>> Bonus points if you can add some tests in >>> "testing/lisp/test-org-src.el". >> >> I'll have a look at that, but I'm not quite sure what to do. > > You could look at `test-org-src/footnote-references' for > inspiration. However, I assume tests will be less complicated > for LaTeX fragments. I'll have a look. > We're almost there, then. Nice! :) I'll try to send through the next iteration soon.