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: Sun, 20 Nov 2022 12:48:03 +0200 Message-ID: <83mt8l6gws.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13109"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59407@debbugs.gnu.org To: Laurence Warne Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 11:48:28 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 1owhsB-0003FO-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 11:48:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owhro-0002mh-Gl; Sun, 20 Nov 2022 05: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 1owhrm-0002l2-Mg for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 05:48:02 -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 1owhrm-00035f-9u for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 05:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owhrm-0006Qm-1x for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 05: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: Sun, 20 Nov 2022 10: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.166894128124717 (code B ref 59407); Sun, 20 Nov 2022 10:48:02 +0000 Original-Received: (at 59407) by debbugs.gnu.org; 20 Nov 2022 10:48:01 +0000 Original-Received: from localhost ([127.0.0.1]:42457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owhrl-0006QX-4S for submit@debbugs.gnu.org; Sun, 20 Nov 2022 05:48:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owhrj-0006QK-J7 for 59407@debbugs.gnu.org; Sun, 20 Nov 2022 05:48:00 -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 1owhre-00034F-Ba; Sun, 20 Nov 2022 05:47:54 -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=N09Ms608YLVrvp8Fj9lBya62YqU1ZXIkuJEDLsNuqpU=; b=kg35gOvpxX6M nnsA93Hga7iK/1TPiLMmOhEnkeZaEY/SuzKBCGQKeIZC7YIFv19dOb5rmqLN+cB47TdDWpDlxFwk7 i1duZxf0NgsutWxiX6CdCR2zEleXV4KFFOQW4bBo0NIlDJCmqjlUFXYwYp4G+R/usbbh099wX+xZo JcEZ+wk9Ukei5AqHNuTqlSZQD8RxrCvFv7wSPm6xgWqKJxIy0LA9G11a8iyIM2z3F0MbddLK9W80h OKdAJKbAkXqPbVRkpYnMyPiIo1TjD5zXwp3qV4X6+FFZYCO740qHMBnK5x87Zzyp9/Mi24/8UywzY GKuXMxWEd8HRqsSxxd1Irw==; 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 1owhrd-0004jX-Ph; Sun, 20 Nov 2022 05:47:54 -0500 In-Reply-To: (message from Laurence Warne on Sun, 20 Nov 2022 10:26:35 +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:248412 Archived-At: > From: Laurence Warne > Date: Sun, 20 Nov 2022 10:26:35 +0000 > > Hi, attached is a patch I've recently been working to do with colorizing proced buffers, similar to htop. > > In particular, the current Emacs process id is highlighted purple in both the process id and parent process id > columns, session group leaders have their process ids underlined, larger memory sizes for rss and vsize > are highlighted in darker shades of orange, and the first word in the args property (the executable) is > highlighted in blue - I've attached a couple of screenshots. Thanks. Please be sure to test the new faces with the following Emacs configurations: . GUI frames with dark background . GUI frames with light background . TTY frames with dark and light backgrounds and with: - 8 colors - 16 colors It is quite possible that some of the above combinations will not look well with the colors you propose, and will need separate defaults. A few more minor comments: > * lisp/proced.el (proced-grammar-alist): update to use new format functions > (proced-low-memory-usage-threshold): new custom variable to determine > whether a value represents 'low' memory usage, used only in > proced-format-memory for coloring This is not our style of commit log messages. The description of each change should begin with a capital letter and end with a period, i.e. be a complete English sentence or several sentences. > (proced-run-status-code): new face > (proced-interruptible-sleep-status-code): new face > (proced-uninterruptible-sleep-status-code): new face > (proced-executable): new face > (proced-memory-gb): new face > (proced-memory-mb): new face > (proced-memory-default): new face > (proced-pid): new face > (proced-ppid): new face > (proced-pgrp): new face > (proced-sess): new face > (proced-cpu): new face > (proced-mem): new face > (proced-user): new face > (proced-time-colon): new face It is better to have a single list of new faces with one description, like this: (proced-run-status-code, proced-executable. proced-memory-default) (proced-memory-mb, proced-pgrp): New faces. > +(defcustom proced-enable-color-flag nil > + "Non-nil means some process attributes will be rendered with color." Please use "displayed", not "rendered". > +(defcustom proced-low-memory-usage-threshold (* 1024 1024 100) > + "The low memory usage (in bytes) upper bound. This should probably be specified as percentage of total memory. Or maybe there should be a separate defcustom for the percentage, and the condition should use both. Just a single absolute threshold seems to cover only some reasons for highlighting processes with large memory footprint. > +(defcustom proced-medium-memory-usage-threshold (* 1024 1024 1024) > + "The medium memory usage (in bytes) upper bound. Likewise. Finally, this changeset needs a suitable NEWS entry to announce it.