Browse Source

Unison merge with emacs

nixos
Maxime Wack 4 years ago
parent
commit
a92df1ed30
2 changed files with 16 additions and 1 deletions
  1. +11
    -0
      .config/bin/unison-merge-files
  2. +5
    -1
      .unison/Projects.prf

+ 11
- 0
.config/bin/unison-merge-files View File

@@ -0,0 +1,11 @@
#!/bin/sh
CURRENT1=$1
CURRENT2=$2
NEW=$3
CURRENTARCHOPT=$4
EMACS="emacsclient -nc"
if [ x$CURRENTARCHOPT = x ]; then
$EMACS --eval "(emerge-files nil \"$CURRENT1\" \"$CURRENT2\" \"$NEW\")"
else
$EMACS --eval "(emerge-files-with-ancestor nil \"$CURRENT1\" \"$CURRENT2\" \"$CURRENTARCHOPT\" \"$NEW\")"
fi

+ 5
- 1
.unison/Projects.prf View File

@@ -3,7 +3,11 @@ label = Project list file and global notes
root = /home/maxx/Projects
root = ssh://home/Projects
sshargs = -C

path = notes.org
path = notes.org_archive
path = projects.org
repeat = watch

repeat = watch

merge = Name {*,.*} -> unison-merge-files CURRENT1 CURRENT2 NEW CURRENTARCHOPT

Loading…
Cancel
Save