all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
@ 2022-07-01 22:43 Thuna
  2022-07-02  6:06 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Thuna @ 2022-07-01 22:43 UTC (permalink / raw)
  To: 56345

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Actual patch --]
[-- Type: text/x-patch, Size: 16965 bytes --]

From b49d5876afa3d969ce82df0d723a8a8b766009a0 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Fri, 1 Jul 2022 18:19:52 +0300
Subject: [PATCH 1/2] Add column hiding to tabulated-list-mode

Add the keyword `:hidden' to `tabulated-list-format' for controlling
the visibility of a specific column.

Introduce the commands `tabulated-list-hide-current-column' and
`tabulated-list-make-column-visible' for interactively changing the
`:hidden' property of the column.  The commands are bound to "." and
"+" respectively.

Change calculations involving other columns to account for the
`:hidden' property.

Make the current column calculation into its own function named
`tabulated-list-get-column'.  Make `tabulated-list-widen-current-column'
use that instead. Use the text property `tabulated-list-column-name'
to find the current tabulated-list column instead of `current-column'.
---
 lisp/emacs-lisp/tabulated-list.el | 273 +++++++++++++++++-------------
 1 file changed, 153 insertions(+), 120 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 7d815a3ced..868ed141ec 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -104,7 +104,8 @@ tabulated-list-format
    Currently supported properties are:
    - `:right-align': If non-nil, the column should be right-aligned.
    - `:pad-right': Number of additional padding spaces to the
-     right of the column (defaults to 1 if omitted).")
+     right of the column (defaults to 1 if omitted).
+   - `:hidden': If non-nil, the column should not be visible.")
 (put 'tabulated-list-format 'permanent-local t)
 
 (defvar-local tabulated-list-use-header-line t
@@ -179,6 +180,11 @@ tabulated-list-get-entry
 no entry at POS.  POS, if omitted or nil, defaults to point."
   (get-text-property (or pos (point)) 'tabulated-list-entry))
 
+(defun tabulated-list-get-column (&optional pos)
+  "Return the column name of the Tabulated List cell at POS.
+POS, if omitted or nil, defaults to point."
+  (get-text-property (or pos (point)) 'tabulated-list-column-name))
+
 (defun tabulated-list-put-tag (tag &optional advance)
   "Put TAG in the padding area of the current line.
 TAG should be a string, with length <= `tabulated-list-padding'.
@@ -228,6 +234,8 @@ tabulated-list-mode-map
     (define-key map "S" 'tabulated-list-sort)
     (define-key map "}" 'tabulated-list-widen-current-column)
     (define-key map "{" 'tabulated-list-narrow-current-column)
+    (define-key map "." 'tabulated-list-hide-current-column)
+    (define-key map "+" 'tabulated-list-make-column-visible)
     (define-key map [follow-link] 'mouse-face)
     (define-key map [mouse-2] 'mouse-select-window)
     map)
@@ -290,7 +298,7 @@ tabulated-list-init-header
           cols)
     (dotimes (n len)
       (let* ((col (aref tabulated-list-format n))
-             (not-last-col (< n (1- len)))
+             (not-last-col (tabulated-list--next-visible-column n))
 	     (label (nth 0 col))
              (lablen (length label))
              (pname label)
@@ -298,62 +306,64 @@ tabulated-list-init-header
 	     (props (nthcdr 3 col))
 	     (pad-right (or (plist-get props :pad-right) 1))
              (right-align (plist-get props :right-align))
+             (hidden (plist-get props :hidden))
              (next-x (+ x pad-right width))
              (available-space
               (and not-last-col
                    (if right-align
                        width
                      (tabulated-list--available-space width n)))))
-        (when (and (>= lablen 3)
-                   not-last-col
-                   (> lablen available-space))
-          (setq label (truncate-string-to-width label available-space
-                                                nil nil t)))
-	(push
-	 (cond
-	  ;; An unsortable column
-	  ((not (nth 2 col))
-	   (propertize label 'tabulated-list-column-name pname))
-	  ;; The selected sort column
-	  ((equal (car col) (car tabulated-list-sort-key))
-	   (apply 'propertize
-                  (concat label
-                          (cond
-                           ((and (< lablen 3) not-last-col) "")
-                           ((cdr tabulated-list-sort-key)
-                            (format " %c"
-                                    tabulated-list-gui-sort-indicator-desc))
-                           (t (format " %c"
-                                      tabulated-list-gui-sort-indicator-asc))))
-                  'face 'bold
-                  'tabulated-list-column-name pname
-                  button-props))
-	  ;; Unselected sortable column.
-	  (t (apply 'propertize label
-		    'tabulated-list-column-name pname
-		    button-props)))
-	 cols)
-        (when right-align
-          (let ((shift (- width (string-width (car cols)))))
-            (when (> shift 0)
-              (setq cols
-                    (cons (car cols)
-                          (cons
-                           (propertize
-                            (make-string shift ?\s)
-                            'display
-                            `(space :align-to
-                                    (+ header-line-indent-width ,(+ x shift))))
-                           (cdr cols))))
-              (setq x (+ x shift)))))
-	(if (>= pad-right 0)
-	    (push (propertize
-                   " "
-		   'display `(space :align-to
-                                    (+ header-line-indent-width ,next-x))
-		   'face 'fixed-pitch)
-		  cols))
-        (setq x next-x)))
+        (unless hidden
+          (when (and (>= lablen 3)
+                     not-last-col
+                     (> lablen available-space))
+            (setq label (truncate-string-to-width label available-space
+                                                  nil nil t)))
+	  (push
+	   (cond
+	    ;; An unsortable column
+	    ((not (nth 2 col))
+	     (propertize label 'tabulated-list-column-name pname))
+	    ;; The selected sort column
+	    ((equal (car col) (car tabulated-list-sort-key))
+	     (apply 'propertize
+                    (concat label
+                            (cond
+                             ((and (< lablen 3) not-last-col) "")
+                             ((cdr tabulated-list-sort-key)
+                              (format " %c"
+                                      tabulated-list-gui-sort-indicator-desc))
+                             (t (format " %c"
+                                        tabulated-list-gui-sort-indicator-asc))))
+                    'face 'bold
+                    'tabulated-list-column-name pname
+                    button-props))
+	    ;; Unselected sortable column.
+	    (t (apply 'propertize label
+		      'tabulated-list-column-name pname
+		      button-props)))
+	   cols)
+          (when right-align
+            (let ((shift (- width (string-width (car cols)))))
+              (when (> shift 0)
+                (setq cols
+                      (cons (car cols)
+                            (cons
+                             (propertize
+                              (make-string shift ?\s)
+                              'display
+                              `(space :align-to
+                                      (+ header-line-indent-width ,(+ x shift))))
+                             (cdr cols))))
+                (setq x (+ x shift)))))
+	  (if (>= pad-right 0)
+	      (push (propertize
+                     " "
+		     'display `(space :align-to
+                                      (+ header-line-indent-width ,next-x))
+		     'face 'fixed-pitch)
+		    cols))
+          (setq x next-x))))
     (setq cols (apply 'concat (nreverse cols)))
     (if tabulated-list-use-header-line
 	(setq header-line-format (list "" 'header-line-indent cols))
@@ -535,15 +545,29 @@ tabulated-list-print-entry
      beg (point)
      `(tabulated-list-id ,id tabulated-list-entry ,cols))))
 
+(defun tabulated-list--next-visible-column (n)
+  (let ((len (length tabulated-list-format))
+        (col-nb (1+ n))
+        found)
+    (while (and (< col-nb len)
+                (not found))
+      (if (plist-get (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden)
+          (setq col-nb (1+ col-nb))
+        (setq found t)))
+    (when (< col-nb len)
+      col-nb)))
+
 (defun tabulated-list--available-space (width n)
-  (let* ((next-col-format (aref tabulated-list-format (1+ n)))
+  (let* ((next-col (tabulated-list--next-visible-column n))
+         (next-col-format (aref tabulated-list-format next-col))
          (next-col-right-align (plist-get (nthcdr 3 next-col-format)
                                           :right-align))
          (next-col-width (nth 1 next-col-format)))
     (if next-col-right-align
         (- (+ width next-col-width)
            (min next-col-width
-                (tabulated-list--col-local-max-widths (1+ n))))
+                (tabulated-list--col-local-max-widths next-col)))
       width)))
 
 (defun tabulated-list-print-col (n col-desc x)
@@ -557,50 +581,52 @@ tabulated-list-print-col
 	 (props     (nthcdr 3 format))
 	 (pad-right (or (plist-get props :pad-right) 1))
          (right-align (plist-get props :right-align))
+         (hidden (plist-get props :hidden))
          (label (cond ((stringp col-desc) col-desc)
                       ((eq (car col-desc) 'image) " ")
                       (t (car col-desc))))
          (label-width (string-width label))
 	 (help-echo (concat (car format) ": " label))
 	 (opoint (point))
-	 (not-last-col (< (1+ n) (length tabulated-list-format)))
+	 (not-last-col (tabulated-list--next-visible-column n))
 	 (available-space (and not-last-col
                                (if right-align
                                    width
                                  (tabulated-list--available-space width n)))))
-    ;; Truncate labels if necessary (except last column).
-    ;; Don't truncate to `width' if the next column is align-right
-    ;; and has some space left, truncate to `available-space' instead.
-    (when (and not-last-col
-	       (> label-width available-space))
-      (setq label (truncate-string-to-width
-		   label available-space nil nil t t)
-	    label-width available-space))
-    (setq label (bidi-string-mark-left-to-right label))
-    (when (and right-align (> width label-width))
-      (let ((shift (- width label-width)))
-        (insert (propertize (make-string shift ?\s)
-                            'display `(space :align-to ,(+ x shift))))
-        (setq width (- width shift))
-        (setq x (+ x shift))))
-    (cond ((stringp col-desc)
-           (insert (if (get-text-property 0 'help-echo label)
-                       label
-                     (propertize label 'help-echo help-echo))))
-          ((eq (car col-desc) 'image)
-           (insert (propertize " "
-                               'display col-desc
-                               'help-echo help-echo)))
-          ((apply 'insert-text-button label (cdr col-desc))))
-    (let ((next-x (+ x pad-right width)))
-      ;; No need to append any spaces if this is the last column.
-      (when not-last-col
-        (when (> pad-right 0) (insert (make-string pad-right ?\s)))
-        (insert (propertize
-                 (make-string (- width (min width label-width)) ?\s)
-                 'display `(space :align-to ,next-x))))
-      (put-text-property opoint (point) 'tabulated-list-column-name name)
-      next-x)))
+    (if hidden x
+      ;; Truncate labels if necessary (except last column).
+      ;; Don't truncate to `width' if the next column is align-right
+      ;; and has some space left, truncate to `available-space' instead.
+      (when (and not-last-col
+	         (> label-width available-space))
+        (setq label (truncate-string-to-width
+		     label available-space nil nil t t)
+	      label-width available-space))
+      (setq label (bidi-string-mark-left-to-right label))
+      (when (and right-align (> width label-width))
+        (let ((shift (- width label-width)))
+          (insert (propertize (make-string shift ?\s)
+                              'display `(space :align-to ,(+ x shift))))
+          (setq width (- width shift))
+          (setq x (+ x shift))))
+      (cond ((stringp col-desc)
+             (insert (if (get-text-property 0 'help-echo label)
+                         label
+                       (propertize label 'help-echo help-echo))))
+            ((eq (car col-desc) 'image)
+             (insert (propertize " "
+                                 'display col-desc
+                                 'help-echo help-echo)))
+            ((apply 'insert-text-button label (cdr col-desc))))
+      (let ((next-x (+ x pad-right width)))
+        ;; No need to append any spaces if this is the last column.
+        (when not-last-col
+          (when (> pad-right 0) (insert (make-string pad-right ?\s)))
+          (insert (propertize
+                   (make-string (- width (min width label-width)) ?\s)
+                   'display `(space :align-to ,next-x))))
+        (put-text-property opoint (point) 'tabulated-list-column-name name)
+        next-x))))
 
 (defun tabulated-list-delete-entry ()
   "Delete the Tabulated List entry at point.
@@ -731,38 +757,16 @@ tabulated-list-widen-current-column
 Interactively, N is the prefix numeric argument, and defaults to
 1."
   (interactive "p")
-  (let ((start (current-column))
-        (entry (tabulated-list-get-entry))
-        (nb-cols (length tabulated-list-format))
-        (col-nb 0)
-        (total-width 0)
-        (found nil)
-        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)))
-                            (let ((desc (aref entry col-nb)))
-                              (string-width (if (stringp desc)
-                                                desc
-                                              (car desc)))))
-                       (or (plist-get (nthcdr 3 (aref tabulated-list-format
-                                                      col-nb))
-                                      :pad-right)
-                           1))))
-          (setq col-nb (1+ col-nb))
-        (setq found t)
-        ;; `tabulated-list-format' may be a constant (sharing list
-        ;; structures), so copy it before mutating.
-        (setq tabulated-list-format (copy-tree tabulated-list-format t))
-        (setf (cadr (aref tabulated-list-format col-nb))
-              (max 1 (+ col-width n)))
-        (tabulated-list-print t)
-        (tabulated-list-init-header)))))
+  (let* ((col-nb (tabulated-list--column-number
+                  (tabulated-list-get-column)))
+         (col-width (cadr (aref tabulated-list-format col-nb))))
+    ;; `tabulated-list-format' may be a constant (sharing list
+    ;; structures), so copy it before mutating.
+    (setq tabulated-list-format (copy-tree tabulated-list-format t))
+    (setf (cadr (aref tabulated-list-format col-nb))
+          (max 1 (+ col-width n)))
+    (tabulated-list-print t)
+    (tabulated-list-init-header)))
 
 (defun tabulated-list-narrow-current-column (&optional n)
   "Narrow the current tabulated list column by N chars.
@@ -771,6 +775,35 @@ tabulated-list-narrow-current-column
   (interactive "p")
   (tabulated-list-widen-current-column (- n)))
 
+(defun tabulated-list-hide-current-column ()
+  "Hide the current tabulated list column."
+  (interactive)
+  (let ((col-nb (tabulated-list--column-number
+                 (tabulated-list-get-column))))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden t)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
+(defun tabulated-list-make-column-visible (name)
+  "Make the tabulated list column NAME visible.
+Interactively, NAME is a hidden column propmted for with
+`completing-read'."
+  (interactive
+   (list
+    (completing-read "Colummn name: "
+                     (append tabulated-list-format nil)
+                     (lambda (col)
+                       (plist-get (nthcdr 3 col) :hidden))
+                     t)))
+  (let ((col-nb (tabulated-list--column-number name)))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden nil)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
 (defun tabulated-list-next-column (&optional arg)
   "Go to the start of the next column after point on the current line.
 If ARG is provided, move that many columns."
-- 
2.35.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix --]
[-- Type: text/x-patch, Size: 1723 bytes --]

From 3348b627bc1ad8d0d187a0c8bd0ce45f6a769d33 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Sat, 2 Jul 2022 00:03:38 +0300
Subject: [PATCH 2/2] Fix `tabulated-list-format' sharing list structures

* tabulated-list.el (tabulated-list-hide-current-column
tabulated-list-make-column-visible): Copy tabulated-list-format
recursively before mutating it.
---
 lisp/emacs-lisp/tabulated-list.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 868ed141ec..4e0b3b9e95 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -780,6 +780,9 @@ tabulated-list-hide-current-column
   (interactive)
   (let ((col-nb (tabulated-list--column-number
                  (tabulated-list-get-column))))
+    ;; `tabulated-list-format' may be a constant (sharing list
+    ;; structures), so copy it before mutating.
+    (setq tabulated-list-format (copy-tree tabulated-list-format t))
     (setf (nthcdr 3 (aref tabulated-list-format col-nb))
           (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
                      :hidden t)))
@@ -798,6 +801,9 @@ tabulated-list-make-column-visible
                        (plist-get (nthcdr 3 col) :hidden))
                      t)))
   (let ((col-nb (tabulated-list--column-number name)))
+    ;; `tabulated-list-format' may be a constant (sharing list
+    ;; structures), so copy it before mutating.
+    (setq tabulated-list-format (copy-tree tabulated-list-format t))
     (setf (nthcdr 3 (aref tabulated-list-format col-nb))
           (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
                      :hidden nil)))
-- 
2.35.1


[-- Attachment #3: Type: text/plain, Size: 469 bytes --]

The attached patches introduce column hiding to tabulated-list-mode,
which works by adding the keyword `:hidden' to `tabulated-list-format'.

Patch 0001 is the actual patch itself while 0002 is a bug fix.  0001
compiled fine for me but I did not test 0002, though it should be
perfectly safe.

I went through tabulated-list.el and fixed everything I could find that
would be affected by the visibility of columns.  I don't believe I
missed anything but it is possible.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-07-01 22:43 bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Thuna
@ 2022-07-02  6:06 ` Eli Zaretskii
  2022-07-02 15:34 ` bug#56345: Typo fix and convenience function Thuna
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2022-07-02  6:06 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

> From: Thuna <thuna.cing@gmail.com>
> Date: Sat, 02 Jul 2022 01:43:26 +0300
> 
> >From b49d5876afa3d969ce82df0d723a8a8b766009a0 Mon Sep 17 00:00:00 2001
> From: Thuna <thuna.cing@gmail.com>
> Date: Fri, 1 Jul 2022 18:19:52 +0300
> Subject: [PATCH 1/2] Add column hiding to tabulated-list-mode
> 
> Add the keyword `:hidden' to `tabulated-list-format' for controlling
> the visibility of a specific column.
> 
> Introduce the commands `tabulated-list-hide-current-column' and
> `tabulated-list-make-column-visible' for interactively changing the
> `:hidden' property of the column.  The commands are bound to "." and
> "+" respectively.
> 
> Change calculations involving other columns to account for the
> `:hidden' property.
> 
> Make the current column calculation into its own function named
> `tabulated-list-get-column'.  Make `tabulated-list-widen-current-column'
> use that instead. Use the text property `tabulated-list-column-name'
> to find the current tabulated-list column instead of `current-column'.

Thanks.  If we decide to install this, we'd need a NEWS entry for the
new feature.

I have no comments on the code, but please wait for Lars and others to
chime in.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: Typo fix and convenience function
  2022-07-01 22:43 bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Thuna
  2022-07-02  6:06 ` Eli Zaretskii
@ 2022-07-02 15:34 ` Thuna
  2022-09-05 19:31   ` bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Lars Ingebrigtsen
  2022-09-07 10:37 ` Thuna
  2022-10-27 23:12 ` Thuna
  3 siblings, 1 reply; 21+ messages in thread
From: Thuna @ 2022-07-02 15:34 UTC (permalink / raw)
  To: 56345

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

I apparently had a couple typos that I missed, the patch 0003 is to fix
that.

Also, I figured it would be convenient to have a way to specify the
column to hide by name, so I created a function named
`tabulated-list-hide-column', which `tabulated-list-hide-current-column'
now calls.  I didn't test it but the code is directly ripped from the
original function so I don't think there will be any problems.  That is
in the patch 0004.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: typo fix --]
[-- Type: text/x-patch, Size: 1163 bytes --]

From c96ab25defb31fc596818a39e1a632dd09e2cc72 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Sat, 2 Jul 2022 18:21:53 +0300
Subject: [PATCH 3/4] Fix typos in tabulated-list-make-column-visible

In the docstring: propmted -> prompted
In the `completing-read' prompt: colummn -> column
---
 lisp/emacs-lisp/tabulated-list.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 4e0b3b9e95..96607307fa 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -791,11 +791,11 @@ tabulated-list-hide-current-column
 
 (defun tabulated-list-make-column-visible (name)
   "Make the tabulated list column NAME visible.
-Interactively, NAME is a hidden column propmted for with
+Interactively, NAME is a hidden column prompted for with
 `completing-read'."
   (interactive
    (list
-    (completing-read "Colummn name: "
+    (completing-read "Column name: "
                      (append tabulated-list-format nil)
                      (lambda (col)
                        (plist-get (nthcdr 3 col) :hidden))
-- 
2.35.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: hide column by name --]
[-- Type: text/x-patch, Size: 1860 bytes --]

From 6198fb2b57a9c8267d86baac40406d05ef62eb2a Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Sat, 2 Jul 2022 18:24:34 +0300
Subject: [PATCH 4/4] Allow interactive hiding of a specific column in
 tabulated-list

* tabulated-list.el (tabulated-list-hide-column
tabulated-list-hide-current-column): The command
`tabulated-list-hide-current-column' is now a wrapper for
`tabulated-list-hide-column', a function which takes the name of the
column and hides it.  This can be called interactively similar to
`tabulated-list-make-column-visible'
---
 lisp/emacs-lisp/tabulated-list.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 96607307fa..c04a539ed8 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -778,8 +778,21 @@ tabulated-list-narrow-current-column
 (defun tabulated-list-hide-current-column ()
   "Hide the current tabulated list column."
   (interactive)
-  (let ((col-nb (tabulated-list--column-number
-                 (tabulated-list-get-column))))
+  (tabulated-list-hide-column
+   (tabulated-list-get-column)))
+
+(defun tabulated-list-hide-column (name)
+  "Hide the tabulated list column NAME.
+Interactively, NAME is a visible column prompted for with
+`completing-read'"
+  (interactive
+   (list
+    (completing-read "Column name"
+                     (append tabulated-list-format nil)
+                     (lambda (col)
+                       (not (plist-get (nthcdr 3 col) :hidden)))
+                     t)))
+  (let ((col-nb (tabulated-list--column-number name)))
     ;; `tabulated-list-format' may be a constant (sharing list
     ;; structures), so copy it before mutating.
     (setq tabulated-list-format (copy-tree tabulated-list-format t))
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-07-02 15:34 ` bug#56345: Typo fix and convenience function Thuna
@ 2022-09-05 19:31   ` Lars Ingebrigtsen
  2022-09-05 19:58     ` Thuna
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-05 19:31 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

Thuna <thuna.cing@gmail.com> writes:

> I apparently had a couple typos that I missed, the patch 0003 is to fix
> that.
>
> Also, I figured it would be convenient to have a way to specify the
> column to hide by name, so I created a function named
> `tabulated-list-hide-column', which `tabulated-list-hide-current-column'
> now calls.  I didn't test it but the code is directly ripped from the
> original function so I don't think there will be any problems.  That is
> in the patch 0004.

It's a bit difficult to read this patch series.  Could you instead
submit one single patch, instead of a series of patches that fix
problems in previous versions of the patches?

Also, this change is so large that a copyright assignment to the FSF is
needed.  Would you be willing to sign such paperwork?





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-05 19:31   ` bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Lars Ingebrigtsen
@ 2022-09-05 19:58     ` Thuna
  2022-09-06 10:07       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 21+ messages in thread
From: Thuna @ 2022-09-05 19:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56345

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


This should be all the previous patches merged into a single one.  I
don't mind signing the papers, but I have a few questions about it,
where do I send them?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: single patch --]
[-- Type: text/x-patch, Size: 16508 bytes --]

From 2a5b5759de4d3acd0104cb1c9e9f75130f0c58e9 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Fri, 1 Jul 2022 18:19:52 +0300
Subject: [PATCH] Add column hiding to tabulated-list-mode

Add the keyword `:hidden' to `tabulated-list-format' for controlling
the visibility of a specific column.

Introduce the commands `tabulated-list-hide-current-column' and
`tabulated-list-make-column-visible' for interactively changing the
`:hidden' property of the column.  The commands are bound to "." and
"+" respectively.

Change calculations involving other columns to account for the
`:hidden' property.

Make the current column calculation into its own function named
`tabulated-list-get-column'.  Make `tabulated-list-widen-current-column'
use that instead. Use the text property `tabulated-list-column-name'
to find the current tabulated-list column instead of `current-column'.
---
 lisp/emacs-lisp/tabulated-list.el | 271 +++++++++++++++++-------------
 1 file changed, 151 insertions(+), 120 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 9868d8c4ec..a24b051d9c 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -104,7 +104,8 @@ tabulated-list-format
    Currently supported properties are:
    - `:right-align': If non-nil, the column should be right-aligned.
    - `:pad-right': Number of additional padding spaces to the
-     right of the column (defaults to 1 if omitted).")
+     right of the column (defaults to 1 if omitted).
+   - `:hidden': If non-nil, the column should not be visible.")
 (put 'tabulated-list-format 'permanent-local t)
 
 (defvar-local tabulated-list-use-header-line t
@@ -179,6 +180,11 @@ tabulated-list-get-entry
 no entry at POS.  POS, if omitted or nil, defaults to point."
   (get-text-property (or pos (point)) 'tabulated-list-entry))
 
+(defun tabulated-list-get-column (&optional pos)
+  "Return the column name of the Tabulated List cell at POS.
+POS, if omitted or nil, defaults to point."
+  (get-text-property (or pos (point)) 'tabulated-list-column-name))
+
 (defun tabulated-list-put-tag (tag &optional advance)
   "Put TAG in the padding area of the current line.
 TAG should be a string, with length <= `tabulated-list-padding'.
@@ -285,7 +291,7 @@ tabulated-list-init-header
           cols)
     (dotimes (n len)
       (let* ((col (aref tabulated-list-format n))
-             (not-last-col (< n (1- len)))
+             (not-last-col (tabulated-list--next-visible-column n))
 	     (label (nth 0 col))
              (lablen (length label))
              (pname label)
@@ -293,62 +299,64 @@ tabulated-list-init-header
 	     (props (nthcdr 3 col))
 	     (pad-right (or (plist-get props :pad-right) 1))
              (right-align (plist-get props :right-align))
+             (hidden (plist-get props :hidden))
              (next-x (+ x pad-right width))
              (available-space
               (and not-last-col
                    (if right-align
                        width
                      (tabulated-list--available-space width n)))))
-        (when (and (>= lablen 3)
-                   not-last-col
-                   (> lablen available-space))
-          (setq label (truncate-string-to-width label available-space
-                                                nil nil t)))
-	(push
-	 (cond
-	  ;; An unsortable column
-	  ((not (nth 2 col))
-	   (propertize label 'tabulated-list-column-name pname))
-	  ;; The selected sort column
-	  ((equal (car col) (car tabulated-list-sort-key))
-	   (apply 'propertize
-                  (concat label
-                          (cond
-                           ((and (< lablen 3) not-last-col) "")
-                           ((cdr tabulated-list-sort-key)
-                            (format " %c"
-                                    tabulated-list-gui-sort-indicator-desc))
-                           (t (format " %c"
-                                      tabulated-list-gui-sort-indicator-asc))))
-                  'face 'bold
-                  'tabulated-list-column-name pname
-                  button-props))
-	  ;; Unselected sortable column.
-	  (t (apply 'propertize label
-		    'tabulated-list-column-name pname
-		    button-props)))
-	 cols)
-        (when right-align
-          (let ((shift (- width (string-width (car cols)))))
-            (when (> shift 0)
-              (setq cols
-                    (cons (car cols)
-                          (cons
-                           (propertize
-                            (make-string shift ?\s)
-                            'display
-                            `(space :align-to
-                                    (+ header-line-indent-width ,(+ x shift))))
-                           (cdr cols))))
-              (setq x (+ x shift)))))
-	(if (>= pad-right 0)
-	    (push (propertize
-                   " "
-		   'display `(space :align-to
-                                    (+ header-line-indent-width ,next-x))
-		   'face 'fixed-pitch)
-		  cols))
-        (setq x next-x)))
+        (unless hidden
+          (when (and (>= lablen 3)
+                     not-last-col
+                     (> lablen available-space))
+            (setq label (truncate-string-to-width label available-space
+                                                  nil nil t)))
+	  (push
+	   (cond
+	    ;; An unsortable column
+	    ((not (nth 2 col))
+	     (propertize label 'tabulated-list-column-name pname))
+	    ;; The selected sort column
+	    ((equal (car col) (car tabulated-list-sort-key))
+	     (apply 'propertize
+                    (concat label
+                            (cond
+                             ((and (< lablen 3) not-last-col) "")
+                             ((cdr tabulated-list-sort-key)
+                              (format " %c"
+                                      tabulated-list-gui-sort-indicator-desc))
+                             (t (format " %c"
+                                        tabulated-list-gui-sort-indicator-asc))))
+                    'face 'bold
+                    'tabulated-list-column-name pname
+                    button-props))
+	    ;; Unselected sortable column.
+	    (t (apply 'propertize label
+		      'tabulated-list-column-name pname
+		      button-props)))
+	   cols)
+          (when right-align
+            (let ((shift (- width (string-width (car cols)))))
+              (when (> shift 0)
+                (setq cols
+                      (cons (car cols)
+                            (cons
+                             (propertize
+                              (make-string shift ?\s)
+                              'display
+                              `(space :align-to
+                                      (+ header-line-indent-width ,(+ x shift))))
+                             (cdr cols))))
+                (setq x (+ x shift)))))
+	  (if (>= pad-right 0)
+	      (push (propertize
+                     " "
+		     'display `(space :align-to
+                                      (+ header-line-indent-width ,next-x))
+		     'face 'fixed-pitch)
+		    cols))
+          (setq x next-x))))
     (setq cols (apply 'concat (nreverse cols)))
     (if tabulated-list-use-header-line
 	(setq header-line-format (list "" 'header-line-indent cols))
@@ -530,15 +538,29 @@ tabulated-list-print-entry
      beg (point)
      `(tabulated-list-id ,id tabulated-list-entry ,cols))))
 
+(defun tabulated-list--next-visible-column (n)
+  (let ((len (length tabulated-list-format))
+        (col-nb (1+ n))
+        found)
+    (while (and (< col-nb len)
+                (not found))
+      (if (plist-get (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden)
+          (setq col-nb (1+ col-nb))
+        (setq found t)))
+    (when (< col-nb len)
+      col-nb)))
+
 (defun tabulated-list--available-space (width n)
-  (let* ((next-col-format (aref tabulated-list-format (1+ n)))
+  (let* ((next-col (tabulated-list--next-visible-column n))
+         (next-col-format (aref tabulated-list-format next-col))
          (next-col-right-align (plist-get (nthcdr 3 next-col-format)
                                           :right-align))
          (next-col-width (nth 1 next-col-format)))
     (if next-col-right-align
         (- (+ width next-col-width)
            (min next-col-width
-                (tabulated-list--col-local-max-widths (1+ n))))
+                (tabulated-list--col-local-max-widths next-col)))
       width)))
 
 (defun tabulated-list-print-col (n col-desc x)
@@ -552,50 +574,52 @@ tabulated-list-print-col
 	 (props     (nthcdr 3 format))
 	 (pad-right (or (plist-get props :pad-right) 1))
          (right-align (plist-get props :right-align))
+         (hidden (plist-get props :hidden))
          (label (cond ((stringp col-desc) col-desc)
                       ((eq (car col-desc) 'image) " ")
                       (t (car col-desc))))
          (label-width (string-width label))
 	 (help-echo (concat (car format) ": " label))
 	 (opoint (point))
-	 (not-last-col (< (1+ n) (length tabulated-list-format)))
+	 (not-last-col (tabulated-list--next-visible-column n))
 	 (available-space (and not-last-col
                                (if right-align
                                    width
                                  (tabulated-list--available-space width n)))))
-    ;; Truncate labels if necessary (except last column).
-    ;; Don't truncate to `width' if the next column is align-right
-    ;; and has some space left, truncate to `available-space' instead.
-    (when (and not-last-col
-	       (> label-width available-space))
-      (setq label (truncate-string-to-width
-		   label available-space nil nil t t)
-	    label-width available-space))
-    (setq label (bidi-string-mark-left-to-right label))
-    (when (and right-align (> width label-width))
-      (let ((shift (- width label-width)))
-        (insert (propertize (make-string shift ?\s)
-                            'display `(space :align-to ,(+ x shift))))
-        (setq width (- width shift))
-        (setq x (+ x shift))))
-    (cond ((stringp col-desc)
-           (insert (if (get-text-property 0 'help-echo label)
-                       label
-                     (propertize label 'help-echo help-echo))))
-          ((eq (car col-desc) 'image)
-           (insert (propertize " "
-                               'display col-desc
-                               'help-echo help-echo)))
-          ((apply 'insert-text-button label (cdr col-desc))))
-    (let ((next-x (+ x pad-right width)))
-      ;; No need to append any spaces if this is the last column.
-      (when not-last-col
-        (when (> pad-right 0) (insert (make-string pad-right ?\s)))
-        (insert (propertize
-                 (make-string (- width (min width label-width)) ?\s)
-                 'display `(space :align-to ,next-x))))
-      (put-text-property opoint (point) 'tabulated-list-column-name name)
-      next-x)))
+    (if hidden x
+      ;; Truncate labels if necessary (except last column).
+      ;; Don't truncate to `width' if the next column is align-right
+      ;; and has some space left, truncate to `available-space' instead.
+      (when (and not-last-col
+	         (> label-width available-space))
+        (setq label (truncate-string-to-width
+		     label available-space nil nil t t)
+	      label-width available-space))
+      (setq label (bidi-string-mark-left-to-right label))
+      (when (and right-align (> width label-width))
+        (let ((shift (- width label-width)))
+          (insert (propertize (make-string shift ?\s)
+                              'display `(space :align-to ,(+ x shift))))
+          (setq width (- width shift))
+          (setq x (+ x shift))))
+      (cond ((stringp col-desc)
+             (insert (if (get-text-property 0 'help-echo label)
+                         label
+                       (propertize label 'help-echo help-echo))))
+            ((eq (car col-desc) 'image)
+             (insert (propertize " "
+                                 'display col-desc
+                                 'help-echo help-echo)))
+            ((apply 'insert-text-button label (cdr col-desc))))
+      (let ((next-x (+ x pad-right width)))
+        ;; No need to append any spaces if this is the last column.
+        (when not-last-col
+          (when (> pad-right 0) (insert (make-string pad-right ?\s)))
+          (insert (propertize
+                   (make-string (- width (min width label-width)) ?\s)
+                   'display `(space :align-to ,next-x))))
+        (put-text-property opoint (point) 'tabulated-list-column-name name)
+        next-x))))
 
 (defun tabulated-list-delete-entry ()
   "Delete the Tabulated List entry at point.
@@ -726,38 +750,16 @@ tabulated-list-widen-current-column
 Interactively, N is the prefix numeric argument, and defaults to
 1."
   (interactive "p")
-  (let ((start (current-column))
-        (entry (tabulated-list-get-entry))
-        (nb-cols (length tabulated-list-format))
-        (col-nb 0)
-        (total-width 0)
-        (found nil)
-        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)))
-                            (let ((desc (aref entry col-nb)))
-                              (string-width (if (stringp desc)
-                                                desc
-                                              (car desc)))))
-                       (or (plist-get (nthcdr 3 (aref tabulated-list-format
-                                                      col-nb))
-                                      :pad-right)
-                           1))))
-          (setq col-nb (1+ col-nb))
-        (setq found t)
-        ;; `tabulated-list-format' may be a constant (sharing list
-        ;; structures), so copy it before mutating.
-        (setq tabulated-list-format (copy-tree tabulated-list-format t))
-        (setf (cadr (aref tabulated-list-format col-nb))
-              (max 1 (+ col-width n)))
-        (tabulated-list-print t)
-        (tabulated-list-init-header)))))
+  (let* ((col-nb (tabulated-list--column-number
+                  (tabulated-list-get-column)))
+         (col-width (cadr (aref tabulated-list-format col-nb))))
+    ;; `tabulated-list-format' may be a constant (sharing list
+    ;; structures), so copy it before mutating.
+    (setq tabulated-list-format (copy-tree tabulated-list-format t))
+    (setf (cadr (aref tabulated-list-format col-nb))
+          (max 1 (+ col-width n)))
+    (tabulated-list-print t)
+    (tabulated-list-init-header)))
 
 (defun tabulated-list-narrow-current-column (&optional n)
   "Narrow the current tabulated list column by N chars.
@@ -766,6 +768,35 @@ tabulated-list-narrow-current-column
   (interactive "p")
   (tabulated-list-widen-current-column (- n)))
 
+(defun tabulated-list-hide-current-column ()
+  "Hide the current tabulated list column."
+  (interactive)
+  (let ((col-nb (tabulated-list--column-number
+                 (tabulated-list-get-column))))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden t)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
+(defun tabulated-list-make-column-visible (name)
+  "Make the tabulated list column NAME visible.
+Interactively, NAME is a hidden column propmted for with
+`completing-read'."
+  (interactive
+   (list
+    (completing-read "Colummn name: "
+                     (append tabulated-list-format nil)
+                     (lambda (col)
+                       (plist-get (nthcdr 3 col) :hidden))
+                     t)))
+  (let ((col-nb (tabulated-list--column-number name)))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden nil)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
 (defun tabulated-list-next-column (&optional arg)
   "Go to the start of the next column after point on the current line.
 If ARG is provided, move that many columns."
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-05 19:58     ` Thuna
@ 2022-09-06 10:07       ` Lars Ingebrigtsen
  2022-09-06 13:59         ` Thuna
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-06 10:07 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

Thuna <thuna.cing@gmail.com> writes:

> This should be all the previous patches merged into a single one.

Thanks.  I've had a skim over the patch, and it seems reasonable to me.
(I haven't tried it, though.)  But what's the use case for this?  I
can't really remember ever wanting to hide a column in a tabulated-list
buffer.

> I don't mind signing the papers, but I have a few questions about it,
> where do I send them?

copyright-clerk@fsf.org is probably the right place to as questions.

But here's the form to get started, if you want to do the assignment:



Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-06 10:07       ` Lars Ingebrigtsen
@ 2022-09-06 13:59         ` Thuna
  2022-09-07  3:23           ` Michael Heerdegen
  2022-09-07 12:42           ` Lars Ingebrigtsen
  0 siblings, 2 replies; 21+ messages in thread
From: Thuna @ 2022-09-06 13:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56345


> Thanks.  I've had a skim over the patch, and it seems reasonable to me.
> (I haven't tried it, though.)  But what's the use case for this?  I
> can't really remember ever wanting to hide a column in a tabulated-list
> buffer.

It's mostly a quality of life improvement.  Horizontal scrolling is a
mess (or at least I can't manage it), and you don't always need to see
all of the columns, so adding a way for the user to control it seemed
reasonable.  Also, when you add a filtering mechanism to your
`tabulated-list-entries' function, some columns can end up redundant,
this would make it convenient to manage situations like that.  (I would
know; that's why I wrote it)





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-06 13:59         ` Thuna
@ 2022-09-07  3:23           ` Michael Heerdegen
  2022-09-07 12:41             ` Lars Ingebrigtsen
  2022-09-07 12:42           ` Lars Ingebrigtsen
  1 sibling, 1 reply; 21+ messages in thread
From: Michael Heerdegen @ 2022-09-07  3:23 UTC (permalink / raw)
  To: Thuna; +Cc: Lars Ingebrigtsen, 56345

Thuna <thuna.cing@gmail.com> writes:

> > Thanks.  I've had a skim over the patch, and it seems reasonable to me.
> > (I haven't tried it, though.)  But what's the use case for this?  I
> > can't really remember ever wanting to hide a column in a tabulated-list
> > buffer.
>
> It's mostly a quality of life improvement.

The "why" is clear (to me), but not so much the "how".  `proced' and
`ibuffer' for example (currently not based on tabulated-list, but they
are also table view modes) allow to define and switch between certain
views, but don't offer commands to explicitly select and delete columns.

So the general idea (ability to leave columns out of the table) is
surely useful, but which interface should be provided to get this is
another question.

Michael.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-07-01 22:43 bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Thuna
  2022-07-02  6:06 ` Eli Zaretskii
  2022-07-02 15:34 ` bug#56345: Typo fix and convenience function Thuna
@ 2022-09-07 10:37 ` Thuna
  2022-09-08  5:57   ` Michael Heerdegen
  2022-10-27 23:12 ` Thuna
  3 siblings, 1 reply; 21+ messages in thread
From: Thuna @ 2022-09-07 10:37 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 56345

> The "why" is clear (to me), but not so much the "how".  `proced' and
> `ibuffer' for example (currently not based on tabulated-list, but they
> are also table view modes) allow to define and switch between certain
> views, but don't offer commands to explicitly select and delete columns.

I don't know how `proced' and `ibuffer' specifically handles views, but
I don't think it is a good idea to put the burden on external packages
when tabulated-list is right there.  Especially since this leads to a
lot of (what I imagine to be) duplicated code across packages.

> So the general idea (ability to leave columns out of the table) is
> surely useful, but which interface should be provided to get this is
> another question.

I don't exactly understand what you mean by "interface".  Are you
referring to the package which should be responsible for managing
which columns are visible?





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07  3:23           ` Michael Heerdegen
@ 2022-09-07 12:41             ` Lars Ingebrigtsen
  2022-09-08  5:53               ` Michael Heerdegen
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-07 12:41 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 56345, Thuna

Michael Heerdegen <michael_heerdegen@web.de> writes:

> The "why" is clear (to me), but not so much the "how".  `proced' and
> `ibuffer' for example (currently not based on tabulated-list, but they
> are also table view modes) allow to define and switch between certain
> views, but don't offer commands to explicitly select and delete columns.
>
> So the general idea (ability to leave columns out of the table) is
> surely useful, but which interface should be provided to get this is
> another question.

I don't understand what you mean here.  That two modes that don't use
tabulated-list don't offer this functionality seems somewhat irrelevant?





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-06 13:59         ` Thuna
  2022-09-07  3:23           ` Michael Heerdegen
@ 2022-09-07 12:42           ` Lars Ingebrigtsen
  2022-09-07 12:50             ` Thuna
  2022-09-07 15:35             ` Drew Adams
  1 sibling, 2 replies; 21+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-07 12:42 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

Thuna <thuna.cing@gmail.com> writes:

> It's mostly a quality of life improvement.  Horizontal scrolling is a
> mess (or at least I can't manage it), and you don't always need to see
> all of the columns, so adding a way for the user to control it seemed
> reasonable.  Also, when you add a filtering mechanism to your
> `tabulated-list-entries' function, some columns can end up redundant,
> this would make it convenient to manage situations like that.  (I would
> know; that's why I wrote it)

OK, I can understand this as being used in a setup function -- but I
doubt that many users would want to interactively want to remove a
column from the current display.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 12:42           ` Lars Ingebrigtsen
@ 2022-09-07 12:50             ` Thuna
  2022-09-07 12:52               ` Lars Ingebrigtsen
  2022-09-07 15:35             ` Drew Adams
  1 sibling, 1 reply; 21+ messages in thread
From: Thuna @ 2022-09-07 12:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56345

> OK, I can understand this as being used in a setup function -- but I
> doubt that many users would want to interactively want to remove a
> column from the current display.

I can't claim to know how many people would want it, but I can give an
example of when it's useful: In the specific package I wrote this patch
for, I list information about youtube videos.  The columns `channel ID'
and `video ID' are vital, but usually unnecessary and take space.  I
have these set in `tabulated-list-format' as hidden by default, so that
the user can choose to see them if they wish to.  Using this, I have to
query for the videos only once, and then tabulated-list-mode decides
what it wants to display on its own.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 12:50             ` Thuna
@ 2022-09-07 12:52               ` Lars Ingebrigtsen
  2022-11-25  1:26                 ` Stefan Kangas
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-07 12:52 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

Thuna <thuna.cing@gmail.com> writes:

> I can't claim to know how many people would want it, but I can give an
> example of when it's useful: In the specific package I wrote this patch
> for, I list information about youtube videos.  The columns `channel ID'
> and `video ID' are vital, but usually unnecessary and take space.  I
> have these set in `tabulated-list-format' as hidden by default, so that
> the user can choose to see them if they wish to.  Using this, I have to
> query for the videos only once, and then tabulated-list-mode decides
> what it wants to display on its own.

Oh, OK, that makes sense.  Then I think this sounds like a good
addition (but we have to wait for the assignment to be processed to
apply the patch).






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 12:42           ` Lars Ingebrigtsen
  2022-09-07 12:50             ` Thuna
@ 2022-09-07 15:35             ` Drew Adams
  1 sibling, 0 replies; 21+ messages in thread
From: Drew Adams @ 2022-09-07 15:35 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Thuna; +Cc: 56345@debbugs.gnu.org

> I doubt that many users would want to interactively
> want to remove a column from the current display.

(Not really following this thread... and not a real
fan of `tabulated-list-mode', which is anyway too
limited/restrictive...)

Why the doubt?

Of course some users would sometimes want to
interactively remove a column from the current
display.  Why wouldn't they?  That seems like a
no-brainer to me.  Think Dired/ls, or the bookmark
list (toggle showing file names).  

Why would users want to be able to sort columns
but not also be able to move them around or
hide/remove them, including interactively?

OK, you said "many users".  There's room for lots
of doubt about anything in Emacs, if the qualifier
"many" is applied.  Whether being able to hide
columns interactively is a useful feature for
Emacs to add shouldn't depend on whether "many"
users would likely use it.  Not if someone is
willing to add that feature.  Why not?





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 12:41             ` Lars Ingebrigtsen
@ 2022-09-08  5:53               ` Michael Heerdegen
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Heerdegen @ 2022-09-08  5:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56345, Thuna

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I don't understand what you mean here.  That two modes that don't use
> tabulated-list don't offer this functionality seems somewhat irrelevant?

They provide a different way to solve the same task (views; restricting
displayed columns) - that's why I ask if tabulated-list should implement
this functionality, additionally or alternatively, since it's very
similar.

Michael.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 10:37 ` Thuna
@ 2022-09-08  5:57   ` Michael Heerdegen
  2022-09-08 18:14     ` Jean Louis
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Heerdegen @ 2022-09-08  5:57 UTC (permalink / raw)
  To: Thuna; +Cc: 56345

Thuna <thuna.cing@gmail.com> writes:

> I don't know how `proced' and `ibuffer' specifically handles views, but
> I don't think it is a good idea to put the burden on external packages
> when tabulated-list is right there.  Especially since this leads to a
> lot of (what I imagine to be) duplicated code across packages.

Exactly.  tabulated-list should implement this feature.

> I don't exactly understand what you mean by "interface".  Are you
> referring to the package which should be responsible for managing
> which columns are visible?

No, I mean, how should column hiding happen?  Should the user select
single columns interactively, or should we provide a way to define
restricted views?  Maybe we can have both?

Michael.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-08  5:57   ` Michael Heerdegen
@ 2022-09-08 18:14     ` Jean Louis
  0 siblings, 0 replies; 21+ messages in thread
From: Jean Louis @ 2022-09-08 18:14 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 56345, Thuna

* Michael Heerdegen <michael_heerdegen@web.de> [2022-09-08 08:59]:
> Thuna <thuna.cing@gmail.com> writes:
> 
> > I don't know how `proced' and `ibuffer' specifically handles views, but
> > I don't think it is a good idea to put the burden on external packages
> > when tabulated-list is right there.  Especially since this leads to a
> > lot of (what I imagine to be) duplicated code across packages.
> 
> Exactly.  tabulated-list should implement this feature.
> 
> > I don't exactly understand what you mean by "interface".  Are you
> > referring to the package which should be responsible for managing
> > which columns are visible?
> 
> No, I mean, how should column hiding happen?  Should the user select
> single columns interactively, or should we provide a way to define
> restricted views?  Maybe we can have both?

It seems to me complex to hide columns as one would need to manipulated:

- tabulated-list-format

and

- tabulated-list-entries

One way to go would be:

1. Remember original format

2. Generate new format with column hidden

3. Remember original tabulated-list-entries

4. Modify tabulated-list-entries to remove the column

5. Refresh buffer

6. Revealing columns should restore original variables


Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-07-01 22:43 bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Thuna
                   ` (2 preceding siblings ...)
  2022-09-07 10:37 ` Thuna
@ 2022-10-27 23:12 ` Thuna
  3 siblings, 0 replies; 21+ messages in thread
From: Thuna @ 2022-10-27 23:12 UTC (permalink / raw)
  To: 56345

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

I fixed and improved a couple things (though the assignment is still
pending).  Namely, the commands are actually bound in
`tabulated-list-mode-map' and the command
`tabulated-list-make-column-visible' is renamed to
`tabulated-list-unhide-column'.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: The new and improved patch --]
[-- Type: text/x-patch, Size: 16878 bytes --]

From 97e8d9e0dcc41bd32112072e0ff47ae703792378 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Tue, 11 Oct 2022 22:17:15 +0200
Subject: [PATCH] Add column hiding to tabulated-list-mode

Add the keyword `:hidden' to `tabulated-list-format' for controlling
the visibility of a specific column.

Introduce the commands `tabulated-list-hide-current-column' and
`tabulated-list-unhide-column' for interactively changing the
`:hidden' property of the column.  The commands are bound to "." and
"+" respectively.

Change calculations involving other columns to account for the
`:hidden' property.

Make the current column calculation into its own function named
`tabulated-list-get-column'.  Make `tabulated-list-widen-current-column'
use that instead. Use the text property `tabulated-list-column-name'
to find the current tabulated-list column instead of `current-column'.
---
 lisp/emacs-lisp/tabulated-list.el | 273 +++++++++++++++++-------------
 1 file changed, 153 insertions(+), 120 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index c01f3fd4fe..d86f4de5f5 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -104,7 +104,8 @@ tabulated-list-format
    Currently supported properties are:
    - `:right-align': If non-nil, the column should be right-aligned.
    - `:pad-right': Number of additional padding spaces to the
-     right of the column (defaults to 1 if omitted).")
+     right of the column (defaults to 1 if omitted).
+   - `:hidden': If non-nil, the column should not be visible.")
 (put 'tabulated-list-format 'permanent-local t)
 
 (defvar-local tabulated-list-use-header-line t
@@ -179,6 +180,11 @@ tabulated-list-get-entry
 no entry at POS.  POS, if omitted or nil, defaults to point."
   (get-text-property (or pos (point)) 'tabulated-list-entry))
 
+(defun tabulated-list-get-column (&optional pos)
+  "Return the column name of the Tabulated List cell at POS.
+POS, if omitted or nil, defaults to point."
+  (get-text-property (or pos (point)) 'tabulated-list-column-name))
+
 (defun tabulated-list-put-tag (tag &optional advance)
   "Put TAG in the padding area of the current line.
 TAG should be a string, with length <= `tabulated-list-padding'.
@@ -227,6 +233,8 @@ tabulated-list-mode-map
   "S"             #'tabulated-list-sort
   "}"             #'tabulated-list-widen-current-column
   "{"             #'tabulated-list-narrow-current-column
+  "."             #'tabulated-list-hide-current-column
+  "+"             #'tabulated-list-unhide-column
   "<follow-link>" 'mouse-face
   "<mouse-2>"     #'mouse-select-window)
 
@@ -285,7 +293,7 @@ tabulated-list-init-header
           cols)
     (dotimes (n len)
       (let* ((col (aref tabulated-list-format n))
-             (not-last-col (< n (1- len)))
+             (not-last-col (tabulated-list--next-visible-column n))
 	     (label (nth 0 col))
              (lablen (length label))
              (pname label)
@@ -293,62 +301,64 @@ tabulated-list-init-header
 	     (props (nthcdr 3 col))
 	     (pad-right (or (plist-get props :pad-right) 1))
              (right-align (plist-get props :right-align))
+             (hidden (plist-get props :hidden))
              (next-x (+ x pad-right width))
              (available-space
               (and not-last-col
                    (if right-align
                        width
                      (tabulated-list--available-space width n)))))
-        (when (and (>= lablen 3)
-                   not-last-col
-                   (> lablen available-space))
-          (setq label (truncate-string-to-width label available-space
-                                                nil nil t)))
-	(push
-	 (cond
-	  ;; An unsortable column
-	  ((not (nth 2 col))
-	   (propertize label 'tabulated-list-column-name pname))
-	  ;; The selected sort column
-	  ((equal (car col) (car tabulated-list-sort-key))
-	   (apply 'propertize
-                  (concat label
-                          (cond
-                           ((and (< lablen 3) not-last-col) "")
-                           ((cdr tabulated-list-sort-key)
-                            (format " %c"
-                                    tabulated-list-gui-sort-indicator-desc))
-                           (t (format " %c"
-                                      tabulated-list-gui-sort-indicator-asc))))
-                  'face 'bold
-                  'tabulated-list-column-name pname
-                  button-props))
-	  ;; Unselected sortable column.
-	  (t (apply 'propertize label
-		    'tabulated-list-column-name pname
-		    button-props)))
-	 cols)
-        (when right-align
-          (let ((shift (- width (string-width (car cols)))))
-            (when (> shift 0)
-              (setq cols
-                    (cons (car cols)
-                          (cons
-                           (propertize
-                            (make-string shift ?\s)
-                            'display
-                            `(space :align-to
-                                    (+ header-line-indent-width ,(+ x shift))))
-                           (cdr cols))))
-              (setq x (+ x shift)))))
-	(if (>= pad-right 0)
-	    (push (propertize
-                   " "
-		   'display `(space :align-to
-                                    (+ header-line-indent-width ,next-x))
-		   'face 'fixed-pitch)
-		  cols))
-        (setq x next-x)))
+        (unless hidden
+          (when (and (>= lablen 3)
+                     not-last-col
+                     (> lablen available-space))
+            (setq label (truncate-string-to-width label available-space
+                                                  nil nil t)))
+	  (push
+	   (cond
+	    ;; An unsortable column
+	    ((not (nth 2 col))
+	     (propertize label 'tabulated-list-column-name pname))
+	    ;; The selected sort column
+	    ((equal (car col) (car tabulated-list-sort-key))
+	     (apply 'propertize
+                    (concat label
+                            (cond
+                             ((and (< lablen 3) not-last-col) "")
+                             ((cdr tabulated-list-sort-key)
+                              (format " %c"
+                                      tabulated-list-gui-sort-indicator-desc))
+                             (t (format " %c"
+                                        tabulated-list-gui-sort-indicator-asc))))
+                    'face 'bold
+                    'tabulated-list-column-name pname
+                    button-props))
+	    ;; Unselected sortable column.
+	    (t (apply 'propertize label
+		      'tabulated-list-column-name pname
+		      button-props)))
+	   cols)
+          (when right-align
+            (let ((shift (- width (string-width (car cols)))))
+              (when (> shift 0)
+                (setq cols
+                      (cons (car cols)
+                            (cons
+                             (propertize
+                              (make-string shift ?\s)
+                              'display
+                              `(space :align-to
+                                      (+ header-line-indent-width ,(+ x shift))))
+                             (cdr cols))))
+                (setq x (+ x shift)))))
+	  (if (>= pad-right 0)
+	      (push (propertize
+                     " "
+		     'display `(space :align-to
+                                      (+ header-line-indent-width ,next-x))
+		     'face 'fixed-pitch)
+		    cols))
+          (setq x next-x))))
     (setq cols (apply 'concat (nreverse cols)))
     (if tabulated-list-use-header-line
 	(setq header-line-format (list "" 'header-line-indent cols))
@@ -530,15 +540,29 @@ tabulated-list-print-entry
      beg (point)
      `(tabulated-list-id ,id tabulated-list-entry ,cols))))
 
+(defun tabulated-list--next-visible-column (n)
+  (let ((len (length tabulated-list-format))
+        (col-nb (1+ n))
+        found)
+    (while (and (< col-nb len)
+                (not found))
+      (if (plist-get (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden)
+          (setq col-nb (1+ col-nb))
+        (setq found t)))
+    (when (< col-nb len)
+      col-nb)))
+
 (defun tabulated-list--available-space (width n)
-  (let* ((next-col-format (aref tabulated-list-format (1+ n)))
+  (let* ((next-col (tabulated-list--next-visible-column n))
+         (next-col-format (aref tabulated-list-format next-col))
          (next-col-right-align (plist-get (nthcdr 3 next-col-format)
                                           :right-align))
          (next-col-width (nth 1 next-col-format)))
     (if next-col-right-align
         (- (+ width next-col-width)
            (min next-col-width
-                (tabulated-list--col-local-max-widths (1+ n))))
+                (tabulated-list--col-local-max-widths next-col)))
       width)))
 
 (defun tabulated-list-print-col (n col-desc x)
@@ -552,50 +576,52 @@ tabulated-list-print-col
 	 (props     (nthcdr 3 format))
 	 (pad-right (or (plist-get props :pad-right) 1))
          (right-align (plist-get props :right-align))
+         (hidden (plist-get props :hidden))
          (label (cond ((stringp col-desc) col-desc)
                       ((eq (car col-desc) 'image) " ")
                       (t (car col-desc))))
          (label-width (string-width label))
 	 (help-echo (concat (car format) ": " label))
 	 (opoint (point))
-	 (not-last-col (< (1+ n) (length tabulated-list-format)))
+	 (not-last-col (tabulated-list--next-visible-column n))
 	 (available-space (and not-last-col
                                (if right-align
                                    width
                                  (tabulated-list--available-space width n)))))
-    ;; Truncate labels if necessary (except last column).
-    ;; Don't truncate to `width' if the next column is align-right
-    ;; and has some space left, truncate to `available-space' instead.
-    (when (and not-last-col
-	       (> label-width available-space))
-      (setq label (truncate-string-to-width
-		   label available-space nil nil t t)
-	    label-width available-space))
-    (setq label (bidi-string-mark-left-to-right label))
-    (when (and right-align (> width label-width))
-      (let ((shift (- width label-width)))
-        (insert (propertize (make-string shift ?\s)
-                            'display `(space :align-to ,(+ x shift))))
-        (setq width (- width shift))
-        (setq x (+ x shift))))
-    (cond ((stringp col-desc)
-           (insert (if (get-text-property 0 'help-echo label)
-                       label
-                     (propertize label 'help-echo help-echo))))
-          ((eq (car col-desc) 'image)
-           (insert (propertize " "
-                               'display col-desc
-                               'help-echo help-echo)))
-          ((apply 'insert-text-button label (cdr col-desc))))
-    (let ((next-x (+ x pad-right width)))
-      ;; No need to append any spaces if this is the last column.
-      (when not-last-col
-        (when (> pad-right 0) (insert (make-string pad-right ?\s)))
-        (insert (propertize
-                 (make-string (- width (min width label-width)) ?\s)
-                 'display `(space :align-to ,next-x))))
-      (put-text-property opoint (point) 'tabulated-list-column-name name)
-      next-x)))
+    (if hidden x
+      ;; Truncate labels if necessary (except last column).
+      ;; Don't truncate to `width' if the next column is align-right
+      ;; and has some space left, truncate to `available-space' instead.
+      (when (and not-last-col
+	         (> label-width available-space))
+        (setq label (truncate-string-to-width
+		     label available-space nil nil t t)
+	      label-width available-space))
+      (setq label (bidi-string-mark-left-to-right label))
+      (when (and right-align (> width label-width))
+        (let ((shift (- width label-width)))
+          (insert (propertize (make-string shift ?\s)
+                              'display `(space :align-to ,(+ x shift))))
+          (setq width (- width shift))
+          (setq x (+ x shift))))
+      (cond ((stringp col-desc)
+             (insert (if (get-text-property 0 'help-echo label)
+                         label
+                       (propertize label 'help-echo help-echo))))
+            ((eq (car col-desc) 'image)
+             (insert (propertize " "
+                                 'display col-desc
+                                 'help-echo help-echo)))
+            ((apply 'insert-text-button label (cdr col-desc))))
+      (let ((next-x (+ x pad-right width)))
+        ;; No need to append any spaces if this is the last column.
+        (when not-last-col
+          (when (> pad-right 0) (insert (make-string pad-right ?\s)))
+          (insert (propertize
+                   (make-string (- width (min width label-width)) ?\s)
+                   'display `(space :align-to ,next-x))))
+        (put-text-property opoint (point) 'tabulated-list-column-name name)
+        next-x))))
 
 (defun tabulated-list-delete-entry ()
   "Delete the Tabulated List entry at point.
@@ -726,38 +752,16 @@ tabulated-list-widen-current-column
 Interactively, N is the prefix numeric argument, and defaults to
 1."
   (interactive "p")
-  (let ((start (current-column))
-        (entry (tabulated-list-get-entry))
-        (nb-cols (length tabulated-list-format))
-        (col-nb 0)
-        (total-width 0)
-        (found nil)
-        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)))
-                            (let ((desc (aref entry col-nb)))
-                              (string-width (if (stringp desc)
-                                                desc
-                                              (car desc)))))
-                       (or (plist-get (nthcdr 3 (aref tabulated-list-format
-                                                      col-nb))
-                                      :pad-right)
-                           1))))
-          (setq col-nb (1+ col-nb))
-        (setq found t)
-        ;; `tabulated-list-format' may be a constant (sharing list
-        ;; structures), so copy it before mutating.
-        (setq tabulated-list-format (copy-tree tabulated-list-format t))
-        (setf (cadr (aref tabulated-list-format col-nb))
-              (max 1 (+ col-width n)))
-        (tabulated-list-print t)
-        (tabulated-list-init-header)))))
+  (let* ((col-nb (tabulated-list--column-number
+                  (tabulated-list-get-column)))
+         (col-width (cadr (aref tabulated-list-format col-nb))))
+    ;; `tabulated-list-format' may be a constant (sharing list
+    ;; structures), so copy it before mutating.
+    (setq tabulated-list-format (copy-tree tabulated-list-format t))
+    (setf (cadr (aref tabulated-list-format col-nb))
+          (max 1 (+ col-width n)))
+    (tabulated-list-print t)
+    (tabulated-list-init-header)))
 
 (defun tabulated-list-narrow-current-column (&optional n)
   "Narrow the current tabulated list column by N chars.
@@ -766,6 +770,35 @@ tabulated-list-narrow-current-column
   (interactive "p")
   (tabulated-list-widen-current-column (- n)))
 
+(defun tabulated-list-hide-current-column ()
+  "Hide the current tabulated list column."
+  (interactive)
+  (let ((col-nb (tabulated-list--column-number
+                 (tabulated-list-get-column))))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden t)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
+(defun tabulated-list-unhide-column (name)
+  "Make the tabulated list column NAME visible.
+Interactively, NAME is a hidden column propmted for with
+`completing-read'."
+  (interactive
+   (list
+    (completing-read "Colummn name: "
+                     (append tabulated-list-format nil)
+                     (lambda (col)
+                       (plist-get (nthcdr 3 col) :hidden))
+                     t)))
+  (let ((col-nb (tabulated-list--column-number name)))
+    (setf (nthcdr 3 (aref tabulated-list-format col-nb))
+          (plist-put (nthcdr 3 (aref tabulated-list-format col-nb))
+                     :hidden nil)))
+  (tabulated-list-init-header)
+  (tabulated-list-print t t))
+
 (defun tabulated-list-next-column (&optional arg)
   "Go to the start of the next column after point on the current line.
 If ARG is provided, move that many columns."
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-09-07 12:52               ` Lars Ingebrigtsen
@ 2022-11-25  1:26                 ` Stefan Kangas
  2022-11-25  7:58                   ` Thuna
  2022-11-25  8:17                   ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: Stefan Kangas @ 2022-11-25  1:26 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56345, Thuna

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Thuna <thuna.cing@gmail.com> writes:
>
>> I can't claim to know how many people would want it, but I can give an
>> example of when it's useful: In the specific package I wrote this patch
>> for, I list information about youtube videos.  The columns `channel ID'
>> and `video ID' are vital, but usually unnecessary and take space.  I
>> have these set in `tabulated-list-format' as hidden by default, so that
>> the user can choose to see them if they wish to.  Using this, I have to
>> query for the videos only once, and then tabulated-list-mode decides
>> what it wants to display on its own.
>
> Oh, OK, that makes sense.  Then I think this sounds like a good
> addition (but we have to wait for the assignment to be processed to
> apply the patch).

What's the status on the copyright assignment?





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-11-25  1:26                 ` Stefan Kangas
@ 2022-11-25  7:58                   ` Thuna
  2022-11-25  8:17                   ` Eli Zaretskii
  1 sibling, 0 replies; 21+ messages in thread
From: Thuna @ 2022-11-25  7:58 UTC (permalink / raw)
  To: Stefan Kangas, Lars Ingebrigtsen; +Cc: 56345

> What's the status on the copyright assignment?
I believe FSF should currently be negotiating for a disclaimer.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list
  2022-11-25  1:26                 ` Stefan Kangas
  2022-11-25  7:58                   ` Thuna
@ 2022-11-25  8:17                   ` Eli Zaretskii
  1 sibling, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2022-11-25  8:17 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: larsi, thuna.cing, 56345

> Cc: 56345@debbugs.gnu.org, Thuna <thuna.cing@gmail.com>
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Thu, 24 Nov 2022 17:26:25 -0800
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
> > Oh, OK, that makes sense.  Then I think this sounds like a good
> > addition (but we have to wait for the assignment to be processed to
> > apply the patch).
> 
> What's the status on the copyright assignment?

I don't see anything pertinent on file.  I don't even think I've seen the
beginning of the paperwork in my email (I'm cc'ed on those messages).





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-11-25  8:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 22:43 bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Thuna
2022-07-02  6:06 ` Eli Zaretskii
2022-07-02 15:34 ` bug#56345: Typo fix and convenience function Thuna
2022-09-05 19:31   ` bug#56345: 29.0.50; [PATCH] Add column hiding to tabulated-list Lars Ingebrigtsen
2022-09-05 19:58     ` Thuna
2022-09-06 10:07       ` Lars Ingebrigtsen
2022-09-06 13:59         ` Thuna
2022-09-07  3:23           ` Michael Heerdegen
2022-09-07 12:41             ` Lars Ingebrigtsen
2022-09-08  5:53               ` Michael Heerdegen
2022-09-07 12:42           ` Lars Ingebrigtsen
2022-09-07 12:50             ` Thuna
2022-09-07 12:52               ` Lars Ingebrigtsen
2022-11-25  1:26                 ` Stefan Kangas
2022-11-25  7:58                   ` Thuna
2022-11-25  8:17                   ` Eli Zaretskii
2022-09-07 15:35             ` Drew Adams
2022-09-07 10:37 ` Thuna
2022-09-08  5:57   ` Michael Heerdegen
2022-09-08 18:14     ` Jean Louis
2022-10-27 23:12 ` Thuna

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.