From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69305: outline-minor-mode for tabulated-list-mode Date: Fri, 23 Feb 2024 10:13:02 +0200 Message-ID: <86edd31tv5.fsf@gnu.org> References: <86msrtvi06.fsf@mail.linkov.net> <86frxlmy1d.fsf@gnu.org> <86cyspt02f.fsf@mail.linkov.net> <861q94nc4j.fsf@gnu.org> <867ciws983.fsf@mail.linkov.net> <86plwo1fii.fsf@gnu.org> <86il2fwuc8.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69305@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 23 09:13:56 2024 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 1rdQgt-0008OZ-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Feb 2024 09:13:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdQgf-0005ZV-HW; Fri, 23 Feb 2024 03:13:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdQgd-0005Z3-Eq for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 03:13:39 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdQgd-0002W7-5o for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 03:13:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdQh0-0003Ve-04 for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 03:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Feb 2024 08:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69305 X-GNU-PR-Package: emacs Original-Received: via spool by 69305-submit@debbugs.gnu.org id=B69305.170867601713430 (code B ref 69305); Fri, 23 Feb 2024 08:14:01 +0000 Original-Received: (at 69305) by debbugs.gnu.org; 23 Feb 2024 08:13:37 +0000 Original-Received: from localhost ([127.0.0.1]:48955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdQga-0003UY-UK for submit@debbugs.gnu.org; Fri, 23 Feb 2024 03:13:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdQgY-0003UH-GT for 69305@debbugs.gnu.org; Fri, 23 Feb 2024 03:13:35 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdQg5-0002Ik-Hl; Fri, 23 Feb 2024 03:13:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DGTYBgN4vfqTtRIdcuojTSZQ7KZN1GaMNsEVkawrm6w=; b=pvRqarj/sxrn IYRUWp+nNPtKnOSblmnFhyWbDX7RN/8ko6cpacMXMF1jluzHyi6hDiVxwzd0TBSLQyGGl9NcYL+sj i/bgrxiPezhydnLis4g3ZYmj/j0ssWXIf4DoGIw6FZxoK3sgcCJkH8mFfpQQ/YyamxEE3bBhHXHbG cC5r6UdholUO70MbBHmTUusoQzi8qEl09BERY6xR4xOT0EmBlCPlFhx2j5bQ1DSiRX96Rozcq/+JC ZV4rVEGERzHR3em0X8LoMkQEcy4lPZaXIbsrdmBRyaLOrh223+d/U9obMuzhoZ8avAiwPtMhBwOaU 64Y9pXrN+ZFsDBwT/WI2jg==; In-Reply-To: <86il2fwuc8.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 23 Feb 2024 09:09:03 +0200) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280486 Archived-At: > From: Juri Linkov > Cc: 69305@debbugs.gnu.org > Date: Fri, 23 Feb 2024 09:09:03 +0200 > > >> >> +@defvar tabulated-list-groups > >> >> +This buffer-local variable specifies the groups of entries displayed in > >> >> +the Tabulated List buffer. Its value should be either a list, or a > >> >> +function. > >> >> + > >> >> +If the value is a list, each list element corresponds to one group, and > >> >> +should have the form @w{@code{(@var{group-name} @var{entries})}}, where > >> >> +@var{group-name} is a string inserted before all group entries, and > >> >> +@var{entries} have the same format as @code{tabulated-list-entries} > >> >> +(see above). > >> >> + > >> >> +Otherwise, the value should be a function which returns a list of the > >> >> +above form when called with no arguments. > >> >> +@end defvar > >> > > >> > I think the way to specify ENTRIES for this customization should be > >> > described in more detail. Reading the above description, even the > >> > idea of using ENTRIES for specifying grouping is unclear, since > >> > tabulated-list-entries is basically just a list of column descriptors. > >> > >> But ENTRIES are described in 'tabulated-list-entries'. Here ENTRIES > >> are no different from 'tabulated-list-entries' that are just > >> column descriptors. > > > > My point is that it isn't obvious how to describe grouping in terms of > > column descriptors. I think the manual should tell in more detail how > > to use column descriptors to specify how entries should be grouped. > > Maybe an example or two is all that it takes to do that. > > Sorry, I don't understand what is unclear here: > > If the value is a list, each list element corresponds to one group, and > should have the form @w{@code{(@var{group-name} @var{entries})}}, where > @var{group-name} is a string inserted before all group entries, and > @var{entries} have the same format as @code{tabulated-list-entries} > (see above). > > Basically this says that the format is (group-name entries) where > entries are described in tabulated-list-entries as having the format > (id contents). There is no need to duplicate the description of entries. Maybe I'm missing something here. To put it more concretely, can you show a value of tabulated-list-groups that will cause the buffers in buffer list grouped by major mode using the above form? > >> >> +(ert-deftest tabulated-list-groups () > >> >> + (with-temp-buffer > >> >> + (tabulated-list-mode) > >> >> + (setq tabulated-list-groups > >> >> + (reverse > >> >> + (seq-group-by (lambda (b) (concat "* " (aref (cadr b) 3))) > >> >> + tabulated-list--test-entries))) > >> >> + (setq tabulated-list-format tabulated-list--test-format) > >> >> + (setq tabulated-list-padding 7) > >> >> + (tabulated-list-init-header) > >> >> + (tabulated-list-print) > >> > > >> > This seems to test only the function value of tabulated-list-groups? > >> > What about the other form of the value? > >> > >> The other forms have no functional difference. > > > > Sorry, I don't follow. Shouldn't we test the capability of specifying > > grouping by the method other than by providing a function? > > Actually there are no other methods. The doc string says the "value can be either a list or a function". I see only one value here, so I'm asking what about a value of the other form. Or what am I missing here?