From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 25 06:45:55 2025 Received: (at submit) by debbugs.gnu.org; 25 Jan 2025 11:45:55 +0000 Received: from localhost ([127.0.0.1]:48797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbebr-0008Et-1v for submit@debbugs.gnu.org; Sat, 25 Jan 2025 06:45:55 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43384) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbebo-0008ES-8d for submit@debbugs.gnu.org; Sat, 25 Jan 2025 06:45:53 -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 1tbebc-0006HZ-1H for bug-gnu-emacs@gnu.org; Sat, 25 Jan 2025 06:45:42 -0500 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbebZ-0008Ru-S4 for bug-gnu-emacs@gnu.org; Sat, 25 Jan 2025 06:45:39 -0500 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 0FF5A11400CB for ; Sat, 25 Jan 2025 06:45:35 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Sat, 25 Jan 2025 06:45:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengjiz.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm1; t=1737805534; x=1737891934; bh=Uwn7Rwmj5ROJuklT1GgZFLGMH3qqKZcO WUyXq6LzPSw=; b=Se/J19ncyCCQLa5dHia/TghHzrLNleSyjW5X2D0cWLBdo69Y 0BIH8eq2MqMgaEtnINvKyhswYTkHn5p4uU2sWSU9ESgMdQod8LQ3xo/vGPmdp/xH lzMRRT4Wivl1O/PldW247WqZzz1Twf9pR+OT/zJwHraWkshMV00kqqJ1gacFgQme rsapxcOuqTrLoIwIwAy8kevkkOyiOTWPmAZwtyffc8KcWqFpEhzy+yPdVkdEMSrP n26bcvYYyfPEqf5BH7Ba6bIacH6auWcjK5T7n/gzFuk4t+vaNXPYSwb9yVXHjJPf gNBeWImin/IuI3/ztYPot2g2MicoRZZnQGWGRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1737805534; x= 1737891934; bh=Uwn7Rwmj5ROJuklT1GgZFLGMH3qqKZcOWUyXq6LzPSw=; b=K IOB20HuIHMXm2BiFQloTyOAVZJ5ttr4OjfRvdtAJsExcBu2HkuO72EcNbhVR0t2q zc+BbgHj8ob+kU17HuNa+UjWF88kwKuUB/uMvIZvWIvrn+qnmjZFP10YdFXVufMY ASqRMwSe99xyGSxaJ6ZLKqlM1iNMRBQsAHE4zuwGeWqfqCm7kHVb+vOKiL7PoOye KBLa1h3lTgmUS05dhQpckou8k0F/5GKaXvZsKITHEH9fFteTS6f//pgAEWOGh86W yoJ5K52y5hx5rR+EySZfZTamJo5j/yDUby2XHVaCBUYCT6/FAv/DKMihkdeWkL3G oKdbO0Qg8DCkTgASL0jJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgjeeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvuf ffkfggtgesmhdtreertddttdenucfhrhhomheprfgvnhhgjhhiucgkhhgrnhhguceomhgv sehpvghnghhjihiirdgtohhmqeenucggtffrrghtthgvrhhnpeffgfeihffgudelledvie eitddvfeeigeektdekffdtleejgfehledvffejgeetgeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmvgesphgvnhhgjhhiiidrtghomhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsghughdq ghhnuhdqvghmrggtshesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i16614472:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 25 Jan 2025 06:45:33 -0500 (EST) From: Pengji Zhang To: bug-gnu-emacs@gnu.org Subject: [PATCH] New user option 'Buffer-menu-human-readable-size' Date: Sat, 25 Jan 2025 19:45:29 +0800 Message-ID: <87zfjfp15y.fsf@pengjiz.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=202.12.124.146; envelope-from=me@pengjiz.com; helo=fout-b3-smtp.messagingengine.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) 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: -0.4 (/) --=-=-= Content-Type: text/plain Hello, This patch introduces a new user option similar to the one in bug#75495. With it we could display buffer sizes in the human readable format for Buffer Menu. Thanks! Pengji --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-New-user-option-Buffer-menu-human-readable-size.patch >From 423df97d414ea6443e0c74c0978ab9a4faeb9476 Mon Sep 17 00:00:00 2001 From: Pengji Zhang Date: Sat, 25 Jan 2025 19:29:26 +0800 Subject: [PATCH] New user option 'Buffer-menu-human-readable-size' * lisp/buff-menu.el (Buffer-menu-human-readable-size): New user option. (list-buffers--refresh): Use it. * etc/NEWS: Annouce the new user option. --- etc/NEWS | 5 +++++ lisp/buff-menu.el | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 385e943c997..612d1fd88f3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -361,6 +361,11 @@ set to 'title'. *** New user option 'ibuffer-human-readable-size'. When non-nil, buffer sizes are shown in human readable format. +--- +** Buffer Menu +*** New user option 'Buffer-menu-human-readable-size'. +When non-nil, buffer sizes are shown in human readable format. + ** Smerge *** New command 'smerge-extend' extends a conflict over surrounding lines. diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 4418db01724..7790475f1f6 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -135,6 +135,14 @@ Buffer-menu-group-sort-by :group 'Buffer-menu :version "30.1") +(defcustom Buffer-menu-human-readable-size nil + "If non-nil, show buffer sizes in human-readable format. +That means to use `file-size-human-readable' (which see) to format the +buffer sizes in the buffer size column." + :type 'boolean + :group 'Buffer-menu + :version "31.1") + (defvar-local Buffer-menu-files-only nil "Non-nil if the current Buffer Menu lists only file buffers. This is set by the prefix argument to `buffer-menu' and related @@ -831,7 +839,10 @@ list-buffers--refresh (if buffer-read-only "%" " ") (if (buffer-modified-p) "*" " ") (Buffer-menu--pretty-name name) - (number-to-string (buffer-size)) + (funcall (if Buffer-menu-human-readable-size + #'file-size-human-readable + #'number-to-string) + (buffer-size)) (concat (format-mode-line mode-name nil nil buffer) (if mode-line-process -- 2.48.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 06:24:19 2025 Received: (at 75825) by debbugs.gnu.org; 26 Jan 2025 11:24:19 +0000 Received: from localhost ([127.0.0.1]:54917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tc0kU-0001ib-SN for submit@debbugs.gnu.org; Sun, 26 Jan 2025 06:24:19 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:53759) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tc0kT-0001iN-6g for 75825@debbugs.gnu.org; Sun, 26 Jan 2025 06:24:17 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-38a88ba968aso3486520f8f.3 for <75825@debbugs.gnu.org>; Sun, 26 Jan 2025 03:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737890650; x=1738495450; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cj5FlvXH0QNbbP0Dbm1HcNyZMca8j2E+kc/OUWvMPP4=; b=Z60lHJF/oUGMoYuTtoIl6ywYoRjDkFev5VBnI3CzreQVSOihU0ctqfm6Bm9BE0tt6G V13F93cjD1WQrwC4sMKrICXx0uJGMOaFXmGqi3fUFGLUWRppT44IiDmvKSWIbfAO7Xf7 SgNyoqxZIpqCSe1ZhPgvPx7omOLBXwhDps62i2c8oWHBBkQJ6bKynloYDBkuaYb2YqO3 lyYtYdcmP0zopiwdfS8eRRzzmtmdWdqkmAmQICuIW28zrqbJKtUoSEPL3x0+dl/TJ86K D8QI1uBAnbG52SfpPyjt2lnxmQyglRapV6m8lgyYsr+gLWW/pmQ/Ar/q25DY+5dzaqLQ ZqNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737890650; x=1738495450; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cj5FlvXH0QNbbP0Dbm1HcNyZMca8j2E+kc/OUWvMPP4=; b=eAn/AqfluvhpkReUZ5yqO8S+yefQBt8rvDtZKUv9BadIbttl8o8N27fvf7JLPL/tPG e1LCEpqSpvH62J3FKdBKt/AWgHzOoz3UnToP8d16hgTgXnHlr7SqPdyEUD7m36L5KuUJ PgXOXyWtrghbbVdZkKaC88VsmTAgZy9wsdze+7ymNjCo37OeHdxxNfLzniBCbocdi0n2 p9dPq98nJGatTYuMTXnt4kX/40UEX4sTs9Bnel/yrH5P76OQo3ocAqtqgTTrONj3+FxQ eRLcQqAtkmlCKMHw5pWnIgHaIF6iQFcNPLbci99Bv9j5d1sXCxrMD1+8mIfynYvRNJ3k pkAg== X-Gm-Message-State: AOJu0YwQnAxtmdvgLf5Iixhk5/z0Cygovr/KJg/Ju6SEumTuFxCuAPJT KAFoDfjB8i5mol3gKKIhY2uVqwqFSgHwizuQe1S73KRLvKrX0c9daJnEJA== X-Gm-Gg: ASbGnctkV/YnEe/Z+cMF4Y+LhkjTEm0DYfsEaQIcSJrpp/+37YLzxtIs8gFcFfcO2wH 0jk4gVH0uhPdYjhL5WUG0i1CF+2E6MmHkpaJXPYnUZ279H01J4dVKs7r3v7CNq1Tho3lQaFKgPu nRfw71+1TUUBnYDZwA+wliSNubE0GcjTwEP7CTjrkCpZAtBnhzMfvGxJHQcPWAajvJVkvyfAa3U D4IYJZtdzyqpuPKoFPhjVhzmaceB5/ek+4aWmQcIQRz1ADqyGlFAUWRqshqFJhK/X5e X-Google-Smtp-Source: AGHT+IEwIQmq/1TNelANEM3fqSUvMUvGnwPdQ7n12shlJyRQlLU7PxQ3GJ52SD0fkBJ08Jkv51fWEw== X-Received: by 2002:a05:6000:1a8c:b0:38b:ec2d:c0cf with SMTP id ffacd0b85a97d-38bf57a7aafmr37683845f8f.44.1737890650149; Sun, 26 Jan 2025 03:24:10 -0800 (PST) Received: from rltb ([2a01:e0a:3f3:fb51:9094:4960:42e7:829a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa57csm95351835e9.4.2025.01.26.03.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2025 03:24:09 -0800 (PST) From: Robert Pluim To: Pengji Zhang Subject: Re: bug#75825: [PATCH] New user option 'Buffer-menu-human-readable-size' In-Reply-To: <87zfjfp15y.fsf@pengjiz.com> (Pengji Zhang's message of "Sat, 25 Jan 2025 19:45:29 +0800") References: <87zfjfp15y.fsf@pengjiz.com> Date: Sun, 26 Jan 2025 12:24:09 +0100 Message-ID: <87ed0p4y3q.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75825 Cc: 75825@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 (-) >>>>> On Sat, 25 Jan 2025 19:45:29 +0800, Pengji Zhang sai= d: Pengji> Hello, Pengji> This patch introduces a new user option similar to the one in b= ug#75495. Pengji> With it we could display buffer sizes in the human readable for= mat for Pengji> Buffer Menu. As with #75495, "size" or "sizes", please pick one and only one. Pengji> Thanks! Pengji> Pengji Pengji> From 423df97d414ea6443e0c74c0978ab9a4faeb9476 Mon Sep 17 00:00:= 00 2001 Pengji> From: Pengji Zhang Pengji> Date: Sat, 25 Jan 2025 19:29:26 +0800 Pengji> Subject: [PATCH] New user option 'Buffer-menu-human-readable-si= ze' Pengji> * lisp/buff-menu.el (Buffer-menu-human-readable-size): New user Pengji> option. Pengji> (list-buffers--refresh): Use it. Pengji> * etc/NEWS: Annouce the new user option. Pengji> --- Pengji> etc/NEWS | 5 +++++ Pengji> lisp/buff-menu.el | 13 ++++++++++++- Pengji> 2 files changed, 17 insertions(+), 1 deletion(-) Pengji> diff --git a/etc/NEWS b/etc/NEWS Pengji> index 385e943c997..612d1fd88f3 100644 Pengji> --- a/etc/NEWS Pengji> +++ b/etc/NEWS Pengji> @@ -361,6 +361,11 @@ set to 'title'. Pengji> *** New user option 'ibuffer-human-readable-size'. Pengji> When non-nil, buffer sizes are shown in human readable format. =20 Pengji> +--- Pengji> +** Buffer Menu Pengji> +*** New user option 'Buffer-menu-human-readable-size'. Pengji> +When non-nil, buffer sizes are shown in human readable format. Pengji> + When adding a new user option, please describe the default value. I assume it=CA=BCs nil, but NEWS should tell me (especially as NEWS is often read outside Emacs). Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 06:48:59 2025 Received: (at 75825) by debbugs.gnu.org; 27 Jan 2025 11:48:59 +0000 Received: from localhost ([127.0.0.1]:59659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcNbu-0000Of-I6 for submit@debbugs.gnu.org; Mon, 27 Jan 2025 06:48:58 -0500 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]:50371) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tcNbr-0000OO-F8 for 75825@debbugs.gnu.org; Mon, 27 Jan 2025 06:48:56 -0500 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 7BD232540198; Mon, 27 Jan 2025 06:48:49 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 27 Jan 2025 06:48:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengjiz.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1737978529; x=1738064929; bh=Vq8XYxstMN uamHQHgmYmI411wRGV/73d0rXvb7qJC9I=; b=chaz8IPWgvnce4bgCeJrt+UaOM YbVJZahUt5lOnCMvm27h32NAal8yThupuc1n5LJZ1pcK7roiIPh92dP0osrMKgt5 35h8/PzFLnc+O1kf1D7af0fBZm1lZ5Ap55sbV+EkspViqGW0+/Pcn4ELQWtT1zE6 gnGLOHWsw0mQGoMFKRVHxgnvAjU6CmQnDZ5PR9jUMNCnIuubxv+xRrpVESHF7HNh wBuVBqTkzR/Pwfzf9basNA9OYZl+fVcKnhGBxL/6+ko5KiQuPyAJ6Pra9uwylvdZ BzB2hVo871VRPa3XmiXCacwgb0Z0wVP8hIIlEj0ESvFXK/UkiYjVHFUK2amQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1737978529; x=1738064929; bh=Vq8XYxstMNuamHQHgmYmI411wRGV/73d0rX vb7qJC9I=; b=nwxONIXOD/nIrZ8Vd2T4Sw/XSwzLDn9n+WDgN4SNiwA+OBQrhYv IM8GoR2cdbZEfKvLa8RvEMtA0V6GhZwzopsxvg1e1SXAW3KEOEgzt3EIAMoJuhCf DHL80ukGYqL+GTs50GfR+SMbpekyBcNE9D4QpHWRUwYjiGB41ChL5Qzv1KDwGsvT WFC5Jgq0jFvhNz8o3qmO3mqkzblFvqd2FCItJmHUUPiBA3S3/GhlTfmXZHeSR5tx z75I6+Ob1t6YVzSmUyY0rpFlrMjL12VD6tDrefXFxriJSyvx+LK2iUyep194aCuc VD0lZaDnvJ5N+5dGM1z8daoocUIJ+bms7uA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudeftdelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehmtderredttdej necuhfhrohhmpefrvghnghhjihcukghhrghnghcuoehmvgesphgvnhhgjhhiiidrtghomh eqnecuggftrfgrthhtvghrnhepkeevieekgfeiudeuvefgieevfeejhfffkefhgeegfedt geektdegueejffdugeetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepmhgvsehpvghnghhjihiirdgtohhmpdhnsggprhgtphhtthhopedvpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehrphhluhhimhesghhmrghilhdrtghomh dprhgtphhtthhopeejheekvdehseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i16614472:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jan 2025 06:48:48 -0500 (EST) From: Pengji Zhang To: Robert Pluim Subject: Re: bug#75825: [PATCH] New user option 'Buffer-menu-human-readable-size' In-Reply-To: <87ed0p4y3q.fsf@gmail.com> References: <87zfjfp15y.fsf@pengjiz.com> <87ed0p4y3q.fsf@gmail.com> Date: Mon, 27 Jan 2025 19:48:43 +0800 Message-ID: <87ed0oo4tg.fsf@pengjiz.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 75825 Cc: 75825@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.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks for the review! Robert Pluim writes: > As with #75495, "size" or "sizes", please pick one and only one. I do not have a preference for this. So I updated the patch to use "sizes" consistently following your comment in #75495. > When adding a new user option, please describe the default value. I > assume it=CA=BCs nil, but NEWS should tell me (especially as NEWS is often > read outside Emacs). Added in the updated patch. Pengji --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-New-user-option-Buffer-menu-human-readable-sizes.patch >From 7b61b6e33804f7aff96777bec008a90760844f8c Mon Sep 17 00:00:00 2001 From: Pengji Zhang Date: Mon, 27 Jan 2025 19:42:00 +0800 Subject: [PATCH] New user option 'Buffer-menu-human-readable-sizes' * lisp/buff-menu.el (Buffer-menu-human-readable-sizes): New user option. (list-buffers--refresh): Use it. * etc/NEWS: Announce the new user option. --- etc/NEWS | 6 ++++++ lisp/buff-menu.el | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 385e943c997..c92fd7722fd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -361,6 +361,12 @@ set to 'title'. *** New user option 'ibuffer-human-readable-size'. When non-nil, buffer sizes are shown in human readable format. +--- +** Buffer Menu +*** New user option 'Buffer-menu-human-readable-sizes'. +When non-nil, buffer sizes are shown in human readable format. The +default is nil, which retains the old format. + ** Smerge *** New command 'smerge-extend' extends a conflict over surrounding lines. diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 4418db01724..36268b3512a 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -135,6 +135,14 @@ Buffer-menu-group-sort-by :group 'Buffer-menu :version "30.1") +(defcustom Buffer-menu-human-readable-sizes nil + "If non-nil, show buffer sizes in human-readable format. +That means to use `file-size-human-readable' (which see) to format the +buffer sizes in the buffer size column." + :type 'boolean + :group 'Buffer-menu + :version "31.1") + (defvar-local Buffer-menu-files-only nil "Non-nil if the current Buffer Menu lists only file buffers. This is set by the prefix argument to `buffer-menu' and related @@ -831,7 +839,10 @@ list-buffers--refresh (if buffer-read-only "%" " ") (if (buffer-modified-p) "*" " ") (Buffer-menu--pretty-name name) - (number-to-string (buffer-size)) + (funcall (if Buffer-menu-human-readable-sizes + #'file-size-human-readable + #'number-to-string) + (buffer-size)) (concat (format-mode-line mode-name nil nil buffer) (if mode-line-process -- 2.48.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 05:40:00 2025 Received: (at 75825-done) by debbugs.gnu.org; 1 Feb 2025 10:40:00 +0000 Received: from localhost ([127.0.0.1]:56517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teAuu-0007Dm-0X for submit@debbugs.gnu.org; Sat, 01 Feb 2025 05:40:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38134) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teAus-0007DT-5C for 75825-done@debbugs.gnu.org; Sat, 01 Feb 2025 05:39:58 -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 1teAum-0004tb-PN; Sat, 01 Feb 2025 05:39:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=iWdykdR4JYwOPFlQMHG7jVvs2U6bgLgm51tWkPJ0qvY=; b=YftYi+qkn5bQRw1kC1Cl c9n6uG1TA4J9DfPMwM4XVTqFPNbJ0Ar7Uk0wfxHI99Jo/nusIOv1DxCNhyJFxEFarFGkyrJAdAoyF E64HQh65UmtWqy+mxEi90JNNwz1i0v3hXdzTsrz+k5aqKzHuGhmgIlyA0+rEV1ybicVGIXMTC63gA cqjvwMUSBOoCpjroa9kUHtX4WeSTNVGQYU6zcZvNqJSshmH/+uG06h62QnK8K2vV62V0xGAmhaRYx CrmGtiVNUxhw/xW92wUZN64UbV4ytdlPBSXo24pN5TwnjyiiZY5SeQTckNUGjBG4+vc9FFwfNI6SO g0JcqxZJ+WQisQ==; Date: Sat, 01 Feb 2025 12:39:49 +0200 Message-Id: <86cyg2gd8q.fsf@gnu.org> From: Eli Zaretskii To: Pengji Zhang In-Reply-To: <87ed0oo4tg.fsf@pengjiz.com> (message from Pengji Zhang on Mon, 27 Jan 2025 19:48:43 +0800) Subject: Re: bug#75825: [PATCH] New user option 'Buffer-menu-human-readable-size' References: <87zfjfp15y.fsf@pengjiz.com> <87ed0p4y3q.fsf@gmail.com> <87ed0oo4tg.fsf@pengjiz.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75825-done Cc: rpluim@gmail.com, 75825-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: -3.3 (---) > Cc: 75825@debbugs.gnu.org > From: Pengji Zhang > Date: Mon, 27 Jan 2025 19:48:43 +0800 > > Thanks for the review! > > Robert Pluim writes: > > > As with #75495, "size" or "sizes", please pick one and only one. > > I do not have a preference for this. So I updated the patch to use > "sizes" consistently following your comment in #75495. > > > When adding a new user option, please describe the default value. I > > assume itʼs nil, but NEWS should tell me (especially as NEWS is often > > read outside Emacs). > > Added in the updated patch. Thanks, installed on the master branch, and closing the bug. Please in the future, once the bug number is known (as it always is when you post a corrected version of a patch), mention the bug number in the commit log message. Otherwise, I have to add it manually, when installing the patch. From unknown Fri Jun 20 07:18:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 01 Mar 2025 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator