From unknown Tue Jun 24 22:40:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 59491@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@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 ) id 1oxaLp-0004Z3-B9 for submit@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 ) id 1oxaLk-0004Ym-9H for submit@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 ) id 1oxaLj-0008BK-PS for bug-gnu-emacs@gnu.org; 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 ) id 1oxaLh-0003gH-9M for bug-gnu-emacs@gnu.org; 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 Date: Tue, 22 Nov 2022 17:58:25 -0300 Message-ID: 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@hotmail.com> 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@hotmail.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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 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 --=-=-=-- From unknown Tue Jun 24 22:40:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 12:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Gabriel Cc: 59491@debbugs.gnu.org Received: via spool by 59491-submit@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 ) id 1oxodv-0001DK-RB for submit@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 ) id 1oxodr-0001D2-45 for 59491@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Gabriel on Tue, 22 Nov 2022 17:58:25 -0300) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gabriel > 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. From unknown Tue Jun 24 22:40:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii , Gabriel Cc: 59491@debbugs.gnu.org Received: via spool by 59491-submit@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 ) id 1oxuih-00027f-Fx for submit@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 ) id 1oxuif-00027L-9B for 59491@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@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@gmail.com> Date: Wed, 23 Nov 2022 10:43:29 -0800 MIME-Version: 1.0 Content-Language: en-US References: <83sfi9zx3y.fsf@gnu.org> From: Jim Porter In-Reply-To: <83sfi9zx3y.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/23/2022 4:14 AM, Eli Zaretskii wrote: >> From: Gabriel >> 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 25 03:04:23 2022 Received: (at control) by debbugs.gnu.org; 25 Nov 2022 08:04:23 +0000 Received: from localhost ([127.0.0.1]:33378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyTh9-0004xO-GN for submit@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 ) id 1oyTh6-0004ww-N1 for control@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 ; 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 X-Hashcash: 1:20:221125:control@debbugs.gnu.org::wGwo0b2W6bt6RYNI:4V2q MIME-Version: 1.0 Date: Fri, 25 Nov 2022 00:04:14 -0800 Message-ID: Subject: control message for bug #59491 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 59491 - patch quit From unknown Tue Jun 24 22:40:03 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gabriel Subject: bug#59491: closed (Re: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers) Message-ID: References: X-Gnu-PR-Message: they-closed 59491 X-Gnu-PR-Package: emacs Reply-To: 59491@debbugs.gnu.org Date: Wed, 12 Feb 2025 15:57:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1739375822-16360-1" This is a multi-part message in MIME format... ------------=_1739375822-16360-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 59491@debbugs.gnu.org. --=20 59491: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D59491 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1739375822-16360-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 59491-done) by debbugs.gnu.org; 12 Feb 2025 15:56:41 +0000 Received: from localhost ([127.0.0.1]:37881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiF6P-0004FB-GD for submit@debbugs.gnu.org; Wed, 12 Feb 2025 10:56:41 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:61771) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tiF6N-0004Eu-6a for 59491-done@debbugs.gnu.org; Wed, 12 Feb 2025 10:56:39 -0500 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5de4d3bbc76so9483391a12.3 for <59491-done@debbugs.gnu.org>; Wed, 12 Feb 2025 07:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739375793; x=1739980593; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=gj1EI40tf2nQW30rZukLYRqDRa3U/GOvYVItZ49vkkY=; b=I+ODclD3DtZ1B5LqnZV38syFmVRTXhVCxYxYvUf1ydIQNvDW95/mJyrHH3i+JNkD2A 5vfr1+pXd5EzYiiHumqvx7WbozoCaZyRX+BYfdo6ylH49W6POs5uwRj4W8K0g86ff6+7 IjFl9lDZwP2YG3llASJr0fg0uYUM6Q43HDIWhzadoBjTBQVNRM/lOq+0C6DnJa2SGNoH L2VSTTCZoP3r1w7Dou9lrlXYoj22k/cg/9aQsG6bJpP+p9DE93KlSNep2XYpFkdjW8Um TyhxeQeUbG0CKkWb3WBcEnaEplzNW12TNhLhg3PMVdsk8OdZ6ED3yIelXp9mJaXwfQe1 Qtvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739375793; x=1739980593; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gj1EI40tf2nQW30rZukLYRqDRa3U/GOvYVItZ49vkkY=; b=uTsiKa/tuh5pDm4nHETxmWO4L3ktIyBrh2TBlUoSKdQwuLiacrBMdBgp6I+KKciMc0 JtFPo9+d7DeG4DwsPMsTY4sDpIYjmIeNAKCMKrcAjJQ1eHgiyF3ZUcwS3vO/IFi63L4Q 8O8hJ4jiE52QIwJvTw/H9odN6wb7W/tLTITxAMKh+K5OTu8b3qSYgcUUjHCr4qPWJY9s I3prgaRdmjl75vwZGyD6gl2nTGMyp/QtIPA1w75jT/RcEPUmkTZN15+R/FUCZod06dul aTTL5zgDeyUxfoiRXKn8L0/hhiwQ1NezfaqFPikAqJblo9oll6CfvgbZWuWweK/OGRAT jxyA== X-Gm-Message-State: AOJu0YwiMhGGyFhT/NwVwuf9yvNaPtKPZ4kKJho2YWS3TNMx+Tm+0i6X nRBO8GajU8tCIhs9VbofKqcZ8whOL2xoexRw91mlUp1gIHmXQPBFWe5mLMrm8kuKwAOGXy1scVR hF2VGVhCCkp4Hx11GTaoMsf26kH5zA7DjF2ncEg== X-Gm-Gg: ASbGncsV7TmcSUGjwsjfeoF7a+P0dRO3Mhv40IXzjRmA9Zq6KwhyFE1WaeR8ha+a8Tl 11LZIrK8uzGnlPu0wHVmm3Tr+AamDCRERKzAI5PSiAZVHSSZCY4quV/6zo9VWMnyDWGaCD4KTAM E= X-Google-Smtp-Source: AGHT+IFogcCzyelDBE/uRRbjP3EuTpBnVLhReQiFw6iAGz5EQvdd2I6UG22ya0Z1SobtgmjTG626ycvU3YFcwFgzN0Y= X-Received: by 2002:a05:6402:2713:b0:5dc:767d:f032 with SMTP id 4fb4d7f45d1cf-5deade00afamr3317265a12.24.1739375792830; Wed, 12 Feb 2025 07:56:32 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Feb 2025 07:56:31 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Wed, 12 Feb 2025 07:56:31 -0800 X-Gm-Features: AWEUYZmwqlTW1lZycvxSJud2lT1wC5eB35WC_02DNLPRaQEYx8G0TpwlsLDzpcQ Message-ID: Subject: Re: bug#59491: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers To: Gabriel Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59491-done Cc: 59491-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gabriel writes: > 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 This seems to have been fixed in recent versions of Emacs, so I'm closing this bug now. ------------=_1739375822-16360-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ) id 1oxaLp-0004Z3-B9 for submit@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 ) id 1oxaLk-0004Ym-9H for submit@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 ) id 1oxaLj-0008BK-PS for bug-gnu-emacs@gnu.org; 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 ) id 1oxaLh-0003gH-9M for bug-gnu-emacs@gnu.org; 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 To: bug-gnu-emacs@gnu.org Subject: 29.0.50; [PATCH] Mode-line elements too wide in some VC buffers Date: Tue, 22 Nov 2022 17:58:25 -0300 Message-ID: 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@hotmail.com> 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: =?us-ascii?Q?MhAoXfXqGQftdBjJWRBqJz5ObhkgdfilwQrNF7qFTpJUggWDUIX95l3MPfae?= =?us-ascii?Q?0EZGrBg23bK0z1PI2gEqIGjTzE9R+kpgGL5wg+RGO9BHehEzPVd+l2fIZ803?= =?us-ascii?Q?wMuNOSs/c35iw0kEY7weYb24o9qZ6V71/l+vii/jtkMcKkaRG2j9PHLg6K+f?= =?us-ascii?Q?zcmQ18rDLJKJZ77+l7k3nniQe3wAhE/1Zl+FQbpJB5xaw2H3wT7sqRnxYDNY?= =?us-ascii?Q?yC+/NgnS0aUMB2OyFMVN3t3cmq4B+dBfGSuucTs3TKnbxCob98LMhOeIsK4b?= =?us-ascii?Q?leVxO93Egy8R3WykGNqOz+jbZV+VdThsJ+mmmUrGK401gkYESk9kA8yCHB9I?= =?us-ascii?Q?kZxeD7KUWIpPTvd2PXG3WPIu8gELLctWEmpFj8gzsDHx2gOcUTRNqLUeAsHV?= =?us-ascii?Q?u72vYG9ugMVP1uJ1nUuTy1tqzp5T7AgSxtQ0IkNVwpC6tDK6ZJXEE8//p0Xp?= =?us-ascii?Q?iX2FhYDEENSQDE3IHQBQcNclUbl0/mzAbTA+VqQcWJySex+J/oIO0hXYBbTZ?= =?us-ascii?Q?L353/atRmLJLyTTDfPNSkG4zETJ2+nGB8jphiwjKyKthzKDqJutAP0KjG+o9?= =?us-ascii?Q?w8LzQUHeMoGUVHOT9XnvslB9lKvffylYuHMv7tsDEUkvnjlyC7Tg5GQwzKsn?= =?us-ascii?Q?vrSuhZNau795p1K6gYNBCYtHL7QGZP5zeaffnvX7U3qU0hbHgLfLMd+03+aS?= =?us-ascii?Q?8rYZT3tzgXGihlO94r1FRVzovB2y2CIG+96uSh7FBzo/mrR54+Vyo6by7RiE?= =?us-ascii?Q?XQsd3+S4YjiZ+aSAeMzcC6CBfQ6fr9CwMEyqHxxSrvZTmbNoGVNf75yra0Fy?= =?us-ascii?Q?NDqVSDe4rliWl/aytlQ9ex5xapHF3S6CZyraFAj4+zrEqSsrd4y0CGfz0s9J?= =?us-ascii?Q?hNilinX+FLGl6dyizTiMHjbMTCI+sWvfJRbkHNurG36emXqa/Wdu571gns9W?= =?us-ascii?Q?cRnIRZJZYryz/jUNdNqPZ0U1IH8dRX0ogfhrgJSeTk798paU1jZ0iRd8m0e4?= =?us-ascii?Q?M8Go8D0Tn5EDojVYNQAgjniV3StNZjWcSjYQEaXg00Z76zyNp8MBhlLW9KHz?= =?us-ascii?Q?GfZLY77A2u3+an83VMtj4Z2RcHhVEaUGk+507kxZcYPNPbosczmya7XJe/ef?= =?us-ascii?Q?Tjz0XIxGDf0wbN+w4GiOY40RbpaEcH7W02DcW6Ca1OaRk79gLi0AH+M0ElnM?= =?us-ascii?Q?qPBQ/ZanHvYq+zS1Fxvf48zc4niSXXBHweD/eEAdEvr+sQeFylGI6lmUyGZA?= =?us-ascii?Q?Ao/h8wNnKOqrjaTqJ2mNqp8I1Dsn7KUidzNxZsznI9BimCUt9FgcCP4Lip5d?= =?us-ascii?Q?vw8EHsWTJdBV5mGzBzN4TZ4Tsr5qupVm8AYzNvtNCYkUPw=3D=3D?= 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@hotmail.com; 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-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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 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 --=-=-=-- ------------=_1739375822-16360-1--