Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation

From: [email-masked]
Date: Sat, 19 Nov 2016 21:37:20 -0500

Dima Kogan <[email-masked]> writes:

> +(defun diff--wrap-navigation (skip-hunk-start
> +                              what orig
> +                              header-re goto-start-func count)
> +  "I override the default diff-{hunk,file}-{next,prev}
> +implementation by skipping any lines that are associated with

The first line of a docstring should be a single sentence.

> +this hunk/file but precede the hunk-start marker. For instance, a

> +If a point is on 'index', then the point is considered to be in
> +this first hunk. Here I move the point to the @@... marker before

Double space end of sentence.  No need to mention "I" here, it should be
phrased imperatively, as in "Override the default...", and "Move the point...".

> +executing the default diff-hunk-next/prev implementation to move
> +to the NEXT marker"

End sentences with a period.

> +      ;; I trap the error

End sentences with a period, no need to mention "I".

> +;; Here the outer diff-hunk-next has skip-hunk-start set to t, but the
> +;; inner one does not, which breaks the loop

> +(defun diff-hunk-prev (&optional count skip-hunk-start)
> +  "Go to the previous COUNT'th hunk"

> +(defun diff-hunk-next (&optional count skip-hunk-start)
> +  "Go to the next COUNT'th hunk"

> +(defun diff-file-prev (&optional count skip-hunk-start)
> +  "Go to the previous COUNT'th file"

> +(defun diff-file-next (&optional count skip-hunk-start)
> +  "Go to the next COUNT'th file"

> +	    ;; There's no next hunk, so just take the one we have

End sentences with a period.

> +	    (t (list beg end))))))
> +      ;; applying hunks too.  See http://debbugs.gnu.org/17544

>> Also, I believe usual comment style is to use "we" not "I", and you
>> didn't end the last sentence with a period.
>
> Changed the I/we. I'm omitting the trailing . on purpose to make sure it
> doesn't get confused with the URL.

I suggest ";; applying hunks too (see http://debbugs.gnu.org/17544).",
referencing the bug with "Bug #17544" instead of a full URL could also
work.