From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2EdbG9yMmWN/cAAAbAwnHQ (envelope-from ) for ; Wed, 14 Dec 2022 09:44:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MANrG9yMmWNJgAAA9RJhRA (envelope-from ) for ; Wed, 14 Dec 2022 09:44:12 +0100 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 4511542A9 for ; Wed, 14 Dec 2022 09:44:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5NA0-0007mm-5N; Wed, 14 Dec 2022 03:30:40 -0500 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 1p5N9b-0007iF-Jc for emacs-orgmode@gnu.org; Wed, 14 Dec 2022 03:30:17 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5N9Y-0000RH-Ve for emacs-orgmode@gnu.org; Wed, 14 Dec 2022 03:30:15 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0024E240103 for ; Wed, 14 Dec 2022 09:30:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671006611; bh=kn5apZvWVe1J+tWSDXQaROgnkWaL/zhBjty3UFDoBVA=; h=From:To:Cc:Subject:Date:From; b=aF6g7Ee73hID4exEgn+5Jn6xOyva2TmIsfqBVKLA27PFcnIoEOAQaA286jDWVHoVt OFlWDz+QNMQVgPxYzjIinIT4tQfyMNWqUP2cUZH8kI7QE8CTtCBEoLZHyvCACAnsDT GwWNwDpCAcI8+Ejgq44XFM2tNJ/i8oOIWjS1kMG5RfdeDAn6zUXsRdIB2SjxEb1n78 LkS5KyBj2XVs6Vk1+w43Lmbt2JY8A2+S3GTgHPWWJnmACGoPo5wZuKamqHRSw+KuIv fqnrEKpOiyTApwSxm2wZ8lGU2SHJyKNgZLtJXFWc73fFqxhzXir+cND1mzcatejqxu D79zP6Q4zWZ3A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NX7pV1cCDz6tm9; Wed, 14 Dec 2022 09:30:10 +0100 (CET) From: Ihor Radchenko To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Cc: emacs-orgmode@gnu.org Subject: Re: Radio links work only in small numbers In-Reply-To: References: Date: Wed, 14 Dec 2022 08:30:08 +0000 Message-ID: <87r0x2qtf3.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-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.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-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671007452; 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=CQ4gF+sEjY3z7rX8faMwD5EURDCy5BeZWAcMjRVTw6c=; b=mDIpJPnB7u/cCkyaxEeau6sBsldkDayGpfueuOeAdCKUFBnKPQYi0aBiZTQuclYiSWBaDB WZd06OHVHOrkolzpXzIMMLKs70f8LKZv+6eBoFdkrIzelbMUFg/PmOWzBDIHKNNBAukTgM y2Tq0vPy5CytTD0EZ07cYSBQUK2rHq/oain3xEAYIQ9cQcqxtqm4ggABnz+Yqdkp6llgVX 5c/Nd+buadH8oDl8v9Pnq2tRPsHj6pMontgdVqOx9rDbRYwIiIvdvJ62osZzs/Is9ZTSpd HnzccaAHDYYmsd4WeqU3DrLc+49mnHxHe0A9kq0xbgjnaLNH2MyrSgjdcAHvaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aF6g7Ee7; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671007452; a=rsa-sha256; cv=none; b=lvsOV6xlictD11yYJIdbUmnTpZDiHVGNVlfSJuRYNyiVbNaA3QLgiPx1gqaa0XwcP12O8D uGTeVegX5T3ElnvnZb1a3l3KDGJxLrMaiJLwRyi0KMdliSA8Vwg5JwBmRqY28ErMPd9cbe o+Ij/fBDZ2gjjG/QEVKDn7I+VQNwHf6BamBDRZf1JCeCmQ2BQyBy8g7R+KusdCE7DmPtpf jnuwkmGB70FtOJRuSBoulGPJniTLVl++dlLwa8F/2DO4KkcXC1xon1jMuTAhHFFFdEzxFX o8vBUy42eb5iVbx5JobhH2ZsyuY49lg1OCcaelzk+9uNOheMIh7QfdCCbRZvrw== X-Migadu-Spam-Score: -9.47 X-Spam-Score: -9.47 X-Migadu-Queue-Id: 4511542A9 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aF6g7Ee7; 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"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: f0Vyi5iIFh0u --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rudolf Adamkovi=C4=8D writes: > Greetings smart people! > > All [[link]]s in my notes perfectly match LEVEL-1 headings, so I figured > that I may as well ask Org to make links for me. So, I replaced all the > ~4000 headings in my notes with radio <<>>. However, Org now > errors out with "Regular expression too big". > > Does anyone know how to overcome this limitation? Or, perhaps someone > has a patch in works that fixes it? If so, please let me know! This is C-level error emitted by Emacs' regexp engine. Can you try the attached patch? --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-org-update-radio-target-regexp-Try-to-get-a-shorter-.patch Content-Transfer-Encoding: quoted-printable >From 53e6c067e4897c5b6c1ac8201e2dbc49baa9e6e8 Mon Sep 17 00:00:00 2001 Message-Id: <53e6c067e4897c5b6c1ac8201e2dbc49baa9e6e8.1671006575.git.yantar= 92@posteo.net> From: Ihor Radchenko Date: Wed, 14 Dec 2022 11:28:03 +0300 Subject: [PATCH] org-update-radio-target-regexp: Try to get a shorter regexp MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/ol.el (org-update-radio-target-regexp): Use `regexp-opt' to compact the resulting regexp as much as possible. Otherwise, some users hit regexp length limits when the number of radio targets approaches thousands. Reported-by: Rudolf Adamkovi=C4=8D Link: https://orgmode.org/list/m2lenax5m6.fsf@me.com --- lisp/ol.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index 3ae8f8875..51ee028e4 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -2065,13 +2065,11 @@ (defun org-update-radio-target-regexp () (setq org-target-link-regexp (and targets (concat before-re - (mapconcat - (lambda (x) - (replace-regexp-in-string - " +" "\\s-+" (regexp-quote x) t t)) - targets - "\\|") - after-re))) + (replace-regexp-in-string + " +" "\\s-+" + (regexp-opt targets) + nil t) + after-re))) (unless (equal old-regexp org-target-link-regexp) ;; Clean-up cache. (let ((regexp (cond ((not old-regexp) org-target-link-regexp) --=20 2.38.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--