From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iP/QOKsewmGKBQEAgWs5BA (envelope-from ) for ; Tue, 21 Dec 2021 19:36:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kKc0NKsewmFyCgAA1q6Kng (envelope-from ) for ; Tue, 21 Dec 2021 18:36:27 +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 A020C23A9F for ; Tue, 21 Dec 2021 19:36:27 +0100 (CET) Received: from localhost ([::1]:43182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzjzu-0001Xm-QC for larch@yhetil.org; Tue, 21 Dec 2021 13:36:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzjz1-0001VB-Ds for emacs-orgmode@gnu.org; Tue, 21 Dec 2021 13:35:31 -0500 Received: from [2607:f8b0:4864:20::102e] (port=36725 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzjyz-0004gG-Os for emacs-orgmode@gnu.org; Tue, 21 Dec 2021 13:35:31 -0500 Received: by mail-pj1-x102e.google.com with SMTP id n15-20020a17090a160f00b001a75089daa3so3402273pja.1 for ; Tue, 21 Dec 2021 10:35:28 -0800 (PST) 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=OGcgSl3vKkn8GAP+0GmjDAIfVxJ97E3UyQvmzrnWG8o=; b=Pe5Ly5peobkZYMSrDAsgw8zmjY696UH6YrGlY4Pn/aIENBD61TYXUWr4AfgSJl5kYb 38r7o2iMLWO51RBygjHbKOuLDTfPJ/85EHHajKB1asM/Q81O5ZUJDBK8CY9vDwZ7wr3W dgB8CH5i6/7blVSXSrVSSbMp1H7ztbcoNcvcc1rFVlNyWJhGw2H0eSX3Njn43P6PFI95 nv1jVsQImLrzU3ZF+vHabsPCETW3tXp62qfy4XsqodxDABtkcPMHa4CpiCPyKebgwuH4 Yica8RF73nvF0vQBZ8lBMzfiEGIkd3vy/7V1OtbVRcphhYhV5KhsygiFvz95e66opiPQ vKgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=OGcgSl3vKkn8GAP+0GmjDAIfVxJ97E3UyQvmzrnWG8o=; b=WAHX2p9OwEd1d1TzA2Cw1IYx/WUG153j9wMad3fO4LQkwBG29go7WgeeDl/hEHETQi d78ll68AYT5PEsmd++lyffEWSTYtZegfuEBpZL1wDBxQAjdyxxghpVWWT7Rezmpqs2Qr F4KEnRw28WgZjm2dzpmzJFqZc99mKk9ojwApTaG/vYnrPxQvoojHlOw0vRXLc8doyiel ynoQ67lMj/8sxBm4kZdh3ofRBlb4bzZUt0iys3dHLXVLXQwM82OA9s8toq/Rlt/hFexG flNPcIPYLjofcZgfL08ICuqc6PoIrMR051+Khsspk/Tq3NWCGimSQD7M1ReQC8HbPkVd TH8Q== X-Gm-Message-State: AOAM5323NuDjlqKoFa7O6dGQVF2TJcOV8gBsPuxDtlfnTDbdhyKuYaJp 3yoniVvXfvtKsF060Dcy73zeOGOLnyM= X-Google-Smtp-Source: ABdhPJyB2lwxTyVC5LFlAehMQr17u+bG5Oej8sRUnIN9q8Y8HF0Sbfq2WBZ+QoRSCZN3cL2E2wIgPQ== X-Received: by 2002:a17:903:1cc:b0:148:f44a:f69f with SMTP id e12-20020a17090301cc00b00148f44af69fmr4279254plh.45.1640111727662; Tue, 21 Dec 2021 10:35:27 -0800 (PST) Received: from dingbat ([124.149.107.194]) by smtp.gmail.com with ESMTPSA id nn16sm3562967pjb.54.2021.12.21.10.35.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 10:35:27 -0800 (PST) References: User-agent: mu4e 1.7.5; emacs 28.0.90 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Parens matching errors in org-babel code blocks Date: Wed, 22 Dec 2021 05:20:54 +1100 In-reply-to: Message-ID: <8735ml7qmx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640111787; 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=OGcgSl3vKkn8GAP+0GmjDAIfVxJ97E3UyQvmzrnWG8o=; b=trpjAM+pzURyhSc1WI+vMZudhHKncru9daK5rR6RFfbZI0DvbcWOuTXLcM8gweCaaPbBL9 G6y4Tv/y2sHo4YrwnlvpuBxyAn8grnzWgu7koLFkcbH0IdXt2XLZ9qMmPO7jH5Jj69ybjk BX+Qcso3km26W/mLEaSER6Hl1eOCMZVsN9g5tWNVLEI75/LtfXzvjjFbGib2sWrunscaFt W4PKg0CwGh9CrB4SzSCtG/ec6iUA2P+RfG+NkeuKFUFYqMqoyPJxiwTBt+cn0fsGzSrT0C 1OYYDMaVCA3j0r8HfczjxFGdc2+WsaR5KmsDXJyM8fRvbBblS6oUVnn4zmgKbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640111787; a=rsa-sha256; cv=none; b=BWCj7v7qSvNJNNWKqGlcA5BWLzojxatF7M6pncAR+YXGLbpXnXsVr7qiIImSm2RVmADkQU 0+s8LvqvsD7uuFrerqla6v8GZnvlcp9obhsRvYB9AvDi3ehkDbb/pC9G692KNye2sFs4Up NgcyUG8vMIqUfHwUL7x+NY5HKw4XQ8XCvtY1W7WPRXAxbtERsRKY6LK4VIMZdeHvobbEjQ npb3wJ3E0utSzO+JalahkrwndSOVs/42bk1rGrhjMHUrWJUm1YuNXW6huHghRKTHrR0eVd fZWRceaiEscM5/gH8rYjEcpz0BZamWOPLpbLzoX0//daoxzM3btoXXDFD/KDgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Pe5Ly5pe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Pe5Ly5pe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A020C23A9F X-Spam-Score: -5.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: tmcLHBP3eq4D I think this is a known problem (Org probably needs a PROBLEMS or KNOWN_PROBLEMS file in addition to a NEWS file). Problem is that org treats things like <> as special paren syntax because they are used by org. Unfortunately, this causes problems with things like paren matching in org files if you also have code which uses these characters 'unmatched' e.g. (< 1 2) or (> 2 1). This is partly due to things like check-parens, which doens't really know about babel code blocks and so just uses the syntax table to find all characters marked as parenthesis type syntax characters and generates an error when they are not matched/closed. Issue is, there is no universal and clean way to fix this which doesn't have unwanted side effects in some use cases or has an impact on speed/performance. There was one solution proposed a couple of months ago which looked promising, but it didn't seem to gain any traction. Not sure why. You can probably find it in the archives. One solution which can work is to modify the syntax table for org buffers to not mark things like < and > as syntax parens. However, this can have other side effects, depending on how you use org. What I do is not have paren matching or run check-parens in org buffers. I also use org-edit-special (C-c ') to edit babel blocks as this gives me the 'normal' language setup and things like check-parens or parens matching work correctly. Eddie Drury writes: > Inside org-babel code blocks, emacs matches parens incorrectly whenever different bracket types (eg <> {} []) are used. > > For example the following in an .org file will cause check-parens to throw an error: > > #+BEGIN_SRC emacs-lisp > > (> 1 0) > > #+END_SRC > > Where in an .el it will interpret the parens correctly. This error also occurs with show-paren-mode and evil-jump-item. > > Thanks very much. > > Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) > of 2021-03-27 > Package: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)