From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 4P9FB6nJwGTrIgAASxT56A (envelope-from ) for ; Wed, 26 Jul 2023 09:22:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8LpdBqnJwGSEAwAAG6o9tA (envelope-from ) for ; Wed, 26 Jul 2023 09:22:17 +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 E0D86642D5 for ; Wed, 26 Jul 2023 09:22:16 +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 1qOYpN-00013t-VN; Wed, 26 Jul 2023 03:21:01 -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 1qOYpD-0000zb-ES for emacs-orgmode@gnu.org; Wed, 26 Jul 2023 03:20:51 -0400 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 1qOYp8-0008FW-Mm for emacs-orgmode@gnu.org; Wed, 26 Jul 2023 03:20:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DC0C9240103 for ; Wed, 26 Jul 2023 09:20:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690356038; bh=l7oabByDDT4ghHsVoAZ6KQkbDPXLFaIF387StY0Omwk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=ODRXpyW6TuIAowRGKczeNXseb1j6yzfYgbDThfcRABKdxFYEE5CUhz5zO0GqVSHFC qjmES4Az2fIGc5Oi5Of+V+DyYzdXmaJ6YdYHjcR+0330mJMcn51tRvRs/EndOfmICw clngYDR/XKs4gVAb9pE2AjekN8ylP886hobBN75Ge7tt6yjlyKq12ahWLZG+J9U+RT fZDqNdLDgKQat4vhqKGRyw4pPYRNmFGuBw8VczkWhNH1l750I1dfUGb1+oqX/SlTXt X5fdL7D0VWP6heEhKjupUEIKK23/yWo8Xt01j5L6/Uo7TM3QA0OHKYTJ1L1+uM8w6m rt1oaFrPzhkKg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R9lft01TBz6tvJ; Wed, 26 Jul 2023 09:20:37 +0200 (CEST) From: Ihor Radchenko To: Evgenii Klimov Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v4] ob-tangle.el: Blocks overwrite each other when grouping before tangling In-Reply-To: <871qgwgcc9.fsf@lipklim.org> References: <87lefkd9tb.fsf@lipklim.org> <87h6q8d9lz.fsf@lipklim.org> <87cz0wcbtt.fsf@lipklim.org> <87ttu6j2zr.fsf@localhost> <87bkg1h4q3.fsf@lipklim.org> <87fs5c79ss.fsf@localhost> <871qgwgcc9.fsf@lipklim.org> Date: Wed, 26 Jul 2023 07:20:47 +0000 Message-ID: <87mszjm94g.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.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=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-Spam-Score: -4.00 X-Migadu-Queue-Id: E0D86642D5 X-Migadu-Spam-Score: -4.00 X-Migadu-Scanner: mx0.migadu.com X-TUID: RLf1ONRh5kfq Evgenii Klimov writes: >> So, :tangle no is always excluded. >> When TANGLE-FILE is set and not equal to :tangle value (including >> "yes"), block is also excluded. > > Indeed, but later > > =E2=80=98no=E2=80=99 > The *default*. Do not extract the code in a source code file. > Example: =E2=80=98:tangle no=E2=80=99. > > in conjunction with TARGET-FILE's description in ~org-babel-tangle~ > docstring: > > Optional argument TARGET-FILE can be used to specify a *default* > export file for all source blocks. > > made me feel doubt about TARGET-FILE's effect. TARGET-FILE is used instead of the normal default. > +(ert-deftest ob-tangle/collect-blocks () > + "Test block collection into groups for tangling." > + (org-test-with-temp-text-in-file > + "* H1 with :tangle in properties > +:PROPERTIES: > +:header-args: :tangle relative.el > +:END: > .... > + ;; to the first header > + (insert (format "#+begin_src emacs-lisp :tangle %s > +\"H1: absolute org-file.lang-ext :tangle %s\" > +#+end_src" el-file-abs el-file-abs)) > + (goto-char (point-max)) This combination of pre-filled text and insertions is a bit disorienting. I understand why you need to insert some things only after we know the temporary Org file name, but I'd instead placed all the contents together via insert. > +#+begin_src emacs-lisp :tangle %s > +\"H2: relative org-file.lang-ext :tangle %s\" > +#+end_src" el-file-rel el-file-rel)) > + (should (equal (funcall expected-targets-fn 4) > + (funcall collected-targets-fn (org-babel-tangle-col= lect-blocks)))) When reading this code, I have no idea what it is trying to test. Probably something to do with function names not being descriptive. At least, a comment would help. And the magic numbers "4" and "5" have no obvious meaning. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at