From: Thuna <thuna.cing@gmail.com>
To: 56345@debbugs.gnu.org
Subject: bug#56345: Typo fix and convenience function
Date: Sat, 02 Jul 2022 18:34:29 +0300 [thread overview]
Message-ID: <877d4vfrzu.fsf@gmail.com> (raw)
In-Reply-To: <87r134ihdd.fsf@gmail.com>
[-- 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
next prev parent reply other threads:[~2022-07-02 15:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-09-05 19:31 ` 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877d4vfrzu.fsf@gmail.com \
--to=thuna.cing@gmail.com \
--cc=56345@debbugs.gnu.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 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.