From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MC2rJMD9ZWQ/DAEASxT56A (envelope-from ) for ; Thu, 18 May 2023 12:28:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4Ji3JMD9ZWQCYwAA9RJhRA (envelope-from ) for ; Thu, 18 May 2023 12:28:16 +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 E1EB329E81 for ; Thu, 18 May 2023 12:28:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzaqx-0006Ju-Ny; Thu, 18 May 2023 06:27:23 -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 1pzaqv-0006Jl-I7 for emacs-orgmode@gnu.org; Thu, 18 May 2023 06:27:21 -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 1pzaqt-0006mJ-Kc for emacs-orgmode@gnu.org; Thu, 18 May 2023 06:27:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D9C50240027 for ; Thu, 18 May 2023 12:27:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1684405635; bh=9f4h+iL99pYuRQNJyrom6R/eoF1ESCiVpY2RKMhVo5A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=g01mk9zTzU4fofbB6kr9OoTN72NIFe1rFyG62/9k6+VlrQsa+aMfn+NmgSXI3AJ4D kwmmhL4RCoz4SscFZcEs25d0ftsJ89yKHp+OJmtoLdaUUW/ZhimCrhbkyVV6Eg4biI 9NMeM/hLI2+sZA4x2MhtlJ2f5NB4iNjWK6Xq0GKQY6rpFY3tCcyn34/eG5anT7I2kT Q54p4teJUtZDy8h3yv5g0U8IzSloWCkHnJUFBqgqRDUFiZjA1pPxfQfIOHrOegb2AY BIcyLSw4WWmtrxMMBInftGUxAYLtHQ8MXsowmJAwZxUCaoDNhSsEsVqGFZocHfL5je DR8nzia/ITWpA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QMR432GlMz9rxM; Thu, 18 May 2023 12:27:15 +0200 (CEST) From: Ihor Radchenko To: Mehmet Tekman Cc: emacs-orgmode@gnu.org Subject: Re: [ANN] lisp/ob-tangle-sync.el In-Reply-To: <87a5y3vzpe.fsf@gmail.com> References: <87r0rxabd4.fsf@localhost> <87sfcd78vw.fsf@gmail.com> <87r0rxv3t5.fsf@localhost> <87lei577g4.fsf@gmail.com> <87lei5v1fg.fsf@localhost> <87fs8duyae.fsf@localhost> <8735451u20.fsf@gmail.com> <874jokbjsk.fsf@localhost> <87zg6ch2dm.fsf@gmail.com> <87sfc4a0ce.fsf@localhost> <87r0ro9mzc.fsf@gmail.com> <87zg69zq49.fsf@localhost> <87r0rg1lwe.fsf@gmail.com> <87leho3y0n.fsf@localhost> <87a5y3vzpe.fsf@gmail.com> Date: Thu, 18 May 2023 10:30:37 +0000 Message-ID: <87jzx6ylrm.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_H2=-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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684405696; a=rsa-sha256; cv=none; b=cx+W1yA5kHkmVAau0HYkXm2fsrIoUv/7cnaP/beXkHYnw0juaTdMbt1BsCloe2dpudFg8V 0fuO3h7sJ4qLKwHGdsgNTDI508VbCaXbvOD6MsY0FbgbCNr8CJ3fgWp+GeXVbbQEwTl8nS 2wiPuoGb+IOyaoZuwWd2cJB6rafW+0TrwfDN60pP5W0v7IePW1DGqFv+TrzUhLLc+AxmH1 0T9B40KHLLRgFX38nZsob5bIHrApWP8S+JGYJFRWG/ONSyV50gjsg7bneiB2EVhm8OFzbG wdWjH3DjK8/oEqa2OrYxSd5HsSSASfdW+1e1YQvN1eXjUSOCT8rM0iagKDo44A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=g01mk9zT; 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=1684405696; 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=riECC2lViJzS7+yrHMkXSv2GRm/5baaUsRnIL6LvxWA=; b=MqResesQXaDJhR8j7IQ476upNJyO8utwXRDW7yhsP5wqB+BQomCyrn0xDTpybOdr6NsSfc CZBuiBxKuM1MFgBsl/4UCe37lhRCFuFd3Ki7ACxykIEw8LHKfagWdh07YTiuaaL5EbOrO7 E4+fd2OkPLiRRaF8mRGXAs7kmjK1Lqq+zk8ot3NjQIC4jsDKlgE7evXFdY55FgBq0oGAlQ Bp8pYEqpOamcPO7ufHBzWICAPLdGkfhJ3uxcS+wMyowXTyn4oYS0YixYzelWXbSsrbJjcF QvwV+DGhWje1icIu3UUya+gvLNk5LSmrJnFAwchyL5ndZ/x7Uwuul53qVEy0fw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=g01mk9zT; 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" X-Migadu-Spam-Score: -6.16 X-Spam-Score: -6.16 X-Migadu-Queue-Id: E1EB329E81 X-TUID: 7ZEw+tXECvTE Mehmet Tekman writes: >> See the above 3 examples: (1) "foo.txt" shadowed by "no"; (2) "no" >> shadowed by "foo.txt"; (3) "no" shadowed by "foo.txt" then shadowed by >> "yes". >> >> You can also consider "foo.txt" shadowed by "bar.txt" and other >> variations. > > I've created a small patch that contains a single ert test function that > checks an example org file I made (based on the above as well as my own > toy file) to try to validate the `org-babel-merge-params' rewrite. > > I've attached it below in case you want to test it... Is the patch testing your code? (Note on the ert tests: we generally prefer `org-test-with-temp-text' - the old approach with test IDs is not very readable because one needs to search those IDs manually when debugging test failures.) > ...but there were a few cases where I wasn't entirely sure what the > result of the merge was supposed to be: > > For example, a document with: > >> #+TITLE: Header tests >> #+PROPERTY: header-args :tangle /tmp/default_tangle.txt >> >> * Inherit tangle header from document >> >> #+begin_src conf >> (:tangle . /tmp/default_tangle.txt) >> #+end_src > > I would expect the output of: > > (assoc :tangle (nth 2 (org-babel-get-src-block-info))) > > within that block to evaluate to the contents written in that > block. Instead it evaluates to `(:tangle . no)' when run in a vanilla > Emacs. Is this expected? You forgot C-c C-c on the PROPERTY line, or re-opening the file. #+PROPERTY lines are not automatically parsed when you add them. They are only parsed upon explicit request (C-c C-c) or when opening the file. > Another example: > >> * Header args overwritten by local header >> :PROPERTIES: >> :header-args: :tangle "foo.txt" >> :END: >> #+begin_src :tangle yes >> (:tangle . foo.txt) >> #+end_src >> >> ** Inherited header >> >> #+begin_src :tangle "file with spaces.txt" >> (:tangle . "file with spaces.txt") >> #+end_src > > The first block correctly gives "foo.txt" under vanilla Emacs, but the > second block also gives "foo.txt". Is this expected behaviour? You forgot to specify the source block languages. Org sees your example as two src blocks of language ":tangle" with no proper header arguments. (See M-x org-lint) If you add a language, like #+begin_src conf :tangle yes (:tangle . foo.txt) #+end_src The expected result is (:tangle . "yes") for the first block and (:tangle . "file with spaces.txt") for the second block. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at