unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [External] : [emacs bookmark.el] Sorting by last set
@ 2022-06-04  6:07 Karl Fogel
  2022-06-04 14:36 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 60+ messages in thread
From: Karl Fogel @ 2022-06-04  6:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Manuel Giraud, Stefan Monnier, Drew Adams, emacs-devel

A few thoughts I just had while looking over the recent 
improvement to bookmark.el sorting (commit f461eb8fa -- not the 
later followup commit fccde52158, which isn't relevant for these 
thoughts):

1) We use the value `last-modified' (for `bookmark-sort-flag') to 
   represent sorting by the date the bookmark was most recently 
   updated to point to a particular target.

   But there are other ways to "modify" bookmarks: for example, 
   you could edit a bookmark's annotation without updating its 
   target.  One could make a reasonably good argument as to why an 
   annotation change should count as a "modification" for the 
   purposes of sorting... and, one could make a reasonably good 
   argument why it shouldn't.

   My purpose here is just to ask: is the name "last-modified" 
   really the most appropriate one for the behavior currently 
   implemented?

   The simple solution would be to just change the symbol to 
   `last-set-date'.  I think that would be my choice.  It would 
   reduce the potential for confusion and misunderstanding.

   (I won't go in to the more complex solutions here, as I'm not 
   sure that bookmark.el really needs its sorting capability to be 
   fully operational battle station.)

* Now that we're using a symbol for *one* possible value of 
  `bookmark-sort-flag', should we use symbols for *all* possible 
  values?  (And leave the treatments of `t' and nil as legacy 
  compatibility behaviors, documented as such but deprecated in 
  favor of using the corresponding new symbols instead when 
  writing new configurations.)

* Finally, perhaps `bookmark-sort-flag' is no longer the right 
  name for 
  this variable?  It's not a "flag" anymore -- a "flag" should be 
  either `t' or nil.

  This naming tradition mostly holds throughout Emacs, although 
  there is at least one other exception.  Of the 54 symbols whose 
  names end in "-flag" that I found via `M-x apropos', I did a 
  random sampling of about 15.  A few don't have real doc strings 
  (sigh), but their values at least were either 't' or nil.  Of 
  the documented ones in my sample, all but one were true Boolean 
  flags.  The single exception was `quit-flag', which I would now 
  also argue is misnamed, but I'm not advocating here that we 
  change that one :-).

  However, I think it would be good to deprecate 
  `bookmark-sort-flag' in favor of 'bookmark-sort-behavior' or 
  something, and do whatever the usual compatibility dance is for 
  such situations.  It's useful for the suffix "-flag" to actually 
  mean something, and I'd rather not have bookmark.el contribute 
  to the dilution of that linguistic tradition.

By the way, I still think the change as currently landed is an 
unambiguous improvement.  I would still want to keep it even if we 
didn't take any of my suggestions above.

Best regards,
-Karl



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [emacs bookmark.el] Sorting by last set
@ 2022-05-24 11:34 Manuel Giraud
  2022-05-24 14:41 ` [External] : " Drew Adams
  0 siblings, 1 reply; 60+ messages in thread
From: Manuel Giraud @ 2022-05-24 11:34 UTC (permalink / raw)
  To: emacs-devel

Hi,

I'd like to code a way to sort the bookmark list by the "last modified
date" (i.e. not the creation date of the bookmark but last time the
bookmark was modified).

AFAIU, the current order of the buffer list is always "last created
first" and there is no date associated with the modification.

In order to have this feature, I could modify the default order of the
bookmark list to "last modified first" or add a new field for each
record with the modification date? The former modifies the default order
of the bookmark list. The latter modifies the bookmark files format.

FWIW, I've tried doing the latter but I think I'd prefer the former as
it would work automatically with a 'bookmark-sort-flag' to nil.

What do you guys think?
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2022-09-01  2:08 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-04  6:07 [External] : [emacs bookmark.el] Sorting by last set Karl Fogel
2022-06-04 14:36 ` Stefan Monnier
2022-06-04 16:25 ` Drew Adams
2022-06-05 16:16 ` Manuel Giraud
2022-06-05 17:33   ` Drew Adams
2022-06-05 20:53     ` Manuel Giraud
2022-06-05 21:12       ` Stefan Monnier
2022-06-06  0:39         ` Drew Adams
2022-06-07 15:55           ` Manuel Giraud
2022-06-08 11:51             ` Lars Ingebrigtsen
2022-06-06  0:39       ` Drew Adams
2022-06-05 17:53   ` Stefan Monnier
2022-06-07 19:49   ` Karl Fogel
2022-06-08  1:14     ` Drew Adams
2022-06-08  7:57       ` Manuel Giraud
2022-06-08 14:23         ` Drew Adams
2022-06-14 15:34         ` Manuel Giraud
2022-06-14 16:36           ` Drew Adams
2022-06-15 12:08           ` Lars Ingebrigtsen
2022-06-15 12:32             ` Manuel Giraud
2022-08-18 18:19           ` Karl Fogel
2022-08-31 11:39             ` Manuel Giraud
2022-09-01  1:45               ` Karl Fogel
2022-09-01  2:08                 ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2022-05-24 11:34 Manuel Giraud
2022-05-24 14:41 ` [External] : " Drew Adams
2022-05-24 15:32   ` Manuel Giraud
2022-05-24 15:46     ` Lars Ingebrigtsen
2022-05-25  2:25       ` Karl Fogel
2022-05-25  5:05         ` Drew Adams
2022-05-25  8:04           ` Manuel Giraud
2022-05-25 14:01             ` Drew Adams
2022-05-25 13:18       ` Manuel Giraud
2022-05-25 14:01         ` Drew Adams
2022-05-25 15:25           ` Manuel Giraud
2022-05-25 20:17             ` Drew Adams
2022-05-26 19:41               ` Manuel Giraud
2022-05-26  4:09             ` Karl Fogel
2022-05-26 10:58               ` Lars Ingebrigtsen
2022-05-26 16:42                 ` Manuel Giraud
2022-05-26 16:59                   ` Stefan Monnier
2022-05-26 20:09                     ` Manuel Giraud
2022-05-27 10:34                       ` Lars Ingebrigtsen
2022-05-27 13:11                         ` Manuel Giraud
2022-05-27 13:20                           ` Lars Ingebrigtsen
2022-05-27 13:39                             ` Manuel Giraud
2022-05-28 10:34                               ` Lars Ingebrigtsen
2022-05-30 14:59                                 ` Manuel Giraud
2022-05-31 18:36                                   ` Lars Ingebrigtsen
2022-06-01  6:16                                     ` Juri Linkov
2022-06-01  8:04                                       ` Manuel Giraud
2022-06-01 12:18                                         ` Lars Ingebrigtsen
2022-06-01 12:38                                           ` Manuel Giraud
2022-06-01 12:08                                       ` Stefan Monnier
2022-06-01 14:24                                       ` Drew Adams
2022-06-01 13:45                                     ` Manuel Giraud
2022-06-01 15:32                                       ` Lars Ingebrigtsen
2022-06-01 15:56                                         ` Manuel Giraud
2022-06-01 15:58                                           ` Lars Ingebrigtsen
2022-06-04  5:33                                     ` Karl Fogel
2022-05-24 16:03     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).