From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eP/fKixsDWeiIAEAqHPOHw:P1 (envelope-from ) for ; Mon, 14 Oct 2024 19:08:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id eP/fKixsDWeiIAEAqHPOHw (envelope-from ) for ; Mon, 14 Oct 2024 21:08:28 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GBudTiNR; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728932908; 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=IMYDvF6+bDflLCFKShhdly4xCqG4VCtEwymqHzldUoA=; b=d3AOqCzPcvHWXJF5XgaZnwFdPR5xvuRWTe54SHiWpkF3/S2ZKEr4BDNW+MfEeJofD/z13b P3yVBFJOhbKTkzK7DXulnYpn+yZlBIQjfpg8lLkV2ehneb0GwfdX9zqGeKsUGmUEB9ZuKP 07mQwCOHWDXuaXicHMvcQmPwGKoECIJksaameGpPU5w7ynrfw4Mz873fcVxVqZFR0hi/Ug YjdBNK2Uv1kePiQ+7PBiTALsh9JRVW4v/diuB2UFRqghZdvqZIip11MeXsVzo1d7cTMGnU /t/PAAjHUxf7M0o7ocOQkFmkFo4WH6yB1fHIkbMOGH58wTqIfSMrWsK4JM0mbA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GBudTiNR; 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=1728932908; a=rsa-sha256; cv=none; b=TAb2wwICRBc+nzRkb9iMHLIv87ILWK8wQ+AuO674WY8ZxtwHoaoardIM0ZcrYnQa0CJIEy hOrUE0UWAxFx8vfzOqSGJ7p+tXIC+UaOKXkItKBTBI+/GWDV6qcrObVnzXWo8vtV5Yknpf tV9EMktnGSWn2Z+1QOhw3lTbrMT1BPE6w6Zp3Gx0+2/UGSbLe2XLtR0zz5uUMiyuQbZQuV 4gz0e7gvHfFV1g5WnhivhlBini9YS1Ef7lvo8U/OmMNBlnXGSnl0ba/hkjIeFZ5dt2FDeX iJm4b6SsDRzvxu+CKEv45Owe/enmyVsSNlEDVdYV9ek0JDG/i7EQFaHwtrb+fQ== 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 E8B8643A78 for ; Mon, 14 Oct 2024 21:08:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0QPr-0007cE-CF; Mon, 14 Oct 2024 15:07:39 -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 1t0QPp-0007bq-A5 for emacs-orgmode@gnu.org; Mon, 14 Oct 2024 15:07:37 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0QPn-0003Lx-AX for emacs-orgmode@gnu.org; Mon, 14 Oct 2024 15:07:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0B753240028 for ; Mon, 14 Oct 2024 21:07:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1728932852; bh=Eq4o5Uj0qEf0oWV74Qn01yLqh2xLkFWBZfG+r6kPk3s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=GBudTiNRSLL2uf03cTfOjsq5EW3BGErfkn8Q8/YeaTwdGS3VQt2zJLxGgH53UdDGE EwuWNhVvW7dQ9grFZ4cd0Lty1YocKCaBdhP53BjuC71oWt7fQszzmM+5JS9U3BiDT9 OIoGo5VEoogmJ3enEUUZgd/zjDyp12FNydLY33q5QShBvel1GcJ3PDQctbVOAL762W Rl6gLzQp/44j8S1Du+CvV8tGuh1GhJ6QPQ46aK3ZqHSSVLkhKDspubigh0Nc0bqIdv dNyOaOVHibmy9xQIBqwt0pr1d9IUcXr6Ie3mswU7voyRaBEXepTxnGglvC8pa8XtxZ q46QBTznf5m/A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XS6Dg2XKrz6tyW; Mon, 14 Oct 2024 21:07:31 +0200 (CEST) From: Ihor Radchenko To: Sacha Chua Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] org-refile: calculate file part of the outline path outside the loop for the headings In-Reply-To: <877caadht3.fsf@sachachua.com> References: <877caadht3.fsf@sachachua.com> Date: Mon, 14 Oct 2024 19:09:21 +0000 Message-ID: <87y12qqz6m.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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 X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -1.24 X-Spam-Score: -1.24 X-Migadu-Queue-Id: E8B8643A78 X-TUID: J7BPsz2Fz07v Sacha Chua writes: > I noticed that org-refile-get-targets seems to recalculate the first > part of the outline path for each heading, which makes it slow on large > files when org-refile-use-outline-path is set to 'title. The following > patch let-binds that part to a variable that can be put outside the loop > for the headings, making it faster in the case where refile targets > include a few files with lots of headings. Does it make sense? I was > wondering if I was missing some important reason for it to be inside > that loop. Makes sense. > It feels like a pretty small change (just adding a let), but I > have copyright assignment papers on file at the FSF just in case. Agree. Yet, the tests are failing :) 1 unexpected results: FAILED test-org/refile-get-targets ((should (equal '("H1\\/foo") (org-test-with-temp-text "* H1/foo" (let (... ...) (mapcar ... ...))))) :form (equal ("H1\\/foo") ("H1")) :value nil :explanation (list-elt 0 (arrays-of-different-length 7 2 "H1\\/foo" "H1" first-mismatch-at 2))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at