bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37395: [PATCH] diff-mode.el: take into account patch separators


From: Eli Zaretskii
Subject: bug#37395: [PATCH] diff-mode.el: take into account patch separators
Date: Fri, 13 Sep 2019 09:14:03 +0300

> From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
> Date: Fri, 13 Sep 2019 00:34:45 +0300
> 
> * lisp/vc/diff-mode.el (diff-goto-line-before-patch-separator): an
> inline function to check if prev. line was git-format-patch separator,
> in which case go there.
> (diff-end-of-hunk): make use of (diff-goto-line-before-patch-separator)

The descriptions of changes should start with a capital letter.  Also,
your lines in the commit log message are too long, they should not
exceed 61 characters (because in the release tarball we create a
ChangeLog file from them, which prepends a TAB character to each
line).

> +(defsubst diff-goto-line-before-patch-separator ()
> +  "Go to prev. line, then if it has patch separator as produced
> +by git-format-patch, stay there. Otherwise go back."

The first line of a doc string should be a complete sentence.  I
suggest to rephrase as follows:

  Return buffer position before patch separator produced by git-format-patch.

> +  (previous-line)
> +  (when (not (looking-at "-- "))
> +      (next-line))
> +  (point))

Btw, Diff mode is more general than just Git-produced diffs.  Is there
any possibility that this change will misfire in diffs produced by
other tools?  If so, perhaps we should also verify the buffer is under
Git control.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]