[Top][All Lists]

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

RE: [External] : [emacs bookmark.el] Sorting by last set

From: Drew Adams
Subject: RE: [External] : [emacs bookmark.el] Sorting by last set
Date: Mon, 6 Jun 2022 00:39:02 +0000

> >> I propose 'last-created ...
> >
> > Would you please use `created', the same field
> > name that Bookmark+ uses?  Occam's razor says
> > not to complicate things gratuitously.  Why
> > not use the same name, for the same thing?
> >
> > There's only one creation of a given bookmark.
> > It makes no sense to talk of a "last" creation
> > time.
> Yes of course.  But in what I proposed, 'created
> would only be a possible symbol for
> `bookmark-sort-flag' (or new name), nothing more.

Sure.  But what, besides sorting, are you thinking of?

Are you thinking of sorting using a composition of
predicates?  Sure, you could skip that.

With Bookmark+ you can compose predicates, but
nothing obliges you to.

> > Please see what I wrote in my previous message,
> > if for no reason other than it provides useful
> > food for thought.
> I've read it. But I think that for the bundled
> bookmark.el having a predefined set of sorting
> functions could be enough.
> As for composability of sorting, I think keeping
> it to "one at a time" could also be enough.

Each of the predefined sort orders in Bookmark+ in
fact uses a single predicate, not a composition.
You could incorporate some of the same, or similar,
predicates in `bookmark.el'.

The default value of `bmkp-sort-comparer' is,
however, a composition:

   bmkp-url-cp bmkp-gnus-cp

That sorts by bookmark _type_, for some predefined
types, and for other types it falls back to sorting
alphabetically by bookmark name.  It corresponds to
command `bmkp-bmenu-sort-by-bookmark-type', which
is bound to `s k' in the bookmark display list

("k" suggests bookmark "k"ind; `s t' is taken by
sorting "t"agged bookmarks before untagged ones).

But your option could support only a single pred.

A comment even suggests this:

  ;; An alternative default value: `bmkp-alpha-p'

And as the `bmkp-sort-comparer' doc I sent says,

 You can also convert a PRED-type predicate (which
 returns (t), (nil), or nil) into an ordinary predicate,
 by using function `bmkp-make-plain-predicate'.  That
 lets you reuse elsewhere, as ordinary predicates, any
 PRED-type predicates you define.

> And for users that need more there is Bookmark+

If bookmark.el provides something then Bookmark+
need not provide it. ;-)  Bookmark+ exists because
the features it provides weren't wanted by Emacs.

reply via email to

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