From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CMTCG62WP2ZDoAAAe85BDQ:P1 (envelope-from ) for ; Sat, 11 May 2024 18:02:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CMTCG62WP2ZDoAAAe85BDQ (envelope-from ) for ; Sat, 11 May 2024 18:02:53 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EG4RCLkE; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715443373; 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:dkim-signature; bh=blqS4L32y50xA2FvUwDfJeLqpmC3slj54+z0df8aT4Y=; b=Cxhr5VyjalWwI139MqMQE7aqAk+0WwkHLhsGQ5ZgketFfAyZ2dk8/W1+FSc0m2BDoELVC2 wMqWk2NAVh/7vxg06uixG6/0Qq1A9WmAO1sxveCRygosyLtoXrFewIS3UyVjqB2VFHwA64 Hy7V3IMAEMiWHrnQKAk1t4b2oUQND2m25p0aKN0aXjZOyqP19ybuty81P/404jCPAwVv5X Ro1Vs1Cal9GJdGdIMtHKBh+ZJxfCaqDf4b7KiF6Am+k3O1x06VxXMuTJH/4GDfeJAJzDuP OY+Kcql+NG0nngsBVU1rDUM1bj1GcpgpuhFJZ2H1elk4DRQlcEKcjAtd9ynjAw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715443373; a=rsa-sha256; cv=none; b=KorpBwl2yy217lql2lU+NN+oiIF3H8RrmJNHm9lQeCuHdBjcoFTJun94GvPoYqZXM6Ipip fXc99KKvtEB/BfCbOvsPhb7zMU5nIfjVqcRqL2a5+MYiCx2a3XDDYrfex2lOoPa1QtYvQv AbjfLO3EZB9YlXfsGyJHqB9d1kbB2wwm5uMNcMvvipUoEwrleUro2o2HbywMhkPOYIvUq3 t5k+HpdATyWV0cxDHF9iQGhVCNVSt3GLK0c4O0wh0DF5vqhExe7WDfNpufViKxvHFtKqnA vOnvenqbJETJCJN+6rQiaOkJQLoZCMCFPuBUoAk9lRuR+j9vuw9er09ZUqGOmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EG4RCLkE; 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" 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 2411D3CB27 for ; Sat, 11 May 2024 18:02:53 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5pAV-0004Ni-UI; Sat, 11 May 2024 12:01:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5pAS-0004Mb-Ux for emacs-orgmode@gnu.org; Sat, 11 May 2024 12:01:49 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5pAR-0000ky-2B for emacs-orgmode@gnu.org; Sat, 11 May 2024 12:01:48 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6f0f80b780fso237467a34.2 for ; Sat, 11 May 2024 09:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715443305; x=1716048105; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=blqS4L32y50xA2FvUwDfJeLqpmC3slj54+z0df8aT4Y=; b=EG4RCLkE16C/m/TH4hNv+MAGOU14n9WOSB5BD+mJpkr6U3EZ+XOkyB+KHeXlm0dJ4v /QCC495aIIy3yJnh9FzG22innuzQk74PY8qpC51Z9Ie9mHWldUyxUOpw+llAhgYScHa2 SUjAw5z3Xeup3/t2EnR0ceoLtFDs15hnZLJZy6aoBXzEnrqBgzhwfEUHOF/rw3graBoU L+z7X7DA0zxq5nTh4wZiiNChbCsgPeVLDcNSpReB9Otyo2h7EV8H7BXl/OUUWoVLb7nX YhHZvboJcrA3yPikgu45YPckLcRVaURyKTSqZfSh9A1p1Osmmg7qWaYaurr+ZzhhMTBr oPHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715443305; x=1716048105; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=blqS4L32y50xA2FvUwDfJeLqpmC3slj54+z0df8aT4Y=; b=Oq152y4MdVDFKXfmcFA1caJQoPrXxXdlLIag10UAYk+jLsN3lBPRPiCpZcSHcNHtPZ OCfMZDozjBtYAfGJ/FGJ5qVpv7fs3ahoEZgo1fHL2LVTE0D0gCcGGpGoCo+BayPgUbwI CwQ1IMrYf8hjMjP5wgdx09QnFAhe/QM5bDTAxbny6sQhJgtprQsTvjzdHwYAcQxeBb6+ tmwqfjTkmYIUmeKkUJOVpHiCSRbai7PHrNQ7QMmyjCe0TTqOrmeEhWXm6+SIaolGvvKM EKGWbLASaQJf/94rC66E5lchPOXM4sk7uowjJUm3zwk3xVB0kYZl1UfyOI33s+Mo0F5N Nkrw== X-Gm-Message-State: AOJu0Yw2WkepiwdaD9D531+7Sv8rB5NNbeoR0SyfKG5D8GFO4Mh+nZ91 rYiDCDivIYc9LBcQ5omoQru/m59xrLxC5QldJZzp2HntrYCuyHwFdxi3wA== X-Google-Smtp-Source: AGHT+IELGpV/eljjop01FEGPlY6qiKBZtMCCvfv898Bsy5VTeTFCqUBIfV8IPBYZtliUNabrCBlU3A== X-Received: by 2002:a05:6808:343:b0:3c9:91b7:e80d with SMTP id 5614622812f47-3c997069583mr6194703b6e.24.1715443304685; Sat, 11 May 2024 09:01:44 -0700 (PDT) Received: from Asus (syn-024-236-139-114.res.spectrum.com. [24.236.139.114]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194e2dsm27659326d6.70.2024.05.11.09.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 09:01:44 -0700 (PDT) From: Amy Grinn To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [FR] :noweb-wrap header arg In-Reply-To: <87y19kxagi.fsf@localhost> (Ihor Radchenko's message of "Thu, 11 Apr 2024 14:03:57 +0000") References: <87h6hixhnw.fsf@localhost> <85wmp82boq.fsf_-_@gmail.com> <87y19kxagi.fsf@localhost> Date: Sat, 11 May 2024 12:01:42 -0400 Message-ID: <85wmo0l4m1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=grinn.amy@gmail.com; helo=mail-ot1-x32d.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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.70 X-Spam-Score: -6.70 X-Migadu-Queue-Id: 2411D3CB27 X-Migadu-Scanner: mx11.migadu.com X-TUID: D+gbGPvUQbCb --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Amy Grinn writes: > >> First of all, I would like to change (defalias) the function name >> org-babel-noweb-wrap to org-babel-noweb-make-regexp. I think this in >> more in line with other functions which create regular expressions. > > +1 > You may even use obsolete alias (add it to lisp/org-compat.el) Here's a patch to rename org-babel-noweb-wrap to org-babel-noweb-make-regexp. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=rename-to-noweb-make-regexp.patch Content-Description: Rename org-babel-noweb-wrap to org-babel-noweb-make-regexp >From b318fef6af8ae47b7e6d0371ccc87a01ed1a7755 Mon Sep 17 00:00:00 2001 From: Amy Grinn Date: Wed, 17 Apr 2024 16:01:40 -0400 Subject: [PATCH] lisp/ob-core.el: (org-babel-noweb-wrap): renamed to org-babel-noweb-make-regexp * etc/ORG-NEWS (~org-babel-noweb-wrap~ is now ~org-babel-noweb-make-regexp~): Announce the change. * lisp/org-compat.el: Declare org-babel-noweb-wrap to be an obselete function alias for org-babel-noweb-make-regexp. * lisp/ob-core.el (org-babel-noweb-make-regexp): Rename the function. (org-babel-goto-named-src-block): (org-babel-expand-noweb-references): * lisp/ob-exp.el (org-babel-exp-code): * lisp/ob-tangle.el (org-babel-tangle-clean): (org-babel-tangle-single-block): Use the new function name. --- etc/ORG-NEWS | 6 ++++++ lisp/ob-core.el | 8 ++++---- lisp/ob-exp.el | 2 +- lisp/ob-tangle.el | 5 +++-- lisp/org-compat.el | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 978882a7a..97e2f2e3f 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -1563,6 +1563,12 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the buffer it will be added. If not specified, new headings are created at level 1 at the end of the accessible part of the buffer, as before. +** Removed or renamed functions and variables +*** ~org-babel-noweb-wrap~ is now ~org-babel-noweb-make-regexp~ + +This is more in line with other functions that return a regular +expression. + ** Miscellaneous *** =org-crypt.el= now applies initial visibility settings to decrypted entries diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c5dd20b0e..1518d7726 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -194,7 +194,7 @@ This string must include a \"%s\" which will be replaced by the results." :package-version '(Org . "9.1") :safe #'booleanp) -(defun org-babel-noweb-wrap (&optional regexp) +(defun org-babel-noweb-make-regexp (&optional regexp) "Return regexp matching a Noweb reference. Match any reference, or only those matching REGEXP, if non-nil. @@ -1976,7 +1976,7 @@ src block, then return nil." (type (org-element-type context)) (noweb-ref (and (memq type '(inline-src-block src-block)) - (org-in-regexp (org-babel-noweb-wrap))))) + (org-in-regexp (org-babel-noweb-make-regexp))))) (cond (noweb-ref (buffer-substring @@ -3125,7 +3125,7 @@ block but are passed literally to the \"example-block\"." (not (equal (cdr v) "no")))))) (noweb-re (format "\\(.*?\\)\\(%s\\)" (with-current-buffer parent-buffer - (org-babel-noweb-wrap))))) + (org-babel-noweb-make-regexp))))) (unless (equal (cons parent-buffer (with-current-buffer parent-buffer (buffer-chars-modified-tick))) @@ -3175,7 +3175,7 @@ block but are passed literally to the \"example-block\"." ((guard (or org-babel-noweb-error-all-langs (member lang org-babel-noweb-error-langs))) (error "Cannot resolve %s (see `org-babel-noweb-error-langs')" - (org-babel-noweb-wrap ,ref))) + (org-babel-noweb-make-regexp ,ref))) (_ "")))) (replace-regexp-in-string noweb-re diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 80eaeeb27..a61b26ed5 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -419,7 +419,7 @@ replaced with its value." (setf (nth 1 info) (if (string= "strip-export" (cdr (assq :noweb (nth 2 info)))) (replace-regexp-in-string - (org-babel-noweb-wrap) "" (nth 1 info)) + (org-babel-noweb-make-regexp) "" (nth 1 info)) (if (org-babel-noweb-p (nth 2 info) :export) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 79fe6448b..4427250ae 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -412,7 +412,7 @@ references." (interactive) (goto-char (point-min)) (while (or (re-search-forward "\\[\\[file:.*\\]\\[.*\\]\\]" nil t) - (re-search-forward (org-babel-noweb-wrap) nil t)) + (re-search-forward (org-babel-noweb-make-regexp) nil t)) (delete-region (save-excursion (forward-line) (point)) (save-excursion (end-of-line 1) (forward-char 1) (point))))) @@ -580,7 +580,8 @@ non-nil, return the full association list to be used by ;; Run the tangle-body-hook. (let ((body (if (org-babel-noweb-p params :tangle) (if (string= "strip-tangle" (cdr (assq :noweb (nth 2 info)))) - (replace-regexp-in-string (org-babel-noweb-wrap) "" (nth 1 info)) + (replace-regexp-in-string (org-babel-noweb-make-regexp) + "" (nth 1 info)) (org-babel-expand-noweb-references info)) (nth 1 info)))) (with-temp-buffer diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 92cad3d6e..ce46fd399 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -433,7 +433,7 @@ This is a floating point number if the size is too large for an integer." (define-obsolete-function-alias 'org-show-context 'org-fold-show-context "9.6") (define-obsolete-function-alias 'org-show-entry 'org-fold-show-entry "9.6") (define-obsolete-function-alias 'org-show-children 'org-fold-show-children "9.6") - +(define-obsolete-function-alias 'org-babel-noweb-wrap 'org-babel-noweb-make-regexp "9.7") (defmacro org-re (s) "Replace posix classes in regular expression S." -- 2.39.2 --=-=-= Content-Type: text/plain -- Best, Amy --=-=-=--