From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2HBuL3fpk2X7DAAAkFu2QA (envelope-from ) for ; Tue, 02 Jan 2024 11:46:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +AhLLHfpk2WoewAAqHPOHw (envelope-from ) for ; Tue, 02 Jan 2024 11:46:15 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kqx7VvdG; 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=1704192375; 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=EzAdJnRv3vKWKFsMRG0/LgFp8ysF/Eisqdzybrmrmgs=; b=MoSQ+OVaO98V+s2GSsVOXJshlz2cjMp76HAN1AVBNLGLk1JdOdUdMDPAh8laeJ0GcOdxjD IUZc5RTa+vW0Ja/rdKpq3oUbP1zgZTWeDezRYiiEruIOsl0B/MRwE12C1fHn2TQykKMD4r cAfXJIxULBryds/vOROZAmKxenTroRfMb0CRm2qzenFDklvTQc89Fiho7UL4QwS/uuIXMy I8OsnwOr9Y1T+ejm1rE8PR5rJIDSep/uutCb4Ekxk3fCYbtqjNVw6oILFrq7tLDabX9450 akOplce73nYuejQ5YY6KPToNTuwSZgegSBnJdt3zZs4E4W/8r+Qzw8ZVRL/jrA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704192375; a=rsa-sha256; cv=none; b=oWz16QcMwGH9UaJIe/K/eSyxWjfAMu53LFWJ18PsmKwI4wGVOazlHZkslHn+bBgK4+YInR lN5aV9WsOfnFEWCLdg/Kv1WhzcudH8/0rHE35qPhzkjYlefEUgaEsy61mYfkM9tF2Evhrk C1WoCKZgG+lrBKt59iG7lLOzlfYV5Frfz1Hts0+6vmtaF7KOlIcVSUcElGnqstPH3LTcQD FOLr7clRa2OEvpPgeZn2Nj3CuSeZuPzFYzBkKFXGrv+vs3NbdM6fvJRXpl7L7aqIoHusQT nMXXGw0HQzvVJSJjQI0vy9MAlMiqdvWRrbwfq6QXRFG7B0kCSKzjwAW87hbAIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kqx7VvdG; 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 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 D2A2320E96 for ; Tue, 2 Jan 2024 11:46:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKcH5-0007ze-C5; Tue, 02 Jan 2024 05:45:31 -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 1rKcH3-0007zO-SU for emacs-orgmode@gnu.org; Tue, 02 Jan 2024 05:45:29 -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 1rKcH1-0004OO-IQ for emacs-orgmode@gnu.org; Tue, 02 Jan 2024 05:45:29 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C7892240028 for ; Tue, 2 Jan 2024 11:45:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704192322; bh=s3/QAYCYrdIkxbSV//MN3p2B1LCRefRNTtGhJB8SACc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=kqx7VvdGDQ5tRtC1mlJlKVG+MaZfniPSOmZg6J/AqzW5+vmDUQGHJiqGTEpoMr5jn XYWt0NorwsZFAyTdYb1WSiLLZ4fggTFFUZL7vkn/r+EEqfNzc9Ppvy0Rfakba+NSYb 0/krTrl84y0rWZawdwXMfKWM4XehTa6LbXvicxHhYPW0XnSx3TcQVYVeRGP+JhqvIV enmdql4ctncFbiuc732ztJxYaPxuJkRtNDbxtotSf/ne/4ySEXVezCDNnb2i9BGazJ nwQMYuR6s3K6j7HdISIeBdAJqq/+pYIaasC6TkT5Va0mrke4jfHfpiANczrpfvFlT1 SiJ2BHXtBDLfw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T48dF73hCz9rxM; Tue, 2 Jan 2024 11:45:21 +0100 (CET) From: Ihor Radchenko To: gerard.vermeulen@posteo.net Cc: Emacs orgmode Subject: Re: [PATCH] org-babel-demarcate-block: duplicate switches too In-Reply-To: References: <7e41f9b6e9026a404e256f33371e974c@posteo.net> <87zfxq78ff.fsf@localhost> Date: Tue, 02 Jan 2024 10:48:29 +0000 Message-ID: <87zfxo3taa.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_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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.04 X-Spam-Score: -7.04 X-Migadu-Queue-Id: D2A2320E96 X-Migadu-Scanner: mx12.migadu.com X-TUID: 1xetIDBJ3vFg gerard.vermeulen@posteo.net writes: >> 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. IMHO, this is a bug. The current approach with regexp matching in `org-babel-demarcate-block' is clearly not accurate. What would be more robust is using org-element-at-point + org-element-copy + set :value + org-element-interpret-data to carry over all the affiliated keywords and header arguments. > 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'? (org-babel--get-vars (nth 2 (org-babel-get-src-block-info))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at