From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas Newsgroups: gmane.emacs.devel Subject: Re: Thoughts on support for vc-diff unsaved buffer contents? Date: Fri, 22 Nov 2024 05:34:02 +0530 Message-ID: <86o728i171.fsf@gmx.net> References: <68c0ce3e-8316-43db-8f3c-ead0ad028326@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24807"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 22 01:04:31 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tEH9y-0006LD-OM for ged-emacs-devel@m.gmane-mx.org; Fri, 22 Nov 2024 01:04:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEH9m-0002NU-Bn; Thu, 21 Nov 2024 19:04:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tEH9i-0002N7-C9 for emacs-devel@gnu.org; Thu, 21 Nov 2024 19:04:14 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tEH9g-0000a9-FG for emacs-devel@gnu.org; Thu, 21 Nov 2024 19:04:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1732233848; x=1732838648; i=jimjoe@gmx.net; bh=XcNhsgwfh7sreTkq33zm+vRBEmy2NyfMwc8m0fO9iaQ=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=RhuTuDwqLsU9hBGH9dq0/i6ylF1hfS2FkJhxQZUO7COh2Z8B2dcOY15BY1ZFTTS3 rGCa1f00mbagNKHNrb8LBSth9p79zkeK0lM42V23lI+Jx/9ij8oK+dw4I3RSiA524 bik+nKq+vR/+3/Y72fY12XZgZIddJCCS42IWAZt5zQWV49DDOP7SGBtz68VqVWvAF MJ7+zKJb3VajwR0PXuqhqUa5KxXwSMpICgQe0CMq8nkVmvVHVxLbCUO+xJoOUKCzE LG8O7m4NariXgcMaueH5gq3M1B3Zp6AsG7U/i5sswDC7bzd5yjMyBS9LcWqPW+sOD jZN8I6r5GshKTvgsXA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([42.108.29.83]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MdebB-1tn3wM1ui1-00aUgF for ; Fri, 22 Nov 2024 01:04:08 +0100 In-Reply-To: <68c0ce3e-8316-43db-8f3c-ead0ad028326@gmail.com> (Campbell Barton's message of "Fri, 22 Nov 2024 09:02:30 +1100") X-Provags-ID: V03:K1:RPjfXgVdPvs90KNN8udnf26AgecvFle4NzLKg3B5oeErkA51CPo KvbrvRElctrNHpFTNF8AWiiqMbPIzXvQeAtqBs/8gbej4t24i/M4rXCRMQQb/YkaJBhxmD/ oHhbLLwRRj1Ql6nC5ieh8MIzqLhuFj+iajauZPxflqwaBn9ZVg6gxwxAw6MhgB5iDENCzce 331vIMmCAQ28efPsfhIAQ== UI-OutboundReport: notjunk:1;M01:P0:5JSd3Xvej80=;jUJ5kjnny2QfN7OJd249YzV0YX0 uY7XMAqcebdOAz+x/C4U5os42lDFASxCXjim2g70OW65Xh5OZtAVNxFguFnANkH+bMlQ5DUY6 4S9Iy8zgYS2ZISq0NGEbVdBVQDyhyWVEtcD4FfSk47317Germ8EUad/EUMII8QmnV+Beol9Nz xihjcGVJTguxz4WBCDzaULNKImz5rTESVrHpfpz7DKSzptAJxx3UPKXvKGW+RYrGFww4gQCwL 7wGbQbEgJOssIYWgrwnphrkec/Hp0iS+3z4JeMgLUJ/EkhVhODEI3cSB8PiVL6u1sDfrW10/e pXRw4qrECF7EG148dTjMHrQhNluBYAeXasm//B45T/qzUviAx72zSSzBTXkaB9oGLEs2IFW1Q fYbhOett31oNmmwJ+9UXppwdaXdjY+JPl3EHECGJbNfJDxi5VbcRAkc+RF6r5/3PSyDSPI9/h s0symEx35F9deTXdygtXzBOtRyxPHZlkzpDy0dLC49SVK9vJyKq4yLDT6UnS0sP0kia23z1hx ZJmYMh09cUS7EP35qkYOGNEiwNuKhvgbFH96F8PlmgCxuFG6JIkzCR9te57l8YEY0eTlyxCer NyHy5hX92PPAULiiwYJG+AsZBEMDP1iaYa+MoFYC3l0vryhynnY5Nz4laneJXOM6K8+NRVChT I/+SfsagR9/pxKHmlztZcVpDYkEPXx5ydcNRIkM0zdijrQlDKC8gxg3RQoAGcGNVck/EXv53x B4HTEjJWocknFE7IrGNt0PSX/b5DcptawJpOIHM3OhZCJcJ+Q4/jk+oWu+6fxtZx/Llzi/eH Received-SPF: pass client-ip=212.227.17.20; envelope-from=jimjoe@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325567 Archived-At: Campbell Barton wrote: > 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). > > ... > > 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. Isn't it enough to pipe vc-find-revision-no-save of vc-working-revision to diff? (IIUYC) --