From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0CT2LXUnMmGhCgEAgWs5BA (envelope-from ) for ; Fri, 03 Sep 2021 15:47:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +BytKXUnMmHaOgAAbx9fmQ (envelope-from ) for ; Fri, 03 Sep 2021 13:47:33 +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 0343F22422 for ; Fri, 3 Sep 2021 15:47:33 +0200 (CEST) Received: from localhost ([::1]:43548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM9XY-0002Ym-20 for larch@yhetil.org; Fri, 03 Sep 2021 09:47:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM9WL-0000kE-66 for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 09:46:17 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:39784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mM9WJ-0005wz-3Y for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 09:46:16 -0400 Received: by mail-pj1-x1036.google.com with SMTP id mj9-20020a17090b368900b001965618d019so3830649pjb.4 for ; Fri, 03 Sep 2021 06:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=t0KxSKi3lGEZ7sCcZEIvgP5O1z0V44fdbBM0g1iU9Ls=; b=FXqXxaDJM2H48jngg5gvdcYiOb2plJgMsWjYjHJO9cZd4zOPCsup8od+ZpRdqWtUqA 5oHUWciezu1Uw3DJbwBhwmNzBTz1zykhupTBiKCBLQn5eTUK0zgPYQQeBO2NutCkqvqg VFPMN4p/add5OIL5ybE60Cy2nyMLe8+ny7DpjNOKh/kyeAS6NdcUdubY3iM5pMUyjlLM yJ3iqPvuYfidVoUMmRlZ1BLxsvxxvq3xMM6ea2TcEM8ZorlVDENtOqyNOqiaXnPlBjvK 3Jj40cyGxgq51KMtSW1uuZPAtfcXHY2ZsLZN/jRXuxJfqCsEIQTBbZ6v0LKnaCAB5b50 /wgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=t0KxSKi3lGEZ7sCcZEIvgP5O1z0V44fdbBM0g1iU9Ls=; b=A37JYZZA8Vam3Ny1n5fd5vExBsc0tw2m2Y4RDG5Cm2yGarbJfjMPdA3bk55ZegS/e6 wN/j45jg4TB9uZs8c4ad1ugkQkQp/OqsnNrG4kryfboe5vDFMyI+vq0Y6e33fDMAYOoG DtoKEjUEgsSTVJjrDibNeSbrgAlwJhLRF8FyyAwQ+4xkd3BbaUeIpi47hWB41kO573pw x+45bf4dD1o0ebANTJuKMFKJ4xROtAc1btC2fruGsfGU5HY4ra2akfCSzPxEmc4cCxHM zUdkeUqpd1ugSYNe4bteahzcbSSPlyv9ac5jALjhTggL8EWHiftOjXpa2wpcDQwKzugb nb/Q== X-Gm-Message-State: AOAM5311r8QOJXzKoPaby6kafIVIw7NXS/6J6yMrcj2+p2UvlY1cop+u NtUGBzyGU2iWbkvtTrL/QgofdEil9ww= X-Google-Smtp-Source: ABdhPJw2PLJ0SdjMTBctLhlmKhU0dbHGSd2kuZ62SjWLA6RAf7EfBOKi+t2+Jox36V7JaNqoDVWfPQ== X-Received: by 2002:a17:90a:6907:: with SMTP id r7mr935813pjj.226.1630676772402; Fri, 03 Sep 2021 06:46:12 -0700 (PDT) Received: from tim-desktop (106-69-148-14.dyn.iinet.net.au. [106.69.148.14]) by smtp.gmail.com with ESMTPSA id ga19sm5468466pjb.27.2021.09.03.06.46.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 06:46:11 -0700 (PDT) References: <3b398cbe-19d5-7006-d854-4a8693d217bb@verizon.net> User-agent: mu4e 1.7.0; emacs 27.2.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Bug Re: Greater than, less than bug in emacs-lisp source block Date: Fri, 03 Sep 2021 23:40:06 +1000 In-reply-to: Message-ID: <87pmtpojq8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1036.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630676853; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t0KxSKi3lGEZ7sCcZEIvgP5O1z0V44fdbBM0g1iU9Ls=; b=konP7OKxFaPkzVSFNx7X35/Ry5tK5JEOdA5yFX0MwOv/IJpwweZ7sqqmpYTwoVCcjT12dv l24SXF/Yu/Lj8sAq1CDmliNf2/igcLtqkzTdn3gzxLHE5XJLdhkJFOsYb/Ae1QfZF3h9Re le9qtXra7p3yzcTytJZ3KsaRO1ggPhPt8JAT1nZ2TyySiv+zkgoOeBqy5sB1NVq8vQ4ige 4ckN7LteaNUdbEbfZzueBnxlsDfCEysuQrJnzz7boRvl879y19QqqoVTenlfDF/QhCevkF +nvjPtNQcsC8u7g13zS+fWGhfk2WP+kwHNnOwj293rSBxMfGblYMcq3A5ryulw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630676853; a=rsa-sha256; cv=none; b=DXYeVdjAc2fNVYXLnH9dboTzWhWYxVQUdTqRDD8wn4gqIPVzcWvbL9aB88Inuw7NoqlThx dgWubsN6EHmYUlhO+HPDLVDD+o+6Kjccfu5uENeXUfZZ4lsMsUxkL0IPpcQ/cRUtwrPWuD fiFwzs1eL9BbwOMzyKodwVNxccaQOJMXNMkTrRriS15RKOhGteVt+CNqqo0QbXsTi1+lfv KaDE5CxcAp3fTkdSeT+R1z/Qt4TnpmnJKu95NqhRLWVY4XYndRMwJ5mYdvGegZ6TeSVqSJ H+1bbZJ/wkx3ZHh2heglIO10NNEbJCwq46OwivAgc1T6vt/j5sqe0FVnIbEa1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FXqXxaDJ; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FXqXxaDJ; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 0343F22422 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: TDJdoy/ZVimY I think what is happening here is that org is bumping up against fundamental design limitations of Emacs. In basic terms, much of Emacs' underlying design is based on an assumption that a file only has a single major mode. Org works hard to get around this limitation, but it comes with cost - usually either performance or complexity. I think this could probably be characterised as a bug without a workable solution. While there are things youc an do, they all seem to have unwanted side effects. To what extent those side effect impact you depends on your use case (as John points out, if you have blocks of HTML or XML or JSX etc, changing the syntax table to make < and > 'normal' characters would fix the elisp issue, but break things in those source blocks. So really, what we have is an issue without a clean solution. Best anyone can do is select one of the proposed work-arounds which has minimal impact on the user. Personally, I never edit source blocks except in the special edit mode, so don't really notice the problem with mismatched parens. John Kitchin writes: > That is probably a matter of opinion. > > If you use angle brackets as delimiters, e.g. in html, xml in src-blocks, then the current syntax definition makes sense because > you can use them to find open and closing brackets, navigate them, etc.. If you don't use those, it makes less sense, and maybe > isn't even something you want. > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > On Fri, Sep 3, 2021 at 7:42 AM Charles Millar wrote: > > Thank you, John. > > I will give it a try. > > However, is this a bug that should be fixed within org source code? > > Charlie Millar > > On 9/2/21 2:24 PM, John Kitchin wrote: > > I think this issue is described in > > https://emacs.stackexchange.com/questions/50216/org-mode-code-block-parentheses-mismatch. > > There are also some solutions there. > > > > > > John > > > > ----------------------------------- > > Professor John Kitchin (he/him/his) > > Doherty Hall A207F > > Department of Chemical Engineering > > Carnegie Mellon University > > Pittsburgh, PA 15213 > > 412-268-7803 > > @johnkitchin > > http://kitchingroup.cheme.cmu.edu > > > > > > > > On Thu, Sep 2, 2021 at 2:10 PM Charles Millar wrote: > > > >> Set up: > >> GNU Emacs 28.0.50 (build 344, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, > >> cairo version 1.16.0) of 2020-12-31 > >> Org mode version 9.4.6 (release_9.4.6-637-gd70f28 @ > >> /usr/local/share/org-mode/lisp/) > >> > >> The following code will evaluate > >> > >> #+begin_src emacs-lisp > >> (defun Foo () > >> (if (= 2 4) bar)) > >> #+end_src > >> > >> #+RESULTS: > >> : Foo > >> and the opening and closing parentheses match. > >> > >> If a greater than is inserted instead of equals, thus > >> > >> #+begin_src emacs-lisp > >> (defun Foo () > >> (if (> 2 4) bar)) > >> #+end_src > >> > >> it apparently evaluates, however, the closing parenthesis immediately > >> following the "4" is paired with the opening paren before "if" and not > >> the opening paren immediately before the ">" > >> > >> A "less than" results with stranger parenthesis matching - the closing > >> paren after the "4" matches no others; the closing paren immediately > >> after "bar" matches the opening paren before "if" > >> > >> Charlie Millar > >> > >> > >> > >> > >