unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thuna <thuna.cing@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 53375@debbugs.gnu.org
Subject: bug#53375: [PATCH] Correct wrong comparison operation in previous patch
Date: Sun, 23 Jan 2022 17:52:45 +0300	[thread overview]
Message-ID: <82905c21-ad64-7f4a-d22e-184b0374fdf3@gmail.com> (raw)
In-Reply-To: <877daqa4r9.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 37 bytes --]

My bad, hopefully this goes through.

[-- Attachment #2: 0001-Fix-tabulated-list-widen-current-column-widening-wro.patch --]
[-- Type: text/x-patch, Size: 2086 bytes --]

From cd255476bf219e8162f56525e66c93fc5da3a3a9 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Sun, 23 Jan 2022 17:07:33 +0300
Subject: [PATCH] Fix tabulated-list-widen-current-column widening wrong column

* tabulated-list.el (tabulated-list-widen-current-column): Use correct
comparison operation when checking if point is within the column
bounds.
Copyright-paperwork-exempt: yes
---
 lisp/emacs-lisp/tabulated-list.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 32a046e0fb..a242ac1899 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -739,17 +739,17 @@ tabulated-list-widen-current-column
         col-width)
     (while (and (not found)
                 (< col-nb nb-cols))
-      (if (> start
-             (setq total-width
-                   (+ total-width
-                      (max (setq col-width
-                                 (cadr (aref tabulated-list-format
-                                             col-nb)))
-                           (string-width (aref entry col-nb)))
-                      (or (plist-get (nthcdr 3 (aref tabulated-list-format
-                                                     col-nb))
-                                     :pad-right)
-                          1))))
+      (if (>= start
+              (setq total-width
+                    (+ total-width
+                       (max (setq col-width
+                                  (cadr (aref tabulated-list-format
+                                              col-nb)))
+                            (string-width (aref entry col-nb)))
+                       (or (plist-get (nthcdr 3 (aref tabulated-list-format
+                                                      col-nb))
+                                      :pad-right)
+                           1))))
           (setq col-nb (1+ col-nb))
         (setq found t)
         (setf (cadr (aref tabulated-list-format col-nb))
-- 
2.25.1


  reply	other threads:[~2022-01-23 14:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 21:40 bug#53375: [PATCH] Account for padding and content length in, tabulated-list-widen-current-column Thuna
2022-01-20 14:23 ` Lars Ingebrigtsen
2022-01-20 18:42   ` Thuna
2022-01-21  9:27     ` Lars Ingebrigtsen
2022-01-23 14:42 ` bug#53375: [PATCH] Correct wrong comparison operation in previous patch Thuna
2022-01-23 14:47   ` Lars Ingebrigtsen
2022-01-23 14:52     ` Thuna [this message]
2022-01-23 14:56       ` Lars Ingebrigtsen

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=82905c21-ad64-7f4a-d22e-184b0374fdf3@gmail.com \
    --to=thuna.cing@gmail.com \
    --cc=53375@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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).