GNU bug report logs - #37395
Diff-mode doesn't take into account patch-separators as produced by git-format-patch

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <hi-angel <at> yandex.ru>

Date: Thu, 12 Sep 2019 21:34:02 UTC

Severity: normal

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Cc: 37395 <at> debbugs.gnu.org
Subject: bug#37395: [PATCH v3] diff-mode.el: take into account patch separators
Date: Mon, 07 Oct 2019 06:39:40 +0200
(Some minor comments.)

Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:

> +(defsubst diff-prev-line-if-patch-separator ()
> +  "Return previous line if it has patch separator produced by
> +git-format-patch."

I don't think this needs to be a defsubst -- a defun is fine here.  And
the first doc string line should be a complete sentence.

> +(setq-local diff-buffer-type nil)

This should probably be a defvar and then a setq-local in `diff-mode'.

> +  (save-excursion
> +    (if (re-search-forward "^diff --git" nil t)
> +        (setq diff-buffer-type 'git)
> +      (setq diff-buffer-type nil))))

Hm...  are we really guaranteed that all git diffs have that string in
it somewhere?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 284 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.