and now for my second post of the day (it's not been good so far !)
I have a list and each item in the list is composed of a number of elements, for example
BlockID Location Item Description SomethingElse
I need to sort this list by the Location THEN by the item
I've been using
(setq ListSorted2
(vl-sort
Summarylist
'(lambda (s1 s2)
(< (cadr s1) (cadr s2))
)
)
)
which will sort the list on one of the elements, but I then need it sorted on another sub-element without losing main order, if you get my drift.
example list
Block3 GroundC XYZ BlahBlah xxxx
Block1 GroundB RST BlahBlah xxxx
Block5 GroundA ABC BlahBlah xxxx
Block2 GroundA DEF BlahBlah xxxx
I need to return that list sorted as
Block5 GroundA ABC BlahBlah xxxx
Block2 GroundA DEF BlahBlah xxxx
Block1 GroundB RST BlahBlah xxxx
Block3 GroundC XYZ BlahBlah xxxx