From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 6GX/NIetP2b5BgAAe85BDQ:P1 (envelope-from ) for ; Sat, 11 May 2024 19:40:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6GX/NIetP2b5BgAAe85BDQ (envelope-from ) for ; Sat, 11 May 2024 19:40:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=HEEthvFC; 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=1715449223; 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=rgIuRC9ZXnzZFKtE3I2OC18MofBqEeuRuWhy4g7ZESs=; b=UUkoHcJvu2ynih9J7ahXeoTQvCm02gLN+E5SGp4nqciFR+a20Y3Agr/L2ojuwtk+ZM73u1 InmzK0hI2TGt79aIDJ/hxz8ePOweLH3ToyB2n0m0xfw6IH7yHnTOIL8H/fR1B9xzx7h4uW pdGdXjBoaR+JUgmlx7LWVmcy78CZS9PodPbVwQfeDDwX/G4nE7Ei5FHosObE7LzQv6Gki2 rixI60acF2DWyWflmMG+XfruCE5RFAK9J3bR1k+crv4+PyK9B1/LJUaX9+UflYE/KyelJB wELZ/7MiJ2J4iMaQgov8ULcuzUy2h0IP/xISmquVUl4bBcMnLJ9CbzHXBSwZUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=HEEthvFC; 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=1715449223; a=rsa-sha256; cv=none; b=Neq9AaD0NdgqsOfiYynRXkQUgwTnwpFyt2/QNxATjTkaXUdzCcX/S9VJHYmn9MohhkAv+S oZwyl5LV2Au714VAy5ATTUQsnDL5nZEYM1PJ38kOYK1phkRlgn1VSapa32KDmkR2uYIkKL bt6/ywjfk6Z3ofeIPAx8Bx6inDEgkN5XkgJUDpTHDtsWcrSFqkueeGj1qxSd+i0qnWfm1x T6UBac+PBuz8alK3mzaFZ5ZYAuREJLBFMAQdorOKTpwCd2whCYpLBTT9FDcTlkPEnQB1fV LhEpnFM9S42n6PQf7RXBsfBMfLFbEo6v4YJWPCH3GWwZiu8Ac4IRSISMu0YwtQ== 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 9BD2F20B86 for ; Sat, 11 May 2024 19:40:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5qhD-0005Ar-1U; Sat, 11 May 2024 13:39:43 -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 1s5qhA-0005Ag-Hn for emacs-orgmode@gnu.org; Sat, 11 May 2024 13:39:40 -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 1s5qh6-0004C2-Fo for emacs-orgmode@gnu.org; Sat, 11 May 2024 13:39:40 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E9A15240027 for ; Sat, 11 May 2024 19:39:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1715449173; bh=JrEgL7uUHt53VDYYgSYQcOO51lFiIYGdo2HIpZa2CBY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=HEEthvFCNA3IVBWoKgG9FbhmIDkM+97arLPprDgReoRGZNjyuqAMpGPWbVqF1hMeu BZUmecugTE0De6mCU9aLv2EXhF5ofgPNnIVSU5/0qBfDW1g8TqJNfacXrQYMLGojBp uoptCVq1jYuP9CnEMypRwdzQlLAtgl43T+MVLTwMPj6ypoH1ajP+lMWFDsjyUkmJiw 1G3C+tvutTCBdzDUVksmpaHugmeTEWSmcIen1u2u05UVSEJwrPafzXlhfwbVAoW4cL isuaUKNGuoFIzeyVS0ZOc7Z2vtzg230DJYnMgbRFsodGfMSDR4gbthRA4czKaiEnVU bFxQ5JB3/u23w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VcCg82DPtz9rxB; Sat, 11 May 2024 19:39:32 +0200 (CEST) From: Ihor Radchenko To: Nafiz Islam Cc: emacs-orgmode@gnu.org Subject: Re: [FR] Support headline as a function for file+headline target for org-capture-templates In-Reply-To: References: <87mspb6nf2.fsf@localhost> <87r0eleqi2.fsf@localhost> <87jzkdsksv.fsf@localhost> <87wmoc9yuc.fsf@localhost> <87ttjftany.fsf@localhost> <87a5l5ye2u.fsf@localhost> Date: Sat, 11 May 2024 17:41:07 +0000 Message-ID: <87wmo0tff0.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, 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-Spam-Score: -9.59 X-Migadu-Queue-Id: 9BD2F20B86 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.59 X-TUID: Dmaa2yiSL4W+ Nafiz Islam writes: > I see there are a lot of test cases for org-find-olp (which is the function > I believe processes the outline path argument). > > testing/lisp/test-org.el > 2861:(ert-deftest test-org/org-find-olp () > 2862: "Test `org-find-olp' specifications." > 2875: (should (org-find-olp '("Headline") t)) > 2876: (should-error (org-find-olp '("Headline" "Test") t)) > 2877: (should-error (org-find-olp '("Headlinealksjd") t)) > 2878: (should (org-find-olp '("Headline" "headline2") t)) > 2879: (should (org-find-olp '("Headline" "headline3") t)) > 2880: (should (org-find-olp '("Headline" "headline3" "headline4") t)) > 2881: (should-error (org-find-olp '("Headline" "headline5") t)) > 2882: (should (org-find-olp '("Headline" "headline6") t)) > 2883: (should (org-find-olp '("Headline" "headline7") t)) > 2884: (should (org-find-olp '("Headline" "headline8") t)) > > How should I go about testing different parameter types such as function > and symbol? I do not think that you need to modify `org-find-olp' itself. Instead, do what is already done for resolving the file name: (org-find-olp (cons (org-capture-expand-file path) (org-capture-expand-olp outline-path))) `org-capture-expand-olp' is the new function to be implemented. Then, all you need in terms of tests is to add a test case into `test-org-capture/entry' and, if you want, write a new test for `org-capture-expand-olp'. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at