 (defun diffscuss-get-new-rev ()
     (diffscuss-get-rev "^index [^.]+\\.\\.\\([^. \n\r]+\\)"))
 
+;; navigation
+
+(defun diffscuss-next-comment ()
+  "Jump to the next comment."
+  (interactive)
+  (if (diffscuss-parse-leader)
+      (goto-char (diffscuss-find-body-end)))
+  (beginning-of-line)
+  (forward-line 1)
+  (while (and (not (diffscuss-parse-leader))
+              (zerop (forward-line 1)))))
+
+(defun diffscuss-previous-comment ()
+  "Jump to the previous comment."
+  (interactive)
+  (if (diffscuss-parse-leader)
+      (goto-char (diffscuss-find-comment-start)))
+  (beginning-of-line)
+  (forward-line -1)
+  (while (and (not (diffscuss-parse-leader))
+              (zerop (forward-line -1))))
+  (if (diffscuss-parse-leader)
+      (goto-char (diffscuss-find-comment-start))))
+
 ;; Define the mode.
 
 (defun diffscuss-mode ()

      (or (looking-at comment-body-regexp)
          (forward-line 1))
      (point))))

(defun diffscuss-find-body-end ()
  "Return the end position of the current comment."

    (define-key map "\C-j" 'diffscuss-newline-and-indent)
    (define-key map (kbd "RET") 'diffscuss-newline-and-indent)
    (define-key map "\C-o" 'diffscuss-open-line)

    ;; navigation
    (define-key map "\C-cn" 'diffscuss-next-comment)
    (define-key map "\C-cp" 'diffscuss-previous-comment)

    map)
  "Keymap for diffscuss mode.")

