From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id wPTjER3A4GVw3wAAe85BDQ:P1 (envelope-from ) for ; Thu, 29 Feb 2024 18:34:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id wPTjER3A4GVw3wAAe85BDQ (envelope-from ) for ; Thu, 29 Feb 2024 18:34:21 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oSElVrbW; 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=1709228061; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0Y9TI/yEI33ZdTXd/dz53znpNwsgHIL9nQ4LRXmmuKg=; b=NnWo9kNkUE3FaF31O6mUZ8qbI/r75AxuBPA1pF4n1HzSHTlMQy0g45MJWmYyrqan1FQeWG 2GNMqkCsFLbpLqJzvhlQWgSByZtRAGKkexSr/UAb812Tyzf889SLGVHlSkl2Q9khFMuWkF ugc+FwJvtnUxPvLigE96bjhRz+7QohgAmSMqgxpkaZTJ9whEyL9bSFHuDGBmTlIt8tqBeW EtpY8hFi45zEs2NVyWx+AnT37CRtNISe0HnA57ZyoexDUBlfnFP4hCoZqRP3Na46xxG7MJ AJUpo+B7UDoTwdWxMwSwJQxJkSY4IlG4M7NbSJ2weH6XownyN+5skyK/rDsZTw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oSElVrbW; 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=1709228061; a=rsa-sha256; cv=none; b=Yk3zaTKgM6AV/PEljggaL8TQ4rFYb0TgP9iWq/UhyIKEaxetFl+dF+C7juPhLHC6CDaEmz qhU4udXRwJjyW7W/my+HpA1FEvT8lubyikiSIXfQbxuj0J2YUN9XHERUEMnB0WgdVtvagX UoyrMKnXphrXQOdwXpqABv4m5Wflm6DnV7E4htcDzSSFAerrwS2FofH1t5odkD/KNtwQJf DsSul9+NJgWw3qJeINLAfz5pHFF3tXUuwdjpmdX3Ego79cGyLibXavitKyUfjSNU0+6X1y E6XKPvv6gEd1MRLQyW/t2yJInsvV5QO8X+wkPLJsTSt6N9AgBF7c4IEo2OC19g== 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 295E43B84D for ; Thu, 29 Feb 2024 18:34:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfkHr-0007Ak-DE; Thu, 29 Feb 2024 12:33:39 -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 1rfkHp-0007A0-94 for emacs-orgmode@gnu.org; Thu, 29 Feb 2024 12:33:37 -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 1rfkHf-00087A-2V for emacs-orgmode@gnu.org; Thu, 29 Feb 2024 12:33:31 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6A6C2240103 for ; Thu, 29 Feb 2024 18:33:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1709228004; bh=czrE8ERsAk9nMUP8vxcdWSq8FW2dSFRLMRo2/ngR1S8=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Cc:Subject:Message-ID:From; b=oSElVrbWpupTxJ55xY3swDr/sJCfuHq/RNU4HmAWcAIUegojUK/d4sUzAdTTz7yN0 cSB49Ep3yRkJZmyOdBsOk4g4vNZXalh2mHyTUbiMgTVfbOiK88YvEc3z/ilqyHhYeL ugf1txCsfejbyO27J29ETQ+rVxo53Vn2TPc9aSm0Yvss4wHBa14Hg933LVwjQAH0mW /3eys1ROCvfWbh6th9mCx5cCKuJREt4FDLUTv8KXMKLujgH55jzrwSWWYWHWHVq51m Eep+SaVW7F+9fKTNrJhDmcFDWqnrd1EH3yb3WUjBvxDwFtTW0eBM4SnlxzcCrK6vLq Dxqp/YcN5mFBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TlyxH6y3Qz6txb; Thu, 29 Feb 2024 18:33:23 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 29 Feb 2024 17:33:23 +0000 From: gerard.vermeulen@posteo.net To: Ihor Radchenko Cc: Emacs orgmode Subject: Re: [PATCH] org-babel-demarcate-block: split using element API In-Reply-To: <8734tbo54w.fsf@localhost> References: <7e41f9b6e9026a404e256f33371e974c@posteo.net> <87bk9uy31w.fsf@localhost> <680e4a4fccf4f3c5c8f51d8215257eff@posteo.net> <87a5p9uute.fsf@localhost> <87wmscrty4.fsf@localhost> <2c82fa1399ddaa52ebe5bb21e241fb5f@posteo.net> <87o7dll7vn.fsf@localhost> <874je4hjmr.fsf@localhost> <87frxmtasr.fsf@localhost> <87h6hzi9cy.fsf@localhost> <067f694028817e59ee3d0c49dc80dd3b@posteo.net> <87y1b8loop.fsf@localhost> <529eafb5a5274fb4e15917ce3b97d785@posteo.net> <87wmqo3it5.fsf@localhost> <71a7a6b51654e020f72cfa6ac07ce36b@posteo.net> <8734tbo54w.fsf@localhost> Message-ID: <1b8d2e657adbda4ef753f8674f2ad0f9@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=gerard.vermeulen@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_H4=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-Spam-Score: -7.67 X-Spam-Score: -7.67 X-Migadu-Queue-Id: 295E43B84D X-Migadu-Scanner: mx11.migadu.com X-TUID: cDPjvLnN1VAH On 29.02.2024 12:56, Ihor Radchenko wrote: > gerard.vermeulen@posteo.net writes: > >> That includes `org-babel-demarcate-block' splitting with the patch. >> >> I do not understand why it works and why I never see the user-error >> re-signalled by `org-babel-edit-prep:sql' (even as demoted message). [...] I have reduced my version of `org-babel-demarcate-block' to a minimal function to locate the bug stemming from edit-prep signaling an user-error or not. In case edit-prep signals an user-error the call chain `org-indent-block', `org-indent-region', `org-element-at-point' triggers an infinite list of warnings (major mode is Python when run on the test block). #+begin_src emacs-lisp -n :results silent (defun oeap-test () "Test `org-element-at-point': call with point at block." (interactive) (let* ((info (org-babel-get-src-block-info 'noeval)) (start (org-babel-where-is-src-block-head)) (body (and start (match-string 5)))) (if (and info start) (let* ((copy (org-element-copy (org-element-at-point))) (before (org-element-begin copy)) (beyond (org-element-end copy))) (org-element-put-property copy :value body) (delete-region before beyond) (insert (org-element-interpret-data copy)) (org-babel-previous-src-block 1) (message "Mode derived from: %S" (derived-mode-p 'org-mode)) ;; Triggers list of warnings and condition-case is no solution: (org-indent-block))))) #+end_src Working edit-prep: #+begin_src emacs-lisp -n :results silent (defun harm-full-edit-prep (_info) (user-error "Harm-FULL edit-prep")) (defun org-babel-edit-prep:python (info) (condition-case nil (harm-full-edit-prep info) (t nil))) (message "Working edit-prep:python") #+end_src Failing edit-prep: #+begin_src emacs-lisp -n :results silent (defun harm-full-edit-prep (_info) (user-error "Harm-FULL edit-prep")) (defun org-babel-edit-prep:python (info) (harm-full-edit-prep info)) (message "Failing edit-prep:python") #+end_src Test block: #+begin_src python -i -n :results silent 11 22 #+end_src I do not like to put extra constraints on edit-prep functions. Maybe, it is better to cancel the patch. Regards -- Gerard