From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59407: [PATCH] Add Colors to proced Date: Sat, 26 Nov 2022 14:47:29 +0200 Message-ID: <834julubku.fsf@gnu.org> References: <87wn7p7qko.fsf@yahoo.com> <83fsed664y.fsf@gnu.org> <83mt8k2xhl.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2559"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, michael.albinus@gmx.de, 59407@debbugs.gnu.org To: Laurence Warne Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 13:48:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyube-0000PO-Qu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 13:48:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyubE-00039J-R9; Sat, 26 Nov 2022 07:48:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyubD-000396-3Y for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 07:48:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyubC-000447-QU for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 07:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyubC-0004IK-Ha for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 07:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2022 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59407-submit@debbugs.gnu.org id=B59407.166946683316344 (code B ref 59407); Sat, 26 Nov 2022 12:48:02 +0000 Original-Received: (at 59407) by debbugs.gnu.org; 26 Nov 2022 12:47:13 +0000 Original-Received: from localhost ([127.0.0.1]:38110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyuaO-0004FY-UY for submit@debbugs.gnu.org; Sat, 26 Nov 2022 07:47:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyuaM-0004FK-O1 for 59407@debbugs.gnu.org; Sat, 26 Nov 2022 07:47:11 -0500 Original-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 1oyuaH-000405-8Z; Sat, 26 Nov 2022 07:47:05 -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=NP5/FudiieMfdkDTCpJvzmttYWNm7JSzhnT1VJHoL98=; b=JJjre/+7MhIx nnxjAVMfuQKFYikG/XH2Ei821k8y16OKbr+TtTTwPcopRhfe5Mmj3zhdLk1oDLMjti2FslKgtYRRw kTjzhMmFvQ0btmHAYhALzDLcOL2LYGGCt2eLVjQZuawrkvoUy3jZe9A80pZEEdPANhGiDi+dyx94b jOuBEecRhAeJVDn41Im0OmOXSpWQM4Y+rewzrkD+CteH7RtbzvRcpZizc5BSV4P0h2s4JplIPU9Zy HHFPJ17YLjQxC4Pt8VrD3+8mcYvLxwZoBJRE25hYnQSt7sMLCNw757YXWQTag93pLcBEcNGhaFGkj +dvSuJ9mE4QgHfq6itoDng==; Original-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 1oyuaG-0001jQ-OZ; Sat, 26 Nov 2022 07:47:05 -0500 In-Reply-To: (message from Laurence Warne on Fri, 25 Nov 2022 09:34:09 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249078 Archived-At: > From: Laurence Warne > Date: Fri, 25 Nov 2022 09:34:09 +0000 > Cc: luangruo@yahoo.com, 59407@debbugs.gnu.org, michael.albinus@gmx.de > > I've attached a new patch, the changes this time are that the memory thresholds now take a proportion > rather than a fixed value, and some of the face defaults have been improved to play nicer with 8 colour > displays. Thanks, see some comments below. > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -514,6 +514,22 @@ option) and can be set to nil to disable Just-in-time Lock mode. > > * Changes in Emacs 29.1 > > +--- > +** New user option `proced-enable-color-flag` to enable coloring of proced buffers > +This option enables prompts some format functions to furnish their > +respective process attributes with colors and effects in order to > +make them easier to distinguish and highlight possible issues > +(e.g. high memory usage), in a manner similar to htop. > + > +In particular, the current Emacs process id is highlighted purple in > +both the process id and parent process id columns, session leaders > +have their process ids underlined, larger memory sizes for rss are > +highlighted in darker shades of orange, and the first word in the > +args property (the executable) is highlighted in blue. > + > +Note this option is disabled by default and needs setting to a non-nil > +value to take effect. This is too long for a NEWS entry for such a minor feature. Please make it shorter. Just saying that some fields of Proced display will be shown in distinct colors, and mentioning the new defcustom to turn that on, should be enough. > +(defcustom proced-enable-color-flag nil > + "Non-nil means some process attributes will be displayed with color." Our style is to avoid passive tense whenever possible: Non-nil means Proced should display some process attributes with color. > +(defcustom proced-medium-memory-usage-threshold 0.5 > + "The medium memory usage (in bytes) upper bound. It is better to avoid such constructs. Instead, say this: The upper bound for medium memory usage, relative to total memory. Note that I removed "in bytes", since this is not the units in which this is measured. > +When `proced-enable-color-flag' is non-nil, rss values denoting a proportion > +of memory less than this value, but greater than > +`proced-low-memory-usage-threshold' will be displayed using the ^ Comma missing there. > +`proced-memory-medium-usage' face. rss values denoting a greater proportion I think "rss" should be in all-caps, as "RSS". Same for "VSIZE". > +(defface proced-interruptible-sleep-status-code > + '((((class color)) (:foreground "DimGrey")) Is this color visible well on both dark and light backgrounds? > + (t (:italic t))) > + "Face used for the interruptible sleep status code character \"S\"." > + :version "29.1") Please mention Proced in all the doc strings of these faces, to make it clear they are only used by Proced. > +(defface proced-emacs-pid > + '((((class color) (min-colors 88)) (:foreground "purple")) > + (((class color)) (:foreground "magenta"))) > + "Face for the pid of the current Emacs process." ^^^ Please use "process ID", not just its abbreviation. > +(defface proced-pid > + '((((class color) (min-colors 88)) (:foreground "#5085ef")) > + (((class color)) (:foreground "blue"))) > + "Face for process ids." "Face for process IDs", note the letter-case (here and elsewhere in the patch). > +(defface proced-cpu > + '((((class color) (min-colors 88)) (:foreground "#6d5cc3" :bold t)) > + (t (:bold t))) > + "Face for process cpu utilization." "CPU", in caps. Thanks for working on this.