all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Laurence Warne <laurencewarne@gmail.com>
Cc: 59407@debbugs.gnu.org
Subject: bug#59407: [PATCH] Add Colors to proced
Date: Sun, 20 Nov 2022 12:48:03 +0200	[thread overview]
Message-ID: <83mt8l6gws.fsf@gnu.org> (raw)
In-Reply-To: <CAE2oLqhvrf4w=dGp8zmPbi68BfG0htUhH92CTuF+DgR2bmj41A@mail.gmail.com> (message from Laurence Warne on Sun, 20 Nov 2022 10:26:35 +0000)

> From: Laurence Warne <laurencewarne@gmail.com>
> 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.





  reply	other threads:[~2022-11-20 10:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 10:26 bug#59407: [PATCH] Add Colors to proced Laurence Warne
2022-11-20 10:48 ` Eli Zaretskii [this message]
2022-11-20 12:33 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-20 14:40   ` Eli Zaretskii
2022-11-21  9:07     ` Laurence Warne
2022-11-21 10:32       ` Michael Albinus
2022-11-21 14:28       ` Eli Zaretskii
2022-11-25  9:34         ` Laurence Warne
2022-11-25 11:30           ` Michael Albinus
2022-11-25 15:07             ` Eli Zaretskii
2022-11-25 15:19               ` Michael Albinus
2022-11-26  9:41                 ` Laurence Warne
2022-11-27 16:04                   ` Michael Albinus
2022-11-29 14:02                     ` Laurence Warne
2022-12-01 18:17                       ` Eli Zaretskii
2022-12-01 21:14                         ` Laurence Warne
2022-11-26 12:47           ` Eli Zaretskii
2022-11-20 14:14 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mt8l6gws.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59407@debbugs.gnu.org \
    --cc=laurencewarne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.