From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YPNZJdrqZWCD6gAAgWs5BA (envelope-from ) for ; Thu, 01 Apr 2021 17:46:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KIkvH9rqZWAmaAAAbx9fmQ (envelope-from ) for ; Thu, 01 Apr 2021 15:46:34 +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 119A11FDEF for ; Thu, 1 Apr 2021 17:46:34 +0200 (CEST) Received: from localhost ([::1]:51450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRzWi-00016A-7g for larch@yhetil.org; Thu, 01 Apr 2021 11:46:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzVu-00015z-Kz for emacs-orgmode@gnu.org; Thu, 01 Apr 2021 11:45:43 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:59039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzVq-0003lX-Qn for emacs-orgmode@gnu.org; Thu, 01 Apr 2021 11:45:42 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 2AC73C000B; Thu, 1 Apr 2021 15:45:34 +0000 (UTC) From: Nicolas Goaziou To: Tom Gillespie Subject: Re: Bug: inconsistent escaping of coderef regexp References: Mail-Followup-To: Tom Gillespie , emacs-orgmode Date: Thu, 01 Apr 2021 17:45:34 +0200 In-Reply-To: (Tom Gillespie's message of "Mon, 4 Jan 2021 15:33:19 -0500") Message-ID: <877dlmhuu9.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.198; envelope-from=mail@nicolasgoaziou.fr; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: emacs-orgmode 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=1617291994; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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; bh=/USCmhTkAW2FUqb1NytdOk8LH1C6tJTSvUve5oF6uFI=; b=FdM4NJL9o903PGBikOahv2aoF5zDnCfKpdpA5UK6uw5pD9nZj+LlD/sC0Vcy1kCzE4qcjc 9KNya/mVOF0vWZtiYEjF7vEHLlPRUISnjE5twyvZ4lgLJSDgy78njsZNRRirLg4VPeS9Bb 3k/Z+hw6qnziUXAspQf/uaaZfwlOo9HpjMJerJBL3xhWEpqcLG3bvMErj+p1ubqkKLnEyR PWLLXS4HL7QarlupSKxUc02FbUiVgIHIUbFB3/hHbuFc0YOO771RkMwGh11gme682ce9aa cyaA0U9Bf0SK8FsL+3j/yljBkI4p8NUuYSzrb+GjK4BpQ98UVnN4FbS4MKLQ/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617291994; a=rsa-sha256; cv=none; b=uOTQOUvAIrLz7Tux7WW80k23BcTGj9+FoBqXLuDeSxNfFkXqkZhRICwmoWnW47ABACgcWQ JFHQGsL4PlgiVg4bt0Fy0exYAXhfr0wZrDiDqJYRlbRdGEAR2PsTExf6fB0vNhcJ5ZsX8M vRxfZphcz9db/KQiNPLFEI34jZePgrTOAzVDwSlA74cEAvBXw12GQqh5v2jfJpFF/Wm0fm 7f5kjRHk4wzkz7lUrFwnYfNAeXytsHyk6ZQwl8ZZ9jz9Ekk82HW9VXJX2NaU33Fysubisd zQ9CGzcVfqB2pI+YH/vsKv+IkcBUOGNabPznBhFa0gqQ4x97GB9PuHRSpRIK5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Migadu-Queue-Id: 119A11FDEF X-Spam-Score: -2.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: o9Dy8m2YpCEq Hello, Tom Gillespie writes: > It is not possible to strip coderefs when tangling and also search for > those coderefs using org-link-search. This is because org-link-search > uses org-src-coderef-regexp which calls regexp-quote on the regexp > string while org-babel-tangle-single-block does not and uses the > regexp string directly without quoting it. I'm not sure about the best > way to fix this. It seems to me that the call to regexp-quote should > be removed but I'm not entirely sure of the consequences of doing > that. Thoughts? This would be wrong. A format string is not a regexp, and therefore needs to be quoted. E.g., one might want to use "/* %s */". `org-babel-tangle-single-block' should make use of `org-src-coderef-regexp' and, possibly, `org-src-coderef-format'. > PS While on the topic of coderefs, let me drop a note that is a > preview of some of the issues I have encountered while working on a > full formal grammar for org. Having the -l switch control this is an > awful design that induces more complexity into the org-mode grammar > than nearly any other feature. Source block switches are completely > inconsistent with the rest of org and completely undiscoverable. I had > no idea they even existed until I was trying to figure out which > header argument could be used to set the coderef regexp. The -l option > and switches in general need to have their behavior implemented as > part of the standard header arguments like everything else so that > users can migrate away from switches with an eye toward removing them > entirely. Switches predate Babel and its header arguments. Also, they are orthogonal to Babel. I don't know what a sound design would be here, tho. Regards, -- Nicolas Goaziou