From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: Asks user what to do with each tangle-file before overriding? Date: Mon, 19 Jun 2017 13:06:57 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1b4d9c8b738c0552491c3f" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMouR-0005Sp-Je for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 01:07:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMouP-0002bd-Td for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 01:07:31 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:33637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMouP-0002bR-Iz for emacs-orgmode@gnu.org; Mon, 19 Jun 2017 01:07:29 -0400 Received: by mail-wr0-x22c.google.com with SMTP id r103so65081879wrb.0 for ; Sun, 18 Jun 2017 22:07:29 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Chunyang Xu Cc: Org-mode --94eb2c1b4d9c8b738c0552491c3f Content-Type: text/plain; charset="UTF-8" I also think Org-mode table src block content to override file is dangerous. I have another idea. Append src block content to end of file. I have a sceniro: File `dotfile-1.org`: ``` * SSH config 1 #+BEGIN_SRC conf :tangle "~/.ssh/config" fragment 1 #+END_SRC ``` File `dotfile-2.org`: ``` * SSH config 2 #+BEGIN_SRC conf :tangle "~/.ssh/config" fragment 2 #+END_SRC ``` When the tangle src blocks are in separate files, this override file way is not suitable. Of course I can put those src blcoks together, but when I have to organize literate programming files in separately, the override way is not suitable anymore. So hope Org-mode can provide `append` way with an `defcustom` option. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Fri, Jun 16, 2017 at 1:09 PM, Chunyang Xu wrote: > Hi, > > Currently 'C-c C-v C-t' ('org-babel-tangle') simply overrides existing > tangle-file, I would like org to ask me what to do? such as > > a) yes (override) > b) no (don't override) > c) show the diff then ask again > > In addition, if there is no diff (i.e., having the same contents), user > can choose (e.g., via a user option) to simply pass this tangle-file > without overriding. > > I am asking for this feature because I am storing my dotfiles in a > single Org file [1], and when I change my Bash configuration then > tangle, I don't need to worry if Org is tangling other configuration > correctly, especially ~/.ssh/id_rsa and ~/.authinfo.gpg. I would rather > leave these unchanged files than override (even only file modification > timestamps are updated). > > [1] https://raw.githubusercontent.com/xuchunyang/dotfiles/ > master/README.org > > > > --94eb2c1b4d9c8b738c0552491c3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I also think Org-mode table src block content to override = file is dangerous.

I have another idea. Append src block con= tent to end of file.

I have a sceniro:

File `= dotfile-1.org`:
```
* SSH co= nfig 1

#+BEGIN_SRC conf :tangle "~/.ssh/config"
fragment 1
#+END_SRC
```

```
* SSH config 2

=
#+BEGIN_SRC conf :tangle "~/.ssh/config"
fragment 2
#+END_SRC

```

When the tangle src blocks a= re in separate files, this override file way is not suitable.
Of cours= e I can put those src blcoks together, but when I have to organize literate= programming files in separately, the override way is not suitable anymore.= So hope Org-mode can provide `append` way with an `defcustom` option.


=
[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA= 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/=

On Fri, Jun 16, 2017 at 1:09 PM, Chunyang Xu= <mail@xuchunyang.me> wrote:
Hi,

Currently 'C-c C-v C-t' ('org-babel-tangle') simply overrid= es existing
tangle-file, I would like org to ask me what to do? such as

a) yes (override)
b) no (don't override)
c) show the diff then ask again

In addition, if there is no diff (i.e., having the same contents), user
can choose (e.g., via a user option) to simply pass this tangle-file
without overriding.

I am asking for this feature because I am storing my dotfiles in a
single Org file [1], and when I change my Bash configuration then
tangle, I don't need to worry if Org is tangling other configuration correctly, especially ~/.ssh/id_rsa and ~/.authinfo.gpg. I would rather
leave these unchanged files than override (even only file modification
timestamps are updated).

[1] https://raw.githubusercon= tent.com/xuchunyang/dotfiles/master/README.org




--94eb2c1b4d9c8b738c0552491c3f--