help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Seeking advice on writing a "line-based" major mode


From: Drew Adams
Subject: RE: Seeking advice on writing a "line-based" major mode
Date: Thu, 18 Jun 2015 14:28:19 -0700 (PDT)

> > `tabulated-list-get-entry':
> >   Return the Tabulated List entry at POS...
> > `tabulated-list-get-id':
> >   Return the entry ID of the Tabulated List entry at POS...
> 
> Cool.  Neither is mentioned in the Info manual, though...

If you think it is important/useful, consider filing a doc bug:
`M-x report-emacs-bug'.

> So it seems that the main advantage of EWOC is better (i.e., more
> comprehensive) manual...

If you think so: `M-x report-emacs-bug'.

> >> 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).
> 
> Maily the get-item-at-point, which t-l-m seems to have, too...
> Also, the sorting stuff, though this is not really relevant: I presume
> that with t-l-m, I could do sorting "manually", i.e., on the underlying
> data structure.

Yes, you can sort the data any way you like.  You can associate different
sorts with different columns, so that when you hit return with point in a
given column a given sort predicate is used.

The SORT value specified in `tabulated-list-format' for each column: 

 - SORT specifies how to sort entries by this column.
   If nil, this column cannot be used for sorting.
   If t, sort by comparing the string value printed in the column.
   Otherwise, it should be a predicate function suitable for
   `sort', accepting arguments with the same form as the elements
   of `tabulated-list-entries'.

What is passed to the sort function to compare are two rows of the
table (not as displayed, but the underlying data), i.e., "elements
of `tabulated-list-entries'".

> All in all, it seems that (apart from the manual) EWOC has only one
> advantage for me: I already have some working code using it...

;-)  It may have other advantages too; dunno.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]