GNU logs - #59491, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers
Resent-From: Gabriel <gabriel376@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 22 Nov 2022 20:59:02 +0000
Resent-Message-ID: <handler.59491.B.166915072217554 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 59491
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 59491 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.166915072217554
          (code B ref -1); Tue, 22 Nov 2022 20:59:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Nov 2022 20:58:42 +0000
Received: from localhost ([127.0.0.1]:52689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxaLp-0004Z3-B9
	for submit <at> debbugs.gnu.org; Tue, 22 Nov 2022 15:58:41 -0500
Received: from lists.gnu.org ([209.51.188.17]:58112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriel376@HIDDEN>) id 1oxaLk-0004Ym-9H
 for submit <at> debbugs.gnu.org; Tue, 22 Nov 2022 15:58:37 -0500
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 <gabriel376@HIDDEN>)
 id 1oxaLj-0008BK-PS
 for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2022 15:58:36 -0500
Received: from mail-mw2nam10olkn2091.outbound.protection.outlook.com
 ([40.92.42.91] helo=NAM10-MW2-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oxaLh-0003gH-9M
 for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2022 15:58:35 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LY38srNsFa6PWnkDRJ2nX5YDi1D7tyeI8zU3J7lSOezZ/Gg18Th+y+WAQXefbwl12XFF1YTKusEo3bvSAEimtYvJRsMS3wFHb4L19OQJ87I0Allq9lto7mUxTYET5DDVBTRNVjn2FTNkoUElQ0uyUCwOkAGlzjbeXYw6xxsrFP/n1LYBPGF/S0ZerSnpnhUSchoGSGfYRHpVSBeoq+hwdw3Of2GOrRiTO7uEFuMEcRdGbzosUANtome5ul19JucTkHpFp8h1pNjf8ndmgcYmJC8JmJGjMIPDqdUg7Owa/RV+IS/urKaY5Ln9K9fSXVJ1jbtgPuQotaAs3wL5yP+yxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TkqM3Jl1i9zDCcWwKyYlBukxwDn30UkvSbv5tzypO9s=;
 b=PBOS4nLWQ6aUAE4csOX50Z5P7xh/h2ygUgYR3n4cg+hJavN3VrWyZe93FaYgs+74o43VnYG7tsa7xS3WAqujZTUsRyqF5djVodxT6Zx9QM20tmGjUdCM63rhw+Yw5PQ7Mkb8HORKpffG7tV261FSr7r/rqJVviMaLIQ4kTBgofHJTja0VJ/oxxZPIPixcUQOBrHqFzCBIxIKHej0q/W0yTmJOGTjqQ+DcOI5V93VLjrHr9S7kc2ZcJX99pcJSarlP64RzJ02NSpAFBQ0mbLmupqN2c5e7s3EAirwRbEgTn1+jKKH2Fc0vzQqeY3KnAqzxiNTWQv/CxXHIuaM3U6GTA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TkqM3Jl1i9zDCcWwKyYlBukxwDn30UkvSbv5tzypO9s=;
 b=n/BpFEVeW48cRKqbHnprvTSHySe9DN/MaWGzdfs2ATc62ofw8hsvhf9IncI1h9hlXAbMpxXOcjKdPLMVV+gXWnKkl1VkAiQ+1/JjsZEgHGEAcoATVAjA5On8xlyCwmGJlS96hHquwn3WupVtVun+WEfe9PZA/9CgG9sJWvg32VdJmyalujepPmDsi6lKhmgL7e3YpG7gjHmFaeTxpbzaX0773nrm1jr6JgeVgSnMtqFAnL9aHNHL85SjfRsRPN21JNMaX7ebbv10TM4/gCasXUY/6CA3Mero6EiOfcF+vYfFveSr47HdpEAehcl2QcfFrezFqlZm+5ATlXgvnM3rmA==
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11)
 by CO1PR06MB8089.namprd06.prod.outlook.com (2603:10b6:303:e4::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov
 2022 20:58:30 +0000
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f]) by SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f%4]) with mapi id 15.20.5857.017; Tue, 22 Nov 2022
 20:58:30 +0000
From: Gabriel <gabriel376@HIDDEN>
Date: Tue, 22 Nov 2022 17:58:25 -0300
Message-ID: <SJ0PR06MB8609F6C7601B6EB1B5BBFC918B0D9@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-TMN: [w/4UNlPQxWUz5cRSnr6fO2gyYEim2GE6ZQLVI2eN+ID6/lIAI+oPjIllbvVmO1EP]
X-ClientProxiedBy: CPXP152CA0020.LAMP152.PROD.OUTLOOK.COM (2603:10d6:103::32)
 To SJ0PR06MB8609.namprd06.prod.outlook.com
 (2603:10b6:a03:40c::11)
X-Microsoft-Original-Message-ID: <875yf67lla.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR06MB8609:EE_|CO1PR06MB8089:EE_
X-MS-Office365-Filtering-Correlation-Id: a00a57e8-e64f-4658-6a34-08dacccc4f4f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: bowLxMibCStpz+fjPvGQDPfT2yFy5RptYHI9t7JUs6wg1tCUGOks3PjoWXp71YAUXvbBmYbZZmMfRn7XoaKHy0ib1wtH+wdoETP5mxZksIl1HOWUvAl4JdQZDd5BFf/iY43zGW8FZaubJEhMCCxCBJD9O3RRFA08KvbEhXW0g94vyv+wHga6HSaCBV6qNiPHPVclAp/GgKedIS7MacCrb98hQNTgPWSQUI7oDvtEkkXwhlvHtM09rTZ5VuHap/cUJo5FZCb/iZYwXCFujM5wjuKL9ZjwLesJoN87Iw8YKJdH3xzkNdqePsZFYbj5k2FyIJeHJXWUup5z+Mx2H0kE47j0+aUII0pmtG4L4ylZOqtiFTNgC3ukEMFTwOghcB29OR08uaJYAir0ucvHcblDA8IrKIC+gX9LNUd1NhH94Mg+lfnT3IzII0MBZDKGKmG/3pda3Fm7NdWSBrmXhpLHtrZft+W7K+/h4SV1gzZfdNDjDv2W7Bcl1rAFod1NiE8RSfuiYz4UMMy64uJ+6vskWKW01u/qviWkzFgyI5ssO8Y3KKmOw/Koxmi+41Ty6LElS0XzKAGEFFsKV3ZTFxgMxl0cYaiOEm3lJcJgRLs9eKU=
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: MhAoXfXqGQftdBjJWRBqJz5ObhkgdfilwQrNF7qFTpJUggWDUIX95l3MPfae0EZGrBg23bK0z1PI2gEqIGjTzE9R+kpgGL5wg+RGO9BHehEzPVd+l2fIZ803wMuNOSs/c35iw0kEY7weYb24o9qZ6V71/l+vii/jtkMcKkaRG2j9PHLg6K+fzcmQ18rDLJKJZ77+l7k3nniQe3wAhE/1Zl+FQbpJB5xaw2H3wT7sqRnxYDNYyC+/NgnS0aUMB2OyFMVN3t3cmq4B+dBfGSuucTs3TKnbxCob98LMhOeIsK4bleVxO93Egy8R3WykGNqOz+jbZV+VdThsJ+mmmUrGK401gkYESk9kA8yCHB9IkZxeD7KUWIpPTvd2PXG3WPIu8gELLctWEmpFj8gzsDHx2gOcUTRNqLUeAsHVu72vYG9ugMVP1uJ1nUuTy1tqzp5T7AgSxtQ0IkNVwpC6tDK6ZJXEE8//p0XpiX2FhYDEENSQDE3IHQBQcNclUbl0/mzAbTA+VqQcWJySex+J/oIO0hXYBbTZL353/atRmLJLyTTDfPNSkG4zETJ2+nGB8jphiwjKyKthzKDqJutAP0KjG+o9w8LzQUHeMoGUVHOT9XnvslB9lKvffylYuHMv7tsDEUkvnjlyC7Tg5GQwzKsnvrSuhZNau795p1K6gYNBCYtHL7QGZP5zeaffnvX7U3qU0hbHgLfLMd+03+aS8rYZT3tzgXGihlO94r1FRVzovB2y2CIG+96uSh7FBzo/mrR54+Vyo6by7RiEXQsd3+S4YjiZ+aSAeMzcC6CBfQ6fr9CwMEyqHxxSrvZTmbNoGVNf75yra0FyNDqVSDe4rliWl/aytlQ9ex5xapHF3S6CZyraFAj4+zrEqSsrd4y0CGfz0s9JhNilinX+FLGl6dyizTiMHjbMTCI+sWvfJRbkHNurG36emXqa/Wdu571gns9WcRnIRZJZYryz/jUNdNqPZ0U1IH8dRX0ogfhrgJSeTk798paU1jZ0iRd8m0e4M8Go8D0Tn5EDojVYNQAgjniV3StNZjWcSjYQEaXg00Z76zyNp8MBhlLW9KHzGfZLY77A2u3+an83VMtj4Z2RcHhVEaUGk+507kxZcYPNPbosczmya7XJe/efTjz0XIxGDf0wbN+w4GiOY40RbpaEcH7W02DcW6Ca1OaRk79gLi0AH+M0ElnMqPBQ/ZanHvYq+zS1Fxvf48zc4niSXXBHweD/eEAdEvr+sQeFylGI6lmUyGZAAo/h8wNnKOqrjaTqJ2mNqp8I1Dsn7KUidzNxZsznI9BimCUt9FgcCP4Lip5dvw8EHsWTJdBV5mGzBzN4TZ4Tsr5qupVm8AYzNvtNCYkUPw==
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: a00a57e8-e64f-4658-6a34-08dacccc4f4f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 20:58:30.6875 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR06MB8089
Received-SPF: pass client-ip=40.92.42.91; envelope-from=gabriel376@HIDDEN;
 helo=NAM10-MW2-obe.outbound.protection.outlook.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

--=-=-=
Content-Type: text/plain

Severity: wishlist

Description:

Some mode-line elements are too wide in some VC buffers, which affects
the information visibility.

Steps:

1) emacs -Q

2) Open some file controlled by Git VC, e.g.: C-x f ~/git/emacs/README

The buffer named "README" will be shown, the buffer name is displayed on
the left side of the mode-line.

(length (buffer-name)) => 6

3) Annotate the buffer: C-x v g

The VC-Annotate buffer named "*Annotate README (rev 1f39da3098a2a4cec9985e6db934ed14b7b522b7)*"
will be shown, the buffer name is displayed on the left side of the
mode-line.  The revision number might differ.

(length (buffer-name)) => 64

4) Show log revision at line: l

The Git-Log-View buffer will be shown.  The value of
`vc-parent-buffername' is " from *Annotate README (rev 1f39da3098a2a4cec9985e6db934ed14b7b522b7)*",
displayed on the right side of the mode-line.  The revision number might
differ.

(length vc-parent-buffer-name) => 70

Analysis:

A short named buffer "README" with length of 6 had information displayed
in the mode-line with lengths of 64 (with `vc-annotate') and 70 (with
`vc-annotate-show-log-revision-at-line').  This excessive length affects
the visibility of information in mode-line, which was supposed to ease
the access of information to the user.  A long buffer name can also
affect the display and usability in other interfaces, e.g.:
`list-buffers', `ibuffer' etc.

The problem, in this case, is the long revision string used by Git.  I
am not sure how other VCs behaves in this matter (bzr, cvs, dav, hg,
rcs, sccs, src, svc etc).

Solutions:

For Git, a better option would be to use a "short revision" (by default
the first 7 characters of the "long revision"), which would reduce, for
the example above, the length from 64 to 39 (and `vc-parent-buffer-name'
from 70 to 45):

diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index a15cf417de..63485af52e 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -409,7 +409,9 @@ vc-annotate
 				  nil nil "20")))))))
   (vc-ensure-vc-buffer)
   (setq vc-annotate-display-mode display-mode) ;Not sure why.  --Stef
-  (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
+  (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*"
+                                   (buffer-name)
+                                   (string-limit rev 7)))
          (temp-buffer-show-function 'vc-annotate-display-select)
          ;; If BUF is specified, we presume the caller maintains current line,
          ;; so we don't need to do it here.  This implementation may give

Another option would be to display additional information in the
header-line.

Another option would be to allow the user to format how the VC-Annotate
buffer name is displayed (and optionally also the
`vc-parent-buffer-name').  See attached patches.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-New-option-vc-annotate-buffer-name-function.patch

From 4ff9db05b20ac48b222b06f6c11a12fd35fdcdec Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@HIDDEN>
Date: Tue, 22 Nov 2022 16:45:30 -0300
Subject: [PATCH 1/1] New option vc-annotate-buffer-name-function

* lisp/vc/vc-annotate.el (vc-annotate-buffer-name-function): New user
option.
(vc-annotate-buffer-name-default): New function to compute the default
name of VC-Annotate buffers.
(vc-annotate): Use `vc-annotate-buffer-name-function'.

* etc/NEWS: Announce the new user option.
---
 etc/NEWS               |  5 +++++
 lisp/vc/vc-annotate.el | 20 +++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 5a65896d69..01dab3387b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1973,6 +1973,11 @@ your mail user agent.  The behavior of 'vc-prepare-patch' can be
 modified by the user options 'vc-prepare-patches-separately' and
 'vc-default-patch-addressee'.
 
++++
+*** New user option 'vc-annotate-buffer-name-function'.
+It allows setting a custom function to format the name of VC-Annotate
+buffers.
+
 ** Message
 
 ---
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index a15cf417de..ff3c9905d1 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -162,6 +162,22 @@ vc-annotate-menu-elements
   :type '(repeat number)
   :group 'vc)
 
+(defcustom vc-annotate-buffer-name-function #'vc-annotate-buffer-name-default
+  "Function to compute the name of a VC-Annotate buffer.
+The function receives two arguments, the buffer being annotated
+and the revision as string.  It should return the VC-Annotate
+buffer name as string."
+  :type 'function
+  :group 'vc
+  :version "29.1")
+
+(defun vc-annotate-buffer-name-default (buffer revision)
+  "Function to compute the default name of a VC-Annotate buffer.
+See `vc-annotate-buffer-name-function'."
+  (format "*Annotate %s (rev %s)*"
+          (buffer-name buffer)
+          revision))
+
 (defvar-keymap vc-annotate-mode-map
   :doc "Local keymap used for VC-Annotate mode."
   "a"   #'vc-annotate-revision-previous-to-line
@@ -409,7 +425,9 @@ vc-annotate
 				  nil nil "20")))))))
   (vc-ensure-vc-buffer)
   (setq vc-annotate-display-mode display-mode) ;Not sure why.  --Stef
-  (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
+  (let* ((temp-buffer-name (funcall vc-annotate-buffer-name-function
+                                    (current-buffer)
+                                    rev))
          (temp-buffer-show-function 'vc-annotate-display-select)
          ;; If BUF is specified, we presume the caller maintains current line,
          ;; so we don't need to do it here.  This implementation may give
-- 
2.34.1


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-New-option-vc-parent-buffer-name-format-function.patch

From bdfa9d64850e4b7de6b77dd16280a840ed0735fc Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@HIDDEN>
Date: Tue, 22 Nov 2022 16:50:35 -0300
Subject: [PATCH 1/1] New option vc-parent-buffer-name-format-function'

* lisp/vc/vc-dispatcher.el (vc-parent-buffer-name-format-function):
New user option to compute the parent buffer name identitication in
mode-line of VC buffers.
(vc-parent-buffer-name-format-default): New function to compute the
default parent buffer name identitication in mode-line of VC buffers.
(vc-setup-buffer, vc-start-logentry): Use
`vc-parent-buffer-name-format-function'.

* etc/NEWS: Announce the new user option.
---
 etc/NEWS                 |  5 +++++
 lisp/vc/vc-dispatcher.el | 22 ++++++++++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 5a65896d69..31bc22ab9e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1973,6 +1973,11 @@ your mail user agent.  The behavior of 'vc-prepare-patch' can be
 modified by the user options 'vc-prepare-patches-separately' and
 'vc-default-patch-addressee'.
 
++++
+*** New user option 'vc-parent-buffer-name-format-function'.
+It allows setting a custom function to format the parent buffer name
+identitication in mode-line of VC buffers.
+
 ** Message
 
 ---
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index dc3ed52650..e45d4d16ef 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -142,6 +142,22 @@ vc-suppress-confirm
   :type 'boolean
   :group 'vc)
 
+(defcustom vc-parent-buffer-name-format-function #'vc-parent-buffer-name-format-default
+  "Function to compute the parent buffer name identitication in
+mode-line of VC buffers.
+The function receives one argument, the parent buffer.  It should
+return the parent buffer name identitication as string."
+  :type 'function
+  :group 'vc
+  :version "29.1")
+
+(defun vc-parent-buffer-name-format-default (buffer)
+  "Function to compute the default parent buffer name identitication
+in mode-line of VC buffers.
+See `vc-parent-buffer-name-format-function'."
+  (format " from %s"
+          (buffer-name buffer)))
+
 ;; Variables the user doesn't need to know about.
 
 (defvar vc-log-operation nil)
@@ -188,7 +204,8 @@ vc-setup-buffer
     (kill-all-local-variables)
     (setq-local vc-parent-buffer camefrom)
     (setq-local vc-parent-buffer-name
-                (concat " from " (buffer-name camefrom)))
+                (funcall vc-parent-buffer-name-format-function
+                         camefrom))
     (setq default-directory olddir)
     (let ((buffer-undo-list t)
           (inhibit-read-only t))
@@ -748,7 +765,8 @@ vc-start-logentry
       (pop-to-buffer (get-buffer-create logbuf)))
     (setq-local vc-parent-buffer parent)
     (setq-local vc-parent-buffer-name
-                (concat " from " (buffer-name vc-parent-buffer)))
+                (funcall vc-parent-buffer-name-format-function
+                         vc-parent-buffer))
     (when patch-string
       (setq-local vc-patch-string patch-string))
     (vc-log-edit files mode backend)
-- 
2.34.1


--=-=-=
Content-Type: text/plain


Please share your suggestions.

---
Gabriel

--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Gabriel <gabriel376@HIDDEN>
Subject: bug#59491: Acknowledgement (29.0.50; [PATCH] Mode-line elements
 too wide in some VC buffers)
Message-ID: <handler.59491.B.166915072217554.ack <at> debbugs.gnu.org>
References: <SJ0PR06MB8609F6C7601B6EB1B5BBFC918B0D9@HIDDEN>
X-Gnu-PR-Message: ack 59491
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 59491 <at> debbugs.gnu.org
Date: Tue, 22 Nov 2022 20:59:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 59491 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
59491: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D59491
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Nov 2022 12:15:02 +0000
Resent-Message-ID: <handler.59491.B59491.16692056604674 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 59491
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Gabriel <gabriel376@HIDDEN>
Cc: 59491 <at> debbugs.gnu.org
Received: via spool by 59491-submit <at> debbugs.gnu.org id=B59491.16692056604674
          (code B ref 59491); Wed, 23 Nov 2022 12:15:02 +0000
Received: (at 59491) by debbugs.gnu.org; 23 Nov 2022 12:14:20 +0000
Received: from localhost ([127.0.0.1]:54029 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxodv-0001DK-RB
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 07:14:20 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48414)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxodr-0001D2-45
 for 59491 <at> debbugs.gnu.org; Wed, 23 Nov 2022 07:14:18 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxodk-0007AY-Rm; Wed, 23 Nov 2022 07:14:08 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=aVaaTdi4mI9KdqP/4KuolXvQCK0MgAeshHc2/g+0bZg=; b=halQdtHIxJGw
 deeZtJy98fPYpQ/kuViVwP4vXFyzsoryx5ALVAFT4l4TFJD4TEUV92DjTDPCyJQcYML8aizolt28D
 AX1vykMfD9YQUMkK21SKUdMpMfisDnraqrap5ny1q0g+x8tgfLUkRHkokOQM2uVuMCw2/xQG1TDbf
 ESbgaPepkoCF78TTH5d1Qhh/fT9mZT+D55bQjupBb3CuOk0N6J1t1K5o1MY3ZshKBvGyQIcTisEKL
 OoWbMIUKpraMZRDaROKBu0YOlvxwmAlUmA3u4dUIQ9umcG2EeB6Id5X7vrdU060uScHtU/pDqIBBL
 8Cu7NCHUnGOJPKJAxuYd0g==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxodk-00005S-B2; Wed, 23 Nov 2022 07:14:08 -0500
Date: Wed, 23 Nov 2022 14:14:25 +0200
Message-Id: <83sfi9zx3y.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <SJ0PR06MB8609F6C7601B6EB1B5BBFC918B0D9@HIDDEN>
 (message from Gabriel on Tue, 22 Nov 2022 17:58:25 -0300)
References: <SJ0PR06MB8609F6C7601B6EB1B5BBFC918B0D9@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Gabriel <gabriel376@HIDDEN>
> Date: Tue, 22 Nov 2022 17:58:25 -0300
> 
> For Git, a better option would be to use a "short revision" (by default
> the first 7 characters of the "long revision")

AFAIR, just taking the first 7 characters is not safe; you need to ask Git.
But maybe for this purpose taking 7 would be enough?

> Another option would be to allow the user to format how the VC-Annotate
> buffer name is displayed (and optionally also the
> `vc-parent-buffer-name').  See attached patches.

That sounds like overkill to me.

Let's see what Dmitry thinks about this.

Thanks.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers
Resent-From: Jim Porter <jporterbugs@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Nov 2022 18:44:01 +0000
Resent-Message-ID: <handler.59491.B59491.16692290198167 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 59491
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>, Gabriel <gabriel376@HIDDEN>
Cc: 59491 <at> debbugs.gnu.org
Received: via spool by 59491-submit <at> debbugs.gnu.org id=B59491.16692290198167
          (code B ref 59491); Wed, 23 Nov 2022 18:44:01 +0000
Received: (at 59491) by debbugs.gnu.org; 23 Nov 2022 18:43:39 +0000
Received: from localhost ([127.0.0.1]:56216 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxuih-00027f-Fx
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 13:43:39 -0500
Received: from mail-pj1-f49.google.com ([209.85.216.49]:41645)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1oxuif-00027L-9B
 for 59491 <at> debbugs.gnu.org; Wed, 23 Nov 2022 13:43:37 -0500
Received: by mail-pj1-f49.google.com with SMTP id
 w15-20020a17090a380f00b0021873113cb4so2646506pjb.0
 for <59491 <at> debbugs.gnu.org>; Wed, 23 Nov 2022 10:43:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=CTcXZbsZ+ZuSS5ouutrpBFj5RC0uVvXwobHNIzKcGKM=;
 b=UEitVItsXFo1aTGEkqfD0GkRZ1UgqNh3unXa1nRdICeaLls3joL3xtYtFcCatxZMQr
 LzODrxITVlmjleeIMVatO7bf9DltoEZy+ZNgAk2FZUlOBttK3dGzUDroJtQoOCkvVt0x
 coyHIkygTF7uEeYzIx5MA/9UGDppNNSJqBvlPk4qKvNlsh6dJM8i47b4q2tSViigklLq
 JyO3OO4O2LtAY7fhDolU/Su9p80v4uOUcfPpppispBDQDjV5dD0M/28Z5UN8pBwlEVuc
 fQzxjTzJvIFCWyH3fmDQNoUNnJ7+mtcIzy8LXFcNow76D1oiWr1hihTwUkAFOsPr8RdB
 MNSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=CTcXZbsZ+ZuSS5ouutrpBFj5RC0uVvXwobHNIzKcGKM=;
 b=LNHWsQCf2VLpNn5Udne2Iwk+u5red9j7X8vfrTwQYu64mwyrBc1Xj+eHCCSG38yKEX
 w7b7QL3BdA3q2sHhXargbfSoaoJ1/U/O08T/2G/DeXhjJWOs8vcJ/76fg4Am92h0FFEM
 niJXLINxH+Rhf6QQJKlrd278KBtluzq2pT5aBgA9d7tI0FpahoblLIRkDkYj4bv27L40
 ZpYDRP459+EA9tgT5eYQQAS/HUTeeLfVP2eXrirt5I1IVqiSbgqes40wndEnUW/E62qB
 SVmDejeWjyWNTbD+faWE50ACVlD5v0uYYfIYPPuVu+6IFeFod2FHJ7o0me51UpYQwaFl
 tMxQ==
X-Gm-Message-State: ANoB5pmV+zNbslEp0NUzHnfX5ZQKOfGlMF+Lj+KHnlQRTI5nTxqjLamb
 6DKZQoMXTutO3xIOp1dGaHs=
X-Google-Smtp-Source: AA0mqf5I9Eo+jJMQs1jSozYGuZiIz4mg0RZNSewthZZeKRzGuJLftexkXHa2RRcc+1j/aXM9FI/z+g==
X-Received: by 2002:a17:903:2443:b0:181:6c64:6dd3 with SMTP id
 l3-20020a170903244300b001816c646dd3mr10744140pls.123.1669229011186; 
 Wed, 23 Nov 2022 10:43:31 -0800 (PST)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 r17-20020aa79631000000b0057452fc8935sm1969108pfg.162.2022.11.23.10.43.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 23 Nov 2022 10:43:30 -0800 (PST)
Message-ID: <7e19c0e7-5b64-bf40-cb25-fb8e5e3cdb0a@HIDDEN>
Date: Wed, 23 Nov 2022 10:43:29 -0800
MIME-Version: 1.0
Content-Language: en-US
References: <SJ0PR06MB8609F6C7601B6EB1B5BBFC918B0D9@HIDDEN>
 <83sfi9zx3y.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <83sfi9zx3y.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 11/23/2022 4:14 AM, Eli Zaretskii wrote:
>> From: Gabriel <gabriel376@HIDDEN>
>> Date: Tue, 22 Nov 2022 17:58:25 -0300
>>
>> For Git, a better option would be to use a "short revision" (by default
>> the first 7 characters of the "long revision")
> 
> AFAIR, just taking the first 7 characters is not safe; you need to ask Git.
> But maybe for this purpose taking 7 would be enough?

It'd be nice to pass this through `git rev-parse --short` or maybe even 
`git describe --always --all`. vc-git.el could also use something like 
this when it gets the ref for the modeline (see 
'vc-git-mode-line-string' and 'vc-git--symbolic-ref').

In fact, maybe there should be a generic VC function for getting a 
"friendly" string describing a commit. Then code could use that function 
in some/most cases instead of showing the full commit ID.




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 25 Nov 2022 08:04:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 03:04:23 2022
Received: from localhost ([127.0.0.1]:33378 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyTh9-0004xO-GN
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2022 03:04:23 -0500
Received: from mail-oa1-f41.google.com ([209.85.160.41]:44918)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1oyTh6-0004ww-N1
 for control <at> debbugs.gnu.org; Fri, 25 Nov 2022 03:04:21 -0500
Received: by mail-oa1-f41.google.com with SMTP id
 586e51a60fabf-142306beb9aso4309652fac.11
 for <control <at> debbugs.gnu.org>; Fri, 25 Nov 2022 00:04:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=to:subject:message-id:date:mime-version:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=ZlxDLfGXiToakEhGKWdGTSk6PM3P2t8Si6Ywt1ePdro=;
 b=VyWNZK3l70DlCV5FWYOwahykiJlOj9e7WfL7aZWrZIVQULO4YqAfsik6N3KUwG+AuX
 aGQfSuAJ0pPVG0QEqET+cxUSOVrnhA4Fg4tXdJm6Hq764U/98GbqGXfEjlNNIuU9+6KZ
 oIJpKhLImMANFa2ExUOXc9z9VrDnBRURLiKoLZfJ9XkabUbz0/aa1dKtAjY52zZ/Ui79
 je6BlAqgtAEBixD4k0Tm3T9cdqDpaq89Vnt1F1beRFz0qz7fpDEdQQX3M2T9eBzAH6SK
 +/4/45AF3sj9K01VCeM9vS/lX1F47BzjgDWany00aboaKI8IVoAJzNK/P0SluY7iHZeo
 Xosw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:subject:message-id:date:mime-version:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=ZlxDLfGXiToakEhGKWdGTSk6PM3P2t8Si6Ywt1ePdro=;
 b=eoFKi2GPh9GbYdtyeEA2E92p+I9AyL9TksFJpw9vo2s45xrFJSQCH+5sluFGFbreHA
 TPrqWm2DtL3kZDMgod9asOaPNBmExtTkHKQLwiQJky0CEjIpueUFk0SR9p3i1Fi0AZzu
 4+KK9d59AP6nphTYEdd+F/3BHuwybFWv6KdSJuw2zSry/OBZcgbmDYNyL1z9x4aV3jfp
 PgaaHlv/ULII7RsqaT64zJVnJ2l5Kc6Md7xCZw/Fdj94rLDnXkTU5UsRGu1tX/JOo6it
 EDI1AULq8BLJK9Js/yJPAsZafnx2Sl+GVRRis5HdX9O4XZcpaiSMsY6al73V+gnDA9kJ
 ju9g==
X-Gm-Message-State: ANoB5pnhujWUHAs7FLm6Gs778lAMbrtPvgrs1RAVvMEWhM3Agu0T7Yv2
 WoA9FXW/sFKyELtdibZLBPA/+jWvgYhqcpnYbVhIzn4vB1k=
X-Google-Smtp-Source: AA0mqf62qjiAWhxBPN2UshxEOkRJ/8/z1rL4O5gOXg3wKeu6bx/kgSqYJfxyIizDY4aq1THEFpARvJv2ZvozSFN5o+I=
X-Received: by 2002:a05:6870:cc89:b0:12b:fbe7:b793 with SMTP id
 ot9-20020a056870cc8900b0012bfbe7b793mr22493505oab.92.1669363455135; Fri, 25
 Nov 2022 00:04:15 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 25 Nov 2022 00:04:14 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
X-Hashcash: 1:20:221125:control <at> debbugs.gnu.org::wGwo0b2W6bt6RYNI:4V2q
MIME-Version: 1.0
Date: Fri, 25 Nov 2022 00:04:14 -0800
Message-ID: <CADwFkmno2ingJadjsgCnXk5no3ydixNKyD0Zte1FJq=DWKFwUg@HIDDEN>
Subject: control message for bug #59491
To: control <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 59491 - patch
quit





Last modified: Fri, 25 Nov 2022 08:15:02 UTC

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