unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Laurence Warne <laurencewarne@gmail.com>
To: Matthias Meulien <orontee@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	stephen.berman@gmx.net, 64752@debbugs.gnu.org
Subject: bug#64752: 30.0.50; proced: text-scale-adjust leads to wrong header alignment
Date: Sat, 22 Jul 2023 15:32:25 +0100	[thread overview]
Message-ID: <CAE2oLqiAMOWoi3SqYJNyc-FTEWWsva-qZrB0roYFbewviLa1zA@mail.gmail.com> (raw)
In-Reply-To: <878rb8beyb.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1025 bytes --]

Thanks both, I've attached a patch which should hopefully fix the problem
(and an image of what I get after applying the patch).  Previously, it was
assumed by proced-grammar-alist that the function proced-format-start would
always return a string of length six which is not the case as shown above.

The patch fixes this by changing the justify attribute of 'Start' in
proced-grammar-alist to 'left' instead of '6' (a fixed number means the
attribute widths should always be this value - see the doc of
proced-grammar-alist for more info).

I don't think JUSTIFY supports 'center' which I think would be nicer in
this situation, perhaps this could be done in a future patch.  AFAICS the
only other use of a fixed value for justify is the 'nice' attribute, but I
think this 3 char limit will always hold, at least for nix systems.  Do you
experience formatting issues for any column other than 'Start' Matthias?

I've also found another source of flakiness for the proced tests, but
that's another issue (:

Thanks, Laurence

[-- Attachment #1.2: Type: text/html, Size: 1233 bytes --]

[-- Attachment #2: 0001-Fix-Proced-Start-column-alignment-for-different-loca.patch --]
[-- Type: text/x-patch, Size: 1608 bytes --]

From 24d01c3cfcfd6a833fdeffb09ec6036e4affdc26 Mon Sep 17 00:00:00 2001
From: Laurence Warne <laurencewarne@gmail.com>
Date: Sat, 22 Jul 2023 14:35:15 +0100
Subject: [PATCH] Fix Proced Start column alignment for different locales

* lisp/proced.el (proced-grammar-alist): Change the justify value of
the start attribute to left from the fixed value of six.
(Bug#64752)
(proced-format-start): Remove the assertion that the returned string
will always be of length six from the docstring.
---
 lisp/proced.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/proced.el b/lisp/proced.el
index b3d581a49d1..47de74b0ecb 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -152,7 +152,7 @@ proced-grammar-alist
     (pri     "Pr"      "%d" right proced-< t (pri pid) (nil t t))
     (nice    "Ni"      "%3d" 3 proced-< t (nice pid) (t t nil))
     (thcount "THCount" "%d" right proced-< t (thcount pid) (nil t t))
-    (start   "Start"   proced-format-start 6 proced-time-lessp nil (start pid)
+    (start   "Start"   proced-format-start left proced-time-lessp nil (start pid)
                        (t t nil))
     (vsize   "VSize"   proced-format-memory right proced-< t (vsize pid)
                        (nil t t))
@@ -1599,8 +1599,7 @@ proced-format-time
            (format "%02d%s%02d" minutes colon seconds)))))
 
 (defun proced-format-start (start)
-  "Format time START.
-The return string is always 6 characters wide."
+  "Format time START."
   (let ((d-start (decode-time start))
         (d-current (decode-time))
         (colon (if proced-enable-color-flag
-- 
2.30.2


[-- Attachment #3: proced-start-formatting.png --]
[-- Type: image/png, Size: 79686 bytes --]

  reply	other threads:[~2023-07-22 14:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 19:43 bug#64752: 30.0.50; proced: text-scale-adjust leads to wrong header alignment Matthias Meulien
2023-07-20 20:12 ` Stephen Berman
2023-07-21  6:35   ` Matthias Meulien
2023-07-21  7:47     ` Eli Zaretskii
2023-07-21 12:26       ` Eli Zaretskii
2023-07-21 19:14         ` Laurence Warne
2023-07-22  5:19           ` Eli Zaretskii
2023-07-22  7:09           ` Matthias Meulien
2023-07-22 14:32             ` Laurence Warne [this message]
2023-07-22 20:44               ` Matthias Meulien
2023-07-23  6:42                 ` Eli Zaretskii
2023-07-21 14:21       ` Matthias Meulien
2023-07-21 12:25 ` Eli Zaretskii
2023-07-21 14:27   ` Matthias Meulien
2023-07-21 14:38     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAE2oLqiAMOWoi3SqYJNyc-FTEWWsva-qZrB0roYFbewviLa1zA@mail.gmail.com \
    --to=laurencewarne@gmail.com \
    --cc=64752@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=orontee@gmail.com \
    --cc=stephen.berman@gmx.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).