From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6EFxI9i1kmUZPAAAkFu2QA (envelope-from ) for ; Mon, 01 Jan 2024 13:53:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 2AtNH9i1kmVSYgEA62LTzQ (envelope-from ) for ; Mon, 01 Jan 2024 13:53:44 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iOzdG1bm; 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=1704113624; 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=CI3plldADCngJwpbjX+wRe3S8ca8YkZaT9eqqe9Ke1w=; b=pOXH0QvevUekddEeveZYU76vNgeydwPRBWQcXNO3FoUbXnxjWuq7jR1eQ98J7fy+O1RuCQ bR0kbp7a7rDBlQjlsGKaSrqujyJeb9oFsaCASi9VAs5BEOAHuOuvBnMAK6PbEVahKoeC+G dtuo3kqCROJxZxwywSHSXNKiapZqk2TL2eCVp1pBNPBCa/nlX5s98hD0sREx3OhISyJ3h1 YBWhKS5j5nlQDhE3UCds1Wu4A38Fs7LlZ/fFTTt/2p7PFkYnSCcEgzGxbgCbpGirXmlgUE p3LZVBvgo2bSiwxGfVCERNyUVY6gNvBPO6uNhwtGnMZIAkhL9rsUliblu7pgCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iOzdG1bm; 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=1704113624; a=rsa-sha256; cv=none; b=l5q+a3Tc5ml9g14MkCnP5J6yjMgFtIu7qE86hCMqqT0k011G83et5eP8UUjCEbTPh90/fb 3jH0LkmcEcPUAtcB4SCjk4loCwdwvfj0bxdCbONa3tvBrmPbvjnM3IEznD3nQQJw+F9tvw aTEzHhR2GIe5u9gaDkcRjKb2gCeV47DpimF6Wue58KsOZVB97EuPdDYXKOoUQsIzLdJhfh P8xBXfvRXodgWsFkwxV3vwWlWXh+/jYmWe3VY5voVu8jIhXEiq/lcP61TMfOefM/MYe0L8 zxpT0pMk6fqMSnEbElet/Gc2J2UWKWsAbFrUTPh1vj26+L37IEKVHvtR27jDww== 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 069C9113F8 for ; Mon, 1 Jan 2024 13:53:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKHmo-0005Rc-Cd; Mon, 01 Jan 2024 07:52:54 -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 1rKHmm-0005RT-Fy for emacs-orgmode@gnu.org; Mon, 01 Jan 2024 07:52:52 -0500 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 1rKHmk-0001Gm-Gc for emacs-orgmode@gnu.org; Mon, 01 Jan 2024 07:52:52 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 70213240027 for ; Mon, 1 Jan 2024 13:52:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704113566; bh=jFMdrNqkvgLj2qFIIKa8mnz7bSWsZgURT1GENflHS/k=; h=MIME-Version:Date:From:To:Cc:Subject:Message-ID:From; b=iOzdG1bmidQ93hxBKUa1gmUVyqDo+NtdnfYVWUF0aSOrQYT8EMzqhAxI0sr+sMksX F490FkeSYUKU0UCCUlR4hEDbELDW9JYm74wyOCsYJXWSKXdrOsBBab4V5u4PWdwinJ 0OqxIx+g4BGeDQYnRMRIOhv/KnVgMAdMTgz8DC2smd8jfUdr/GEm59zG2r5JfEiKGX v55YSEu8f+N9zeihxW5hdgZZQ1ScK1fVcNsDKd8tr3ILrXD7nh31IqzMNOXrOogWyL h5OhF2R6QWt4L/o/b26Y8goawGgmv1gEowpJNhv2EukVg/1EpsnsYGCYxCaMmeAFYt Pb6vBSu08k/DA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T3bVj5FHBz9rxL; Mon, 1 Jan 2024 13:52:45 +0100 (CET) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_1b0db7b1de4762650295636258c2996a" Date: Mon, 01 Jan 2024 12:52:45 +0000 From: gerard.vermeulen@posteo.net To: Ihor Radchenko Cc: Emacs orgmode Subject: Re: [PATCH] org-babel-demarcate-block: duplicate switches too In-Reply-To: <87zfxq78ff.fsf@localhost> References: <7e41f9b6e9026a404e256f33371e974c@posteo.net> <87zfxq78ff.fsf@localhost> Message-ID: Received-SPF: pass client-ip=185.67.36.65; envelope-from=gerard.vermeulen@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: mx13.migadu.com X-Migadu-Spam-Score: -4.76 X-Spam-Score: -4.76 X-Migadu-Queue-Id: 069C9113F8 X-TUID: r3kz2egdKSZO --=_1b0db7b1de4762650295636258c2996a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 31.12.2023 15:28, Ihor Radchenko wrote: > gerard.vermeulen@posteo.net writes: > >> The purpose of this patch is to duplicate switches when >> org-babel-demarcate-block >> duplicates headers (meaning point in the source block when >> demarcating). > > Thanks for the patch! > Would you mind also adding a test for `org-babel-demarcate-block' in > testing/lisp/test-ob.el? I have attached a new patch with a test named `test-ob/demarcate-block-split'. Besides testing the duplication of switches and some header arguments, it also shows that multi-line header arguments are not duplicated. Whether this is a bug or a feature in `org-babel-demarcate-block' may be a point of discussion. I have no real opinion. The code of the 4 (should ...) forms in the test below the line ;; unduplicated multi-line header arguments: feels a bit clumsy. Does Org have a function to extract the value that a particular var-name has from the association list returned by `org-babel-get-src-block-info'? Regards -- Gerard Regards --=_1b0db7b1de4762650295636258c2996a Content-Transfer-Encoding: base64 Content-Type: application/octet-stream; name=0001-org-babel-demarcate-block-duplicate-switches-too.patch Content-Disposition: attachment; filename=0001-org-babel-demarcate-block-duplicate-switches-too.patch; size=3624 RnJvbSA1NTAxYzA2MzJmMzIzYmRlNDcyZmY5NGEyNWVkODViZjA1ZjRjMWNhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHZXJhcmQgVmVybWV1bGVuIDxnZXJhcmQudmVybWV1bGVuQHBv c3Rlby5uZXQ+CkRhdGU6IFNhdCwgMzAgRGVjIDIwMjMgMTk6MjU6MjUgKzAxMDAKU3ViamVjdDog W1BBVENIXSBvcmctYmFiZWwtZGVtYXJjYXRlLWJsb2NrOiBkdXBsaWNhdGUgc3dpdGNoZXMgdG9v CgoqIGxpc3Avb2ItYmFiZWwuZWwgKG9yZy1iYWJlbC1kZW1hcmNhdGUtYmxvY2spOiBkdXBsaWNh dGUgc3dpdGNoZXMgd2hlbgp0aGUgZGVtYXJjYXRpb24gZHVwbGljYXRlcyBoZWFkZXJzLgoqIHRl c3RpbmcvbGlzcC90ZXN0LW9iLmVsICh0ZXN0LW9iL2RlbWFyY2F0ZS1ibG9jay1zcGxpdCk6IE5l dyB0ZXN0CmZvciBibG9jayBzcGxpdHRpbmcgYnkgZGVtYXJjYXRpb24uICBJdCBjaGVja3MgdGhh dCBzd2l0Y2hlcyBhbmQKaGVhZGVyIGFyZ3VtZW50cyAod2l0aCB0aGUgZXhjZXB0aW9uIG9mIG11 bHRpLWxpbmUgaGVhZGVyIGFyZ3VtZW50cykKYXJlIGR1cGxpY2F0ZWQuCi0tLQogbGlzcC9vYi1j b3JlLmVsICAgICAgICAgfCAgMyArKysKIHRlc3RpbmcvbGlzcC90ZXN0LW9iLmVsIHwgMzcgKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKwogMiBmaWxlcyBjaGFuZ2VkLCA0MCBp bnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvbGlzcC9vYi1jb3JlLmVsIGIvbGlzcC9vYi1jb3Jl LmVsCmluZGV4IGY3ZTRlMjU1Zi4uNjM0Yjc2MjZiIDEwMDY0NAotLS0gYS9saXNwL29iLWNvcmUu ZWwKKysrIGIvbGlzcC9vYi1jb3JlLmVsCkBAIC0yMDc4LDYgKzIwNzgsNyBAQCBibG9jayBvZiB0 aGUgc2FtZSBsYW5ndWFnZSB3aXRoIHRoZSBwcmV2aW91cy4iCiAgICAgICAgICAgIChzYXZlLWV4 Y3Vyc2lvbgogICAgICAgICAgICAgIChnb3RvLWNoYXIgcGxhY2UpCiAgICAgICAgICAgICAgKGxl dCAoKGxhbmcgKG50aCAwIGluZm8pKQorICAgICAgICAgICAgICAgICAgIChzd2l0Y2hlcyAobnRo IDMgaW5mbykpCiAgICAgICAgICAgICAgICAgICAgKGluZGVudCAobWFrZS1zdHJpbmcgKG9yZy1j dXJyZW50LXRleHQtaW5kZW50YXRpb24pID9ccykpKQogCSAgICAgICAod2hlbiAoc3RyaW5nLW1h dGNoICJeW1s6c3BhY2U6XV0qJCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KGJ1ZmZlci1zdWJzdHJpbmcgKGxpbmUtYmVnaW5uaW5nLXBvc2l0aW9uKQpAQCAtMjA4OSw2ICsy MDkwLDggQEAgYmxvY2sgb2YgdGhlIHNhbWUgbGFuZ3VhZ2Ugd2l0aCB0aGUgcHJldmlvdXMuIgog CQkgICAgICAgIChpZiBhcmcgc3RhcnMgaW5kZW50KSAiXG4iCiAJCSAgICAgICAgaW5kZW50IChp ZiB1cHBlci1jYXNlLXAgIiMrQkVHSU5fU1JDICIgIiMrYmVnaW5fc3JjICIpCiAJCSAgICAgICAg bGFuZworICAgICAgICAgICAgICAgICAgICAgICAgKGlmICg+IChsZW5ndGggc3dpdGNoZXMpIDEp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbmNhdCAiICI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st aW5mbykpCisgICAgICAob3JnLWJhYmVsLW5leHQtc3JjLWJsb2NrKQorICAgICAgKHNldHEgYmVs b3cgKG9yZy1iYWJlbC1nZXQtc3JjLWJsb2NrLWluZm8pKQorICAgICAgOzsgdW5kdXBsaWNhdGVk IG11bHRpLWxpbmUgaGVhZGVyIGFyZ3VtZW50czoKKyAgICAgIChzaG91bGQgKGVxdWFsICcoZWRn ZSAuICJ1bmR1cGxpY2F0ZWQiKQorICAgICAgICAgICAgICAgICAgICAgKGNkciAoYXNzcSA6dmFy IChjZHIgKG50aCAyIGFib3ZlKSkpKSkpCisgICAgICAoc2hvdWxkIChub3QgKGVxdWFsICcoZWRn ZSAuICJ1bmR1cGxpY2F0ZWQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAoY2RyIChhc3Nx IDp2YXIgKGNkciAobnRoIDIgYmVsb3cpKSkpKSkpCisgICAgICAoc2hvdWxkIChlcXVhbCAic3Jj IGFueS1zcGFuaXNoIC1pIC1uIgorICAgICAgICAgICAgICAgICAgICAgKGNkciAoYXNzcSA6d3Jh cCAobnRoIDIgYWJvdmUpKSkpKQorICAgICAgKHNob3VsZCAobm90IChlcXVhbCAic3JjIGFueS1z cGFuaXNoIC1pIC1uIgorICAgICAgICAgICAgICAgICAgICAgICAgICAoY2RyIChhc3NxIDp3cmFw IChudGggMiBiZWxvdykpKSkpKQorICAgICAgOzsgZHVwbGljYXRlZCBoZWFkZXJzIGFuZCBzd2l0 Y2hlczoKKyAgICAgIChzaG91bGQgKHN0cmluZz0gImFueS1lbmdsaXNoIiAobnRoIDAgYWJvdmUp KSkKKyAgICAgIChzaG91bGQgKHN0cmluZz0gImFueS1lbmdsaXNoIiAobnRoIDAgYmVsb3cpKSkK KyAgICAgIChzaG91bGQgKHN0cmluZz0gImFib3ZlIHNwbGl0IiAob3JnLXRyaW0gKG50aCAxIGFi b3ZlKSkpKQorICAgICAgKHNob3VsZCAoc3RyaW5nPSAiYmVsb3cgc3BsaXQiIChvcmctdHJpbSAo bnRoIDEgYmVsb3cpKSkpCisgICAgICAoc2hvdWxkIChlcXVhbCAnKGhlcmUgLiAic2VlbiIpIChj ZHIgKGFzc3EgOnZhciAobnRoIDIgYWJvdmUpKSkpKQorICAgICAgKHNob3VsZCAoZXF1YWwgJyho ZXJlIC4gInNlZW4iKSAoY2RyIChhc3NxIDp2YXIgKG50aCAyIGJlbG93KSkpKSkKKyAgICAgIChz aG91bGQgKHN0cmluZz0gIi1pIC1uIiAobnRoIDMgYWJvdmUpKSkKKyAgICAgIChzaG91bGQgKHN0 cmluZz0gIi1pIC1uIiAobnRoIDMgYmVsb3cpKSkpKSkKKwogKGVydC1kZWZ0ZXN0IHRlc3Qtb2Iv aW5kZW50ZWQtY2FjaGVkLW9yZy1icmFja2V0LWxpbmsgKCkKICAgIldoZW4gdGhlIHJlc3VsdCBv ZiBhIHNvdXJjZSBibG9jayBpcyBhIGNhY2hlZCBpbmRlbnRlZCBsaW5rIGl0CiBzaG91bGQgc3Rp bGwgcmV0dXJuIHRoZSBsaW5rLiIKLS0gCjIuNDIuMAoK --=_1b0db7b1de4762650295636258c2996a--