[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thoughts on support for vc-diff unsaved buffer contents?
From: |
Campbell Barton |
Subject: |
Thoughts on support for vc-diff unsaved buffer contents? |
Date: |
Fri, 22 Nov 2024 09:02:30 +1100 |
User-agent: |
Mozilla Thunderbird |
Hi, recently I've run into a situation where it's necessary to calculate
modified line ranges without first saving the buffer (where "modified"
is determined by a version control diff).
I'm curious if this is something that might be supported - or, is
already supported (although I'm fairly sure it's not).
The use case is for auto-formatters only to format modified lines.
This particular case is for clang-format.el although the same
functionality could useful for other formatters too.
clang-format.el can be configured to format on save,
so when saving: clang-format.el calculates the lines that differ from
the working copy them formats them before saving.
Currently it's necessary for clang-format.el to call git & diff
directly, which makes the functionality limited to git. I was hoping
this could be supported in a generic way that uses generic `vc` API's.
- Thoughts on support for vc-diff unsaved buffer contents?,
Campbell Barton <=