From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Seeking advice on writing a "line-based" major mode Date: Thu, 18 Jun 2015 12:50:12 -0700 (PDT) Message-ID: <633caaaf-5c11-4dc3-98aa-aa3e6e1529b3@default> References: <87wpzf9q38.fsf@mbork.pl> <2687fb9a-c314-4cf4-8c8a-d959e886ed14@default> <87fv5p30ff.fsf@mbork.pl> <894f3596-e513-4f5a-ba0b-f5638be50f9d@default> <87616k3lbt.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1434657056 3810 80.91.229.3 (18 Jun 2015 19:50:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jun 2015 19:50:56 +0000 (UTC) To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 18 21:50:44 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z5fpf-0002yA-GO for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jun 2015 21:50:39 +0200 Original-Received: from localhost ([::1]:54695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fpe-00032x-Vf for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jun 2015 15:50:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fpP-0002u6-99 for help-gnu-emacs@gnu.org; Thu, 18 Jun 2015 15:50:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5fpM-0006vN-26 for help-gnu-emacs@gnu.org; Thu, 18 Jun 2015 15:50:23 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:49777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fpL-0006um-SH for help-gnu-emacs@gnu.org; Thu, 18 Jun 2015 15:50:19 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t5IJoGDC024986 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Jun 2015 19:50:16 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5IJoGdr012790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 18 Jun 2015 19:50:16 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t5IJoArV009243; Thu, 18 Jun 2015 19:50:15 GMT In-Reply-To: <87616k3lbt.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105041 Archived-At: Thanks for providing more info. > 1. EWOC has built-in support for checking which entry the point is > on. I didn't find anything like that in tabulated-list-mode. Not sure what you mean, but that sounds like `tabulated-list-get-entry': Return the Tabulated List entry at POS. ... defaults to point. or depending on what you mean, perhaps `tabulated-list-get-id': Return the entry ID of the Tabulated List entry at POS. ... defaults to point. > 2. EWOC seems to be more flexible wrt the format of the entries. In > my use case, each entry is a large-ish alist, converted from json by > json-read, and most of the entries in it should not show up at all. So you want to show only some of each alist entry. `tabulated-list-print' calls the printer function specified by `tabulated-list-printer', once for each entry. The default printer is `tabulated-list-print-entry', but a mode that keeps data in an ewoc may instead specify a printer function (e.g., one that calls `ewoc-enter-last'), with `tabulated-list-print-entry' as the ewoc pretty-printer. and `tabulated-list-entries': If a list, each element has the form (ID [DESC1 ... DESCN]) =20 or it can be a function that returns such a list. In your case, one of the DESC would presumably be your alist value, formatted to show only some of it. I know very little about EWOC, but so far I don't really see what more it offers here. (Not that I need to. The info you provide is anyway helpful.)=20 > I's also want to be able to do sorting based on more than one > column Same here. That would be a useful addition to `tabulated-list-mode'. > So basically, while the differences are significant, both tools > could do the job - it just happens that EWOC has the parts I didn't > want to code myself already done. Understood (though it's not clear to me what those parts are). > BTW, be assured that when I finish my tool (or at least get to > a production-ready beta, which seems quite close), I'll write a blog > post (or a few) about it, and put the code on the net somewhere. Thx.=20