GNU bug report logs - #33567
Syntactic fontification of diff hunks

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sat, 1 Dec 2018 22:13:02 UTC

Severity: wishlist

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33567 <at> debbugs.gnu.org
Subject: bug#33567: Syntactic fontification of diff hunks
Date: Thu, 06 Dec 2018 01:35:17 +0200
>> When this special variable is set by a diff command, it's safe to assume
>> that the files referenced from the diff buffer really exist, so it's
>> safe to try reading them.  I don't want a patch in a mail attachment
>> to try reading files mentioned in the patch attachment.
>
> I think you lean heavily towards the use case where the diffs were
> produced by some Emacs command.  Whereas what I have in mind is the
> use case where the diffs came from some other source, like manual
> invocation of shell commands.  I'm saying that in the absence of
> diff-default-directory, using default-directory and 'cd' will be much
> easier for users.

Users still can use all diff-mode commands to visit source files from them.
Only language syntax fontification in diffs will fall back to hunk-only
when a diff buffer is not created by a diff command.  This is to avoid all
possible dangers of automatically visiting files in arbitrary diff buffers.

> The use case I have in mind is that some time passes between the
> generation of the diffs and the time the diffs are visited and
> fontified.  During that time, the working revision could have been
> changed.  Isn't that what this issue is about?  If so, we should
> explain why in that case, rare as it could be, the fontification might
> be wrong.

Fontification can't be wrong because code verifies if hunks from diff
still exist in the updated file, and doesn't highlight changed hunks.




This bug report was last modified 6 years and 146 days ago.

Previous Next


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