RelatedSoftware/Emacs

Emacs modes for darcs

Material on Emacs and darcs is collected at the Emacs wiki.

You will probably be interested in DarcsumMode and/or VC integration. Darcsum is a darcs-specific mode, somewhat analogous to the PCL-CVS mode for CVS, but with a neat treatment of changes available for selective recording.

Both are available on MELPA (darcsum 20190316.2215 and vc-darcs is 20230319.1149).

VC-integration

The following is required in your emacs config

(add-to-list 'vc-handled-backends 'DARCS)
(autoload 'vc-darcs-find-file-hook "vc-darcs")
(add-hook 'find-file-hooks 'vc-darcs-find-file-hook)

Shell completion

There is support for `programmable completion pcmpl-darcs.el in the Emacs shell, also available in MELPA.

Use Emacs as an external merge tool for darcs

(There’s a more comprehensive example in the manual for darcs 1.0.5.)

Create the following wrapper script:

#!/bin/sh
#
# 3 way merge using emacs from the command line

emacs --eval="(ediff-merge-files-with-ancestor \"$1\" \"$2\" \"$3\" nil \"$4\")"

then invoke darcs pull as follows:

$ darcs pull --external-merge='/path/to/the/wrapper/script.sh %1 %2 %a %o'

or just put the following line into ~/.darcs/defaults:

ALL external-merge /path/to/the/wrapper/script.sh %1 %2 %a %o

Wishlists

People have created wishlists of what an “ideal” darcs mode for emacs would require.

  • There’s one in DarcsumMode.

  • Why not use DVC? Darcs will become a backend to the emacs Distributed Version Control mode (http://wiki.gnuarch.org/xtla#DVC) DVC people begin the darcs backend: https://mail.gna.org/public/xtla-el-dev/2006-03/msg00087.html

  • I’m thinking the same. Yesterday found out about DVC and saw at http://download.gna.org/dvc/ that darcs back-end is not advancing nicely. Maybe the effort could be directed towards DVC back-end. It would be nice having common DVC interface for people that have to work with several distributed rcs. However, I’m not (yet) familiar with darcsum.el so cannot judge/compare its interface with DVC.

    [I had a shufti at DVC a while ago and couldn’t make much sense of it – Dave Love]