From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id eM78KlqFpmXB7wAAqHPOHw:P1 (envelope-from ) for ; Tue, 16 Jan 2024 14:32:10 +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 eM78KlqFpmXB7wAAqHPOHw (envelope-from ) for ; Tue, 16 Jan 2024 14:32:10 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dVhIqNXO; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705411930; 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=tRtp/qrw0tr7aTyJUZLpuLh/9uus3rGcVJK+8NOoXPE=; b=G7IgcBVDjbYw+8hQNBJm76Pru9qmijGykBV8Y9Fu0XAAITKldyolBXAu2SnbbIXZIVySsU jCJxNnNV5c54c9BgaXDYQyFCGgdl+Js00BOkLH/Q54vCANtcunkp2sd1z4do3tamWPO87Z VbZUq46H7mIIXcuIAYA5GcyrxGe5XWZwPgb52EpL66ccJQMGgYyBnprwM1q77CXo11XlyK cZBgBX32wXxlVZx1wdaefNkMrI/Fmr5MfOUWe2ChUz21vBsjlQrMBT4gp7T+D2RhJKg6qW L5xda0+WJK0iLEPe5od6wWpYRM3SKPmgW2JtswyTU6luc6nhggfrfjnWwFGFpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dVhIqNXO; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705411930; a=rsa-sha256; cv=none; b=s9N9dQ+9STKjmun72tVaVrzYx8H0yF6w/G3kYq/L+DUDNLT7BQ1AZDYf9QB0zd6SQyHSXb 6VZj8BltNNtJ7oCBF3leEfQc9Kh4GnFqhJqWfRuI7jKoZFEtMI69waiOP/Z6knPZMRi4LK jgDyCsHnbArUvahOivE8zGPw2+LP03U7+Y2FBMjsMs+7kA85l5xCtVrCNEZddWsfwroxyH Puz7bUW/8/0e+cXmdr5KxMH3YJBBqpYOUwH3n8ZQVOAKirC3o6Ay86D4LfYxq4Gih2f0YP dLPbuaEotD3oODnGlSXksUWN5xcfz0JpbDiuZB9jVLDVNN5zy45KxYIfStbrJA== 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 9F7B537F57 for ; Tue, 16 Jan 2024 14:32:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPjXG-0003r9-G5; Tue, 16 Jan 2024 08:31:23 -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 1rPjX9-0003qH-Ok for emacs-orgmode@gnu.org; Tue, 16 Jan 2024 08:31: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 1rPjX4-0004m1-Vp for emacs-orgmode@gnu.org; Tue, 16 Jan 2024 08:31:14 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B8750240104 for ; Tue, 16 Jan 2024 14:31:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705411867; bh=90Qzo4rCiNBf5ImK5KacJ3llCmJk66kgFO/Yrec2CtA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=dVhIqNXObV22oXrfVjDlkxVAIVEoibd6x0ZoWGux3vq6CxUVbduVHFRJIjdUxjHvx uaEH1CRRqYOd++niRcDb55FjOIvqjYBSwvIJrT0SNI8SOEFwbCjf18c7tjFoPkrNbE IkezvIC4zy5XQTeN1JzoVdPIk8SP1TuPJqocYI50RG1a861SJj9X0Z7f6Ik0IoTFee /JFFo4ul5tlS7+6F73RRrnos6I7wNRe2Hmo2IymKk2+Ishh/HTKKJmV7a+r+IaSDq7 RmsVnj/UpobdLKVbzdg9C0f/pgUwLrbm5P/I+RlQ4JYiBFij8s+YDgM/IV9y2MfG6o 2I8wyQgu5UCgg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TDqf26DjRz6txd; Tue, 16 Jan 2024 14:31:06 +0100 (CET) From: Ihor Radchenko To: gerard.vermeulen@posteo.net Cc: Emacs orgmode , emacs-orgmode-bounces+gerard.vermeulen=posteo.net@gnu.org Subject: Re: [PATCH] org-babel-demarcate-block: split using element API In-Reply-To: References: <7e41f9b6e9026a404e256f33371e974c@posteo.net> <87zfxq78ff.fsf@localhost> <87zfxo3taa.fsf@localhost> <87v88a78qd.fsf@localhost> <7f23ea966f0f0aad3fad29b0b96864f3@posteo.net> <87y1d55fc6.fsf@localhost> <37fdcc4bfcf734c2e5ec439d40b4f7d8@posteo.net> <878r50yqmo.fsf@localhost> <442006329cfba666710c989aece5191a@posteo.net> <261356c53e857e0bc4b04f884366edfa@posteo.net> <87bk9uy31w.fsf@localhost> <680e4a4fccf4f3c5c8f51d8215257eff@posteo.net> <87a5p9uute.fsf@localhost> <87wmscrty4.fsf@localhost> <2c82fa1399ddaa52ebe5bb21e241fb5f@posteo.net> Date: Tue, 16 Jan 2024 13:34:20 +0000 Message-ID: <87o7dll7vn.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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_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=unavailable 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: -9.90 X-Spam-Score: -9.90 X-Migadu-Queue-Id: 9F7B537F57 X-Migadu-Scanner: mx12.migadu.com X-TUID: tzhFOi5UJ2Dh gerard.vermeulen@posteo.net writes: >>> 1 unexpected results: >>> FAILED test-ob/demarcate-block ((should (string= region-text >>> (org-trim (nth 1 info)))) :form (string= "mark this line as region" >>> "") :value nil :explanation (arrays-of-different-length 24 0 "mark >>> this line as region" "" first-mismatch-at 0)) >> >> This is a tough lesson: the tests pass always on my system. >> >> I think the failure you see is related to a problem marking a region >> in my test code (wish: support in `org-test-with-temp-text' for >> "" besides "", but maybe that depends on ERT), else >> the problem would have shown up while testing the patch interactively. >> >> I think that I have improved my region marking code by using "" >> in the temp-text as a start. Then, I only have to find where to set >> mark, >> and eventually exchange point and mark. Still failing on my side (when running tests non-interactively from command line). To fix the problem, please use the approach from `test-org-list/indent-item': (transient-mark-mode 1) (push-mark (point) t t) Instead of (set-mark-command nil) > + ;; Map positions to columns for white-space padding. > + (setq pads (mapcar (lambda (p) (save-excursion > + (goto-char p) > + (current-column))) > + pads)) This will break when the region does not start near the beginning of line or does not end there: #+begin_src emacs-lisp '(1 2 3) '(1 2 3) #+end_src Also, the indentation of source code inside src block should not be used to indent the whole block. This is because it may be additionally indented according to `org-edit-src-content-indentation'. If you want to preserve the original indentation, just use `org-current-text-indentation' at the beginning of the src block. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at