From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: File names in ChangeLog entries Date: Tue, 30 Nov 2021 20:07:12 +0000 Message-ID: <87pmqhl85r.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38006"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 30 21:08:19 2021 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 1ms9QI-0009gg-1K for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Nov 2021 21:08:18 +0100 Original-Received: from localhost ([::1]:56848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms9QF-0000ZS-CA for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Nov 2021 15:08:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms9PM-0007r4-Q2 for emacs-devel@gnu.org; Tue, 30 Nov 2021 15:07:20 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:55585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms9PH-0002Tm-WB for emacs-devel@gnu.org; Tue, 30 Nov 2021 15:07:19 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id AC20D240026 for ; Tue, 30 Nov 2021 21:07:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1638302833; bh=VqtlUwjtxgbG79hviEH/YBuzcsuOMk4aAC+gxNAEO3I=; h=From:To:Cc:Subject:Date:From; b=g4M4Baw6KpTbWCxgfPRbiGd1iU/sJJBcPCiZYulakHRHPXWlAsmrgpYT+uhNn45aP jooihZHfYHRMpfGXu4nKUmvbCNwNfJOf+u3qNiDc3h4yRWYq1xxt1cKe7V9A//T+HP wB/CaxEpU85kvOzibnq4XdZVASueQza8aYsdD5dQ9X8cpDYxmGdmFVO0263IdHFR25 bMMS9Q+CTypnA/j55TXcMQeYGyx2KKR+kHgQgyq4DtkGtFAjNwi3PBLtmypRRk05Ai ta0nOmEZw6pN27eqyZigOKRnJLW9U1S3g0Gu/dF1xGwvoCKya/kMcS0V1CnP5c0FKY HhnjQh0taqDKA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4J3YCj13b4z6tmF; Tue, 30 Nov 2021 21:07:13 +0100 (CET) In-Reply-To: (Stefan Kangas's message of "Tue, 30 Nov 2021 11:19:55 -0800") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-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" Xref: news.gmane.io gmane.emacs.devel:280557 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > I recommend using `add-change-log-entry-other-window' bound to `C-x 4 a' > to get this right. As I use C-c C-w in log-edit, I would appreciate it if a patch like this could be merged: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-VC-relative-file-names-in-ChangeLog-entries.patch >From f3f87cab56d1bc1754d9e83a9dd53d0cb48c02b0 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 30 Nov 2021 21:05:42 +0100 Subject: [PATCH] Use VC-relative file names in ChangeLog entries * lisp/vc/diff-mode.el (diff-add-log-current-defuns): Check vc-root-dir to prepend the project path to the file being modified. See https://mail.gnu.org/archive/html/emacs-devel/2021-11/msg02195.html --- lisp/vc/diff-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 057ffcd06e..40749754d8 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2343,7 +2343,10 @@ diff-add-log-current-defuns ;; hunks (e.g., "diff --git ..." etc). (re-search-forward diff-hunk-header-re nil t) (setq hunk-end (save-excursion (diff-end-of-hunk))) - (pcase-let* ((filename (substring-no-properties (diff-find-file-name))) + (pcase-let* ((filename (substring-no-properties + (file-relative-name + (diff-find-file-name) + (vc-root-dir)))) (=lines 0) (+lines 0) (-lines 0) -- 2.34.0 --=-=-= Content-Type: text/plain (Something is currently wrong with my Savannah account so I wouldn't be able to push the change myself). -- Philip Kaludercic --=-=-=--