this patch make DEL (backspace) unmark the file and move UP, which
makes it easier to undo marking.
this is similar to the pcvs buffer behavior.



=== modified file 'lisp/dvc-diff.el'
--- lisp/dvc-diff.el    2007-05-02 09:20:41 +0000
+++ lisp/dvc-diff.el    2007-06-15 20:01:07 +0000
@@ -183,6 +183,7 @@
     (define-key map [?d] 'dvc-remove-files)
     (define-key map dvc-keyvec-mark   'dvc-diff-mark-file)
     (define-key map dvc-keyvec-unmark 'dvc-diff-unmark-file)
+    (define-key map [backspace] 'dvc-diff-unmark-file-up)
     (define-key map [?v] 'dvc-diff-view-source)
     (define-key map dvc-keyvec-parent 'dvc-diff-master-buffer)
     (define-key map [?j] 'dvc-diff-diff-or-list)
@@ -428,20 +429,29 @@
       (goto-char (point-max)))))
 
 
-(defun dvc-diff-unmark-file ()
+(defun dvc-diff-unmark-file (&optional up)
   "Unmark the file under point."
   (interactive)
   (if (eq (car (ewoc-data (ewoc-locate dvc-diff-cookie)))
           'message)
       (dvc-diff-mark-group t)
-    (let ((current (ewoc-locate dvc-diff-cookie))
-          (file (dvc-get-file-info-at-point)))
+    (let* ((current (ewoc-locate dvc-diff-cookie))
+           (cur-loc (ewoc-location current))
+           (prev (ewoc-prev dvc-diff-cookie current)))
+      (when (and up prev)
+        (goto-char (if (= cur-loc (point)) (ewoc-location prev) cur-loc))
+        (setq current (ewoc-locate dvc-diff-cookie)))
       (setq dvc-buffer-marked-file-list
-            (delete file dvc-buffer-marked-file-list))
+            (delete (dvc-get-file-info-at-point) dvc-buffer-marked-file-list))
       (ewoc-invalidate dvc-diff-cookie current)
-      (goto-char (ewoc-location (or (ewoc-next dvc-diff-cookie
-                                               current)
-                                    current))))))
+      (unless up
+        (goto-char (ewoc-location (or (ewoc-next dvc-diff-cookie current)
+                                      current)))))))
+
+(defun dvc-diff-unmark-file-up ()
+  "Unmark the file under point and move up."
+  (interactive)
+  (dvc-diff-unmark-file t))
 
 (defun dvc-diff-diff ()
   "Run tla file-diff on the file at point in *{tla|baz}-changes*."


-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 5 (Bordeaux)
http://israelunderattack.slide.com http://memri.org http://dhimmi.com
http://palestinefacts.org http://honestreporting.com http://mideasttruth.com
char*a="char*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to