{"thread":{"id":"43481","subject":"[PATCH 1/4] git.el: Added functions for moving to the next/prev unmerged file.","startedAt":"2006-11-03T16:41:23Z","lastAt":"2006-11-03T16:41:23Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"295025","messageId":"87d58432ks.fsf@wine.dyndns.org","threadId":"43481","inReplyTo":null,"subject":"[PATCH 1/4] git.el: Added functions for moving to the next/prev unmerged file.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2006-11-03T16:41:23Z","receivedAt":"2006-11-03T16:41:23Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"This is useful when doing a merge that changes many files with only a\nfew conflicts here and there.\n\nSigned-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n contrib/emacs/git.el |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 5354cd6..e283df2 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -670,6 +670,32 @@ and returns the process output as a stri\n   (unless git-status (error \"Not in git-status buffer.\"))\n   (ewoc-goto-prev git-status n))\n \n+(defun git-next-unmerged-file (&optional n)\n+  \"Move the selection down N unmerged files.\"\n+  (interactive \"p\")\n+  (unless git-status (error \"Not in git-status buffer.\"))\n+  (let* ((last (ewoc-locate git-status))\n+         (node (ewoc-next git-status last)))\n+    (while (and node (> n 0))\n+      (when (eq 'unmerged (git-fileinfo->state (ewoc-data node)))\n+        (setq n (1- n))\n+        (setq last node))\n+      (setq node (ewoc-next git-status node)))\n+    (ewoc-goto-node git-status last)))\n+\n+(defun git-prev-unmerged-file (&optional n)\n+  \"Move the selection up N unmerged files.\"\n+  (interactive \"p\")\n+  (unless git-status (error \"Not in git-status buffer.\"))\n+  (let* ((last (ewoc-locate git-status))\n+         (node (ewoc-prev git-status last)))\n+    (while (and node (> n 0))\n+      (when (eq 'unmerged (git-fileinfo->state (ewoc-data node)))\n+        (setq n (1- n))\n+        (setq last node))\n+      (setq node (ewoc-prev git-status node)))\n+    (ewoc-goto-node git-status last)))\n+\n (defun git-add-file ()\n   \"Add marked file(s) to the index cache.\"\n   (interactive)\n@@ -967,7 +993,9 @@ and returns the process output as a stri\n     (define-key map \"m\"   'git-mark-file)\n     (define-key map \"M\"   'git-mark-all)\n     (define-key map \"n\"   'git-next-file)\n+    (define-key map \"N\"   'git-next-unmerged-file)\n     (define-key map \"p\"   'git-prev-file)\n+    (define-key map \"P\"   'git-prev-unmerged-file)\n     (define-key map \"q\"   'git-status-quit)\n     (define-key map \"r\"   'git-remove-file)\n     (define-key map \"R\"   'git-resolve-file)\n-- \n1.4.3.3.gf3240\n\n-- \nAlexandre Julliard\n"}]}