 
 (defun darcsum-diff ()
   "Show the changes made to current selection."
-  (interactive)
-  (if (not (darcsum-original-path (point)))
+  ; XXX - does not work with darcs2!
+  (interactive)
+  (let ((type (darcsum-get-line-type))
+	(original-path (darcsum-original-path (point))))
+    (cond
+     ((not original-path)
       (error "No record of this file in darcs"))
-  (let ((type (get-text-property (point) 'darcsum-line-type)))
-    (cond
      ((eq type 'dir))
      ((or (eq type 'file)
           (eq type 'change))
       (require 'diff)                   ; for `diff-switches'
-      (diff (darcsum-original-path (point))
+      (diff original-path
             (darcsum-path (point))
             (or darcsum-diff-switches diff-switches))))))
+
+(defun darcsum-path (pos)
+  (expand-file-name (get-text-property pos 'darcsum-line-path)))
+
+(defun darcsum-original-path (pos)
+  (let* ((path (get-text-property pos 'darcsum-line-path))
+	 (pristine-path (expand-file-name path "_darcs/pristine"))
+	 (current-path (expand-file-name path "_darcs/current")))
+    (cond ((file-readable-p pristine-path) pristine-path)
+	  ((file-readable-p current-path) current-path))))
 
 (defun darcsum-delete ()
   "Remove selected changeset from the view."

  "Refresh the status, redoing `darcs whatsnew'."
  (interactive "P")
  (darcsum-check-darcsum-mode)
  (let ((dir default-directory)
        (look-for-adds (or arg darcsum-look-for-adds))
        (darcsum-default-expanded t))
    (message "Re-running darcsum-whatsnew")

  (darcsum-remember-window-configuration)
  (let ((parent-buf (current-buffer))
        (changeset (darcsum-selected-changeset t))
        (buf))
    (if (null changeset)
	(error "No changes are selected"))
    (if (darcsum-changeset-any-p changeset
				 (function
				  (lambda (change)
				    (memq (car change) '(newdir newfile)))))
	(error "You have to add new directories and files first."))
    (switch-to-buffer-other-window (setq buf (get-buffer-create "*darcs comment*")))
    (if (fboundp 'log-edit)
	;; TODO: add SETUP (nil?) and LISTFUN arguments?  See also `vc-log-edit'
	(log-edit #'darcsum-really-record)
      (darcsum-comment-mode) )
    (set (make-local-variable 'darcsum-changeset-to-record) changeset)
    (set (make-local-variable 'darcsum-parent-buffer) parent-buf)
    (message
