From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GM40MMHIUWSizQAASxT56A (envelope-from ) for ; Wed, 03 May 2023 04:36:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wDU0MMHIUWRthAAA9RJhRA (envelope-from ) for ; Wed, 03 May 2023 04:36:49 +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 8945F87B7 for ; Wed, 3 May 2023 04:36:49 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu2LR-0001hq-Bc; Tue, 02 May 2023 22:35:53 -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 1pu2LP-0001hN-48 for emacs-orgmode@gnu.org; Tue, 02 May 2023 22:35:51 -0400 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pu2LN-0002xc-73 for emacs-orgmode@gnu.org; Tue, 02 May 2023 22:35:50 -0400 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 181dbf77 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 3 May 2023 02:35:46 +0000 (UTC) References: User-agent: mu4e 1.9.22; emacs 30.0.50 To: Mehmet Tekman Cc: emacs-orgmode@gnu.org Subject: Re: [ANN] lisp/ob-tangle-sync.el Date: Wed, 03 May 2023 10:31:33 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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: , Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683081409; a=rsa-sha256; cv=none; b=QnCUa7zdGg+ho0NgHTAO3l8rcdvqZxnsCoIafzv4lHDC2FBp/0hd1Zk7ZcdeF3+gGRUOKe FOfqEgIBs1v9X+QRI7wy6/QuB5bxDIZx6KqbaypUSHmwz0JTVEtsh1PMIYEJy0WLRd/saS 8Zra8noO2DkL1qpr5ub8wTCXKBHZQuzaqfWto3X3EwcYtSH5pVxQkT8aRmGZS1fQQ4lN40 cfMlo00CKYwCZukmnShwBKS1iXPSIjoOuZSSNdBfropgCN6phY8vSL9A0xmfGhou7SV4hA dcN1J4DmKM+/vGU0puXyYff16dEjtXHsGX0menYuDb2CsH8h0nn8q1sETzgQUg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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=1683081409; h=from:from:sender:sender:reply-to: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; bh=yA2PtCelURlqFEZ/tFndV3LWhlBS4xJQ4QQ9M0wSpgo=; b=und8hweDDKz4YHFJyu2xjlOM0k48OGfXa///QydnX2p26lMMeTRU3Cf4AXVQZ+SGAzJsOw 3+91M8xMNnW4nnF63Ug33zErmBqViq2yG76hu62M49uC29azItdUDgk2mO5Eo0C730lzkx HmssrZX9J2ZMk8HMYyQeAiKj3Ivp97lccZQFsnoZe9YUDF0W0hC2MuipMVUB8PGpIl0gh7 k/JsKzk9anIfsEDZQJcYtYqo7LAlFboVYvM4fCqxEVtAopfrTsGJOi2a1wGs66BDRU1SGN iUSh7jfbyumj+tM8HMxrmPzDOmQAg6GxdCy568/Vdx0xlV+bizJkDYRKQjiMrA== X-Migadu-Spam-Score: -2.41 X-Spam-Score: -2.41 X-Migadu-Queue-Id: 8945F87B7 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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-TUID: X+CuD4/K/SSZ Mehmet Tekman writes: > Hello again, sorry for the delay - I had some holiday time off > that couldn't wait ;-) > > I've modified the ob-tangle.el file for the main tangling and > detangling functions. Most importantly, both functions can now > exchange information from the source Org mode file to the target > remote tangle file in either direction, depending on whether the > source Org file has `:tangle-sync ' in the header. > > The action is one of: > > - "export" = always transmit information from the source Org mode > block to the target remote file. > - "import" = always transmit information from the target remote > file to the source Org mode block. > - "skip" = skip the block. > - "both" = transmit information from source block to target block > or target block to source, depending on whether the > tangle or detangle is called from the source buffer or > the target buffer respectively. > > These functions work at the whole buffer and at the per-block > level. The `org-babel-tangle-sync' functions automate this > process by hooking into the `after-save-hook' and tangling / > detangling the current block. > > I feel that I should write what the main motivation for this is: > Dotfiles that are always in sync with the org-mode files they > stem from. > > Hope this turns into something big! > Best, > > Mehmet > > [4. application/x-patch; 0005-lisp-ob-tangle-sync.el-Automatic-synchronization-of-.patch]... > > [5. application/x-patch; 0004-lisp-ob-tangle.el-Sync-aware-tangle-function-with-be.patch]... > > [6. application/x-patch; 0002-lisp-ob-tangle.el-Sync-action-aware-detangle-functio.patch]... > > [7. application/x-patch; 0003-lisp-ob-tangle.el-Tangle-function-made-aware-of-remo.patch]... > > [8. application/x-patch; 0001-lisp-ob-tangle.el-Detangle-a-single-block.patch]... > > [9. application/x-patch; 0006-etc-ORG-NEWS-lisp-ob-tangle.el-Added-news-and-name.patch]... I noticed that you modified argument order of a public function `org-babel-detangle' -- is it possible that you retain the order of arguments? The accumulated change you proposed is this: -(defun org-babel-detangle (&optional source-code-file) +(defun org-babel-detangle (&optional arg source-code-file ignore-header) What I think it should be: (defun org-babel-detangle (&optional source-code-file arg ignore-header) ...) This way, existing (external) users of this function can rest assured that their code is not broken by your patchset. Thoughts? -- Best, RY [Please note that this mail might go to spam due to some misconfiguration in my mail server -- still investigating.]