From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oNoWD9tzv2TFfQEASxT56A (envelope-from ) for ; Tue, 25 Jul 2023 09:03:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iMsuD9tzv2Q5agEA9RJhRA (envelope-from ) for ; Tue, 25 Jul 2023 09:03:55 +0200 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 0D57C38490 for ; Tue, 25 Jul 2023 09:03:55 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOC4M-0001C9-Um; Tue, 25 Jul 2023 03:02:54 -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 1qOC4K-0001Bc-1y for emacs-orgmode@gnu.org; Tue, 25 Jul 2023 03:02:52 -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 1qOC4H-0001Zv-IU for emacs-orgmode@gnu.org; Tue, 25 Jul 2023 03:02:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AF10F24002B for ; Tue, 25 Jul 2023 09:02:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690268566; bh=VpvpfMPOJq76K54JGNklp3mL1AaoWT2JTbfja/9nwbU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=JA2s7lpXMBeWqNEjZTTPn+4byb+EeDZA2+Scsh5tCw0TkiaJURIdf45QtiPu2cd4e tSFsVLCDwasvwc/6uWXBHoUHWHZY/6dQsbRHzx/a7HnPSZVR7WZUzo4b2zjziko/H2 4kfchMusm6bbbQg/TBPg9pC49qdC1UsRfxQ/6bNW3DwoAv35VHkAy92X9e03mwl388 VdR26w2ENTI1Fofn75QnRP9oFLnYOj64xQtK1tMtUC1yNW3JmVRQ+pOP7fvaP4vRP6 0jhO+Vn3iM0mu1+M+2WIQ73JQydMYDfqFqTDNERlH94fN6z8sLQezC93M+pOg16cRZ TZzkBxQpgxPRg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R97Jk0Lv1z9s2n; Tue, 25 Jul 2023 09:02:45 +0200 (CEST) From: Ihor Radchenko To: Evgenii Klimov Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v3] ob-tangle.el: Blocks overwrite each other when grouping before tangling In-Reply-To: <87bkg1h4q3.fsf@lipklim.org> References: <87lefkd9tb.fsf@lipklim.org> <87h6q8d9lz.fsf@lipklim.org> <87cz0wcbtt.fsf@lipklim.org> <87ttu6j2zr.fsf@localhost> <87bkg1h4q3.fsf@lipklim.org> Date: Tue, 25 Jul 2023 07:02:59 +0000 Message-ID: <87fs5c79ss.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: 0D57C38490 X-TUID: bM5bFpHJWGrI Evgenii Klimov writes: > Here are the new tests that demonstrate the bug in block grouping during > block collection, along with the patch to address the issue, taking your > previous remarks into account. Thanks! The second patch is malformed. May you please resend? (You can see the problem if you try to download the second patch in ) > I split it into two patches so you can apply the tests first to see the > bug. And probably tests should be rewritten as they look too complex > and mostly duplicate each other. I'd appreciate your suggestions > on how to enhance them. If you can, please avoid using `org-test-at-id'. This is much less readable compared to explicit org-test-with-temp-text because one needs to reach out to another file in order to understand what the test is about. >>> Optional argument TARGET-FILE can be used to specify a default >>> -export file for all source blocks. >>> +export file for all source blocks without :tangle header >>> +argument. >> >> This is confusing. >> Is :tangle yes "without"? >> What about inheritance? >> What about default header args? > > I just find current lack of details confusing as well and want to > express the place of TARGET-FILE in the lineage of :tangle in > ~org-babel-get-src-block-info~: > 1. org-babel-default-header-args > 1. TANGLE-FILE of ~org-babel-tangle~ > 2. org-babel-default-header-args: > 3. org-babel-params-from-properties > 4. org-element-property :parameters datum > 5. org-element-property :header datum > > It wasn't clear for me: will ":tangle yes" or explicit ":tangle no" be > affected by TARGET-FILE. Maybe if we rephrase as follows it will be > clear for both of us: > > Optional argument TARGET-FILE can be used to overwrite a default > export file in `org-babel-default-header-args' for all source > blocks. In `org-babel-tangle', TARGET-FILE is set as fallback value for the blocks that have no :tangle value at all, including inherited; including :tangle yes. The manual asserts =E2=80=98yes=E2=80=99 Export the code block to source file. The file name for the source file is derived from the name of the Org file, and the file extension is derived from the source code language identifier. Example: =E2=80=98:tangle yes=E2=80=99. So, "yes" should imply :tangle `org-babel-tangle-collect-blocks' handles this by (unless (or (string=3D src-tfile "no") (and tangle-file (not (equal tangle-file src-tfile))) (and lang-re (not (string-match-p lang-re src-lang)))) So, :tangle no is always excluded. When TANGLE-FILE is set and not equal to :tangle value (including "yes"), block is also excluded. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at