From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: Font lock in org+elisp confused with ?\[ Date: Sat, 03 Apr 2021 20:38:28 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27357"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: Tim Cross , Org-mode , Emacs developers To: John Kitchin Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sat Apr 03 20:39:03 2021 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSlAl-0006zv-Dz for geo-emacs-orgmode@m.gmane-mx.org; Sat, 03 Apr 2021 20:39:03 +0200 Original-Received: from localhost ([::1]:53652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSlAk-0000uX-FP for geo-emacs-orgmode@m.gmane-mx.org; Sat, 03 Apr 2021 14:39:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSlAL-0000tp-Hn; Sat, 03 Apr 2021 14:38:39 -0400 Original-Received: from mail-oln040092074075.outbound.protection.outlook.com ([40.92.74.75]:63297 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSlAJ-0005Xu-53; Sat, 03 Apr 2021 14:38:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSYkgwDK2ulV++oNQ5V0NVrMTPt3wM2fMtevXAQGmBR4cEMbK8lZUeaBlzhVVvIjk1jhGo2ZibmmtD9L+BVdh5llMiwU5qMhhiBR3b+mLCsrPLSaA2b2ywOMO7Co72mvuq3DM2l0OQ5DeRvjL4JFVaxw0o3w4dzYibAJt86ZPYegRePzrq0ecUDbigZCc2C7/TnDcCqu7fdCSOxL2EB9tZ5BLegC09h5Y0f1GDL3HSpFXVZ4TGlA3PMHA2zhVQobgoqTxOAme3q6/JtZTzfLw67n7c6lLpOZEebI80nK6MpxIxGsqmTmOQI2lQwLttH9Pv6DDINCsbFgwPCrBYdSIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=os8yfA88wVZTAd0aT883Eeg4HtVflkjYVB+4xwBAogo=; b=LpE9f7jTXXUgiE/LfndQi1PE/OCo6df3fmE0KLhlY2XPayzjEP3kepgCUwrea0wR9VBsOV2EPsDQbmO89Gqu7Nycw8L4J7ohulbrDsBbKlWt2bDV2uG/g2xIVL9nODaQA4yETcUKN8MArI0h14b03f2l6yFMOlAHxXeTVB5a4dUt1u+S1tZZQ/u8HeUrNHAnSsPx355x+qvkmlWTA/UDfyjMyxGgokBJS1QQMjcFvrpAJPm0RyTaDrj7wZWzdIYjoES3EpmvbeIpZr03qIPRTtmAb0vj//Ci7KfBhYmLw+9UDABs/tF1Gp/7ZSH1WeGGRf5c9aACDqbynWA9gl2jwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=os8yfA88wVZTAd0aT883Eeg4HtVflkjYVB+4xwBAogo=; b=cP/pwbKruDM52moW1e8pOY/KpBm3vJ6gxxmz4gkllE9hBNKxj44I9vNwa4kOoSrEItIcDgTsuCTRQO3Xn/2EiXbM7Oh5djm++AtTTRlwVEPGQQOp7Q4gQAT1kQVDLGx+RDPQB5KDRdMOFtIMCiB08NS8uGgfJF1ft7gaddEn8BiNJ5ymCq/M5EiiFjy6yuFxanFptKiPlp2LOP1ah+5qFibvM2DjtbqSsUynppaqHhPWOYOV4dgvr1FW2+r/1Bavt37MOM/eTNKmsMCCL7IVNyZUVU6aJB4LMp8iioDUkuhS7wW80FEAcEigevGlylrNFkI2AwhryvaJb8WWDq2fZw== Original-Received: from HE1EUR04FT015.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::49) by HE1EUR04HT017.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Sat, 3 Apr 2021 18:38:32 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0d::46) by HE1EUR04FT015.mail.protection.outlook.com (2a01:111:e400:7e0d::74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28 via Frontend Transport; Sat, 3 Apr 2021 18:38:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:58D65616048A1696B6CC869648C729692267007695E07D38266921051E2AE34C; UpperCasedChecksum:1B515375FD41C1F5BE29B5831384F60DEFAA6FD1304E2FEEC71625C2451278E2; SizeAsReceived:7716; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.3999.032; Sat, 3 Apr 2021 18:38:32 +0000 In-Reply-To: (John Kitchin's message of "Fri, 2 Apr 2021 09:03:53 -0400") X-TMN: [m/vtpfq0ut84ZWMsEWtJNmodrD/RMwPI] X-ClientProxiedBy: AS8PR04CA0085.eurprd04.prod.outlook.com (2603:10a6:20b:313::30) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82sg47tdqz.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AS8PR04CA0085.eurprd04.prod.outlook.com (2603:10a6:20b:313::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26 via Frontend Transport; Sat, 3 Apr 2021 18:38:29 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8a67f028-6dd4-4561-e9ee-08d8f6cfae45 X-MS-TrafficTypeDiagnostic: HE1EUR04HT017: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XnGMfqpjUKcfFmnyu1d4Zm+RDcvfblcyILU6ivjMFAo6Uw8f948v9s3dft9v3Ap5Lw5z8XeBSlaWVtZMLIjvrUygKBKARDCd7vGMs2kF/g5Y1W0EAnHqLXPWjH32muhUFXdoy2YNUpjLeWA4aLWw1gv74gwAj2A7Q/p48OscSiRLL8UaIUhfMnI0hAuiDfy8ntpO9qYYKYNClFAgrDvc98sceMFt8Z3nCb+ZLwqTr2UwR8D53zKfT/zHYAJA/owr1t2Lm6dsOis4TCp9lM85LCC0vh6TjAaIp/4iIN26Nr46j6ryZthAW0Z0tXsii5OxvZGz/k9kl+by5bOQJXVm04LL1mFzjKG3+P3e+7HaHAFaeUHtgHDj23wZAimBQL0r15HK7rAm+XkQNESneiXyFeJUW4K1byJ+ZhckdIHVLHQWvfIRvevBeZn9bEiM52ZH X-MS-Exchange-AntiSpam-MessageData: XVWMR17yyI8vpozlmD/fe50O5Y0gzKmGE5pAnLG+YP9eRWBFGwxQmf1kwR7yKAoIVao6SCy4Msb/AaR8j2eL3JcyYKPeujjnB0M1ouAh51JXZAvIf0UvkTBCKHhy5zbG6Ru5s8ihCppzNCXGIZmxtg== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a67f028-6dd4-4561-e9ee-08d8f6cfae45 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2021 18:38:31.9637 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT015.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT017 Received-SPF: pass client-ip=40.92.74.75; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-obe.outbound.protection.outlook.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-orgmode" Xref: news.gmane.io gmane.emacs.orgmode:135841 gmane.emacs.devel:267360 Archived-At: John Kitchin writes: > This is related to the issues with <> in src blocks. [ and ] have open and close syntactical meanings like < and > do in org files. A similar solution as found in > https://emacs.stackexchange.com/questions/50216/org-mode-code-block-parentheses-mismatch seems to work to fix it. Indeed, the code from SX works, I took the simpler version and converted it to work with square brackets: #+begin_src emacs-lisp (defun org-mode-sqbr-syntax-fix (start end) (when (eq major-mode 'org-mode) (save-excursion (goto-char start) (while (re-search-forward "[]\\[]" end t) (when (get-text-property (point) 'src-block) ;; This is a ?[ or ?] in an org-src block (put-text-property (point) (1- (point)) 'syntax-table (string-to-syntax "_"))))))) (defun org-setup-sqbr-syntax-fix () "Setup for characters ?[ and ?] in source code blocks. Add this function to `org-mode-hook'." (setq syntax-propertize-function 'org-mode-sqbr-syntax-fix) (syntax-propertize (point-max))) (add-hook 'org-mode-hook 'org-setup-sqbr-syntax-fix) #+end_src I have confirmed that code runs when I load my org file, but there seems to be something else than that callback involed, later on, evaluating and changing those properties back. I still see same error in the babel-block. However when I run fix explicitly on that code block (I converted it to interactive "r" for test), then syntax is fine. So it seems there is some other callback involved. Sorry little bit late answer, I thought I sent this a day ago or so, but apparently I didn't. Thanks for the help.