From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thuna Newsgroups: gmane.emacs.bugs Subject: bug#56345: Typo fix and convenience function Date: Sat, 02 Jul 2022 18:34:29 +0300 Message-ID: <877d4vfrzu.fsf@gmail.com> References: <87r134ihdd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11170"; mail-complaints-to="usenet@ciao.gmane.io" To: 56345@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 02 17:35:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7f9a-0002iw-D7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 17:35:26 +0200 Original-Received: from localhost ([::1]:46064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7f9Z-0000bn-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 11:35:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7f9D-0000Yd-A7 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 11:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7f9D-00044z-13 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 11:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7f9C-0006Ri-Tj for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 11:35:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r134ihdd.fsf@gmail.com> Resent-From: Thuna Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2022 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56345 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56345-submit@debbugs.gnu.org id=B56345.165677608224733 (code B ref 56345); Sat, 02 Jul 2022 15:35:02 +0000 Original-Received: (at 56345) by debbugs.gnu.org; 2 Jul 2022 15:34:42 +0000 Original-Received: from localhost ([127.0.0.1]:42579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7f8s-0006Qr-5x for submit@debbugs.gnu.org; Sat, 02 Jul 2022 11:34:42 -0400 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:38577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7f8o-0006Qb-Sm for 56345@debbugs.gnu.org; Sat, 02 Jul 2022 11:34:40 -0400 Original-Received: by mail-ed1-f53.google.com with SMTP id fd6so6300164edb.5 for <56345@debbugs.gnu.org>; Sat, 02 Jul 2022 08:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=I9k0jg8PayCXc+64aq5F4u5LLIPvz7z+gf1eDkmrFvs=; b=Ufj/gL3a+jkqWpxHB+ozZ5pQ+WO/uBd/xF8fSTG5eQnSJ70ZLh3zjtdj3NekTFKs6a 4ADwbiaFgc+TbXaG58P0KPAH5khirm8LpxxVefq8sY4mpYEf8f8sDoQaSQ+uJipxsQa+ VHjMjdo2hD42ihOROlNNPwD5YECBDPTLx0stXu4yduoC8JxUUNDm3WF4n53WGIMs8ziU cbEKndUeSQbkRgmn5n6GFtX9e/1AnO2wXFgi2d6yJ4P6evLDIWrXnTN3wGhfLU5eFMD4 NxscDLZGIv4sPYM42pGuQg8P/ewA6SEBcKoriJYC1zt7ZMjsODwQeFo/kHGOpcCddIGk mWmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=I9k0jg8PayCXc+64aq5F4u5LLIPvz7z+gf1eDkmrFvs=; b=04ndXkSeZSfoMv2DbH5W/05I28734xciOscRO3ys3gAg8lZzdx22ahYAnj28luuuVW UkzBJhzUo6Wgk89GVNaTI9bSmoD6DriUKFKvYZN0X3c5JPzLthuHKRS+f7XgI2XrhIcq qTq1h+3w2FI78wtBQgKqZt47CCc0mkBMguw9n/hqGaAicVTGcCQWLkJu4j6rbIVrsNI1 26bsifMrYa14SeopyRlicAlq6lnW//RyyWtr48nze8GLyL95fuhi+JGIz10++0AfqQUm Xp8Qr5t9wO0emzGkPbOSzP/EY0yBBI9YR+bvx5jiE+a5Px6ugWbmffkDOcnrTZnJPxVs K+tw== X-Gm-Message-State: AJIora/ugb3edK4K1MfIQTyhk0AtKX2/I4EwK2zWPf9EjJfk5KWrR166 RAttQSh4VjQrCl+6ICTWoCxhSKYgLy8pHyWU X-Google-Smtp-Source: AGRyM1uZOQnTdWn1QIl9yRfybhlqgo67bTN150kElH4RSn+e+QAQcjC7OEe9cJfzSBics5EHA/8XKA== X-Received: by 2002:aa7:d795:0:b0:435:7fc8:2d1b with SMTP id s21-20020aa7d795000000b004357fc82d1bmr25898168edq.201.1656776072399; Sat, 02 Jul 2022 08:34:32 -0700 (PDT) Original-Received: from thuna ([85.106.112.123]) by smtp.gmail.com with ESMTPSA id o16-20020aa7d3d0000000b00437ce7fe1a0sm7072444edr.8.2022.07.02.08.34.30 for <56345@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 08:34:31 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235920 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Fix-typos-in-tabulated-list-make-column-visible.patch Content-Description: typo fix >From c96ab25defb31fc596818a39e1a632dd09e2cc72 Mon Sep 17 00:00:00 2001 From: Thuna 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-Allow-interactive-hiding-of-a-specific-column-in-tab.patch Content-Description: hide column by name >From 6198fb2b57a9c8267d86baac40406d05ef62eb2a Mon Sep 17 00:00:00 2001 From: Thuna 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 --=-=-=--