all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Thoughts on support for vc-diff unsaved buffer contents?
@ 2024-11-21 22:02 Campbell Barton
  2024-11-22  0:04 ` James Thomas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Campbell Barton @ 2024-11-21 22:02 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-23 17:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 22:02 Thoughts on support for vc-diff unsaved buffer contents? Campbell Barton
2024-11-22  0:04 ` James Thomas
2024-11-22  6:05 ` Alfred M. Szmidt
2024-11-22  7:44 ` Juri Linkov
2024-11-22  9:05   ` Campbell Barton
2024-11-23 17:58     ` Juri Linkov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.