Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akirak/bookmark-frecency.el
Sort Emacs bookmarks by frecency
https://github.com/akirak/bookmark-frecency.el
Last synced: 7 days ago
JSON representation
Sort Emacs bookmarks by frecency
- Host: GitHub
- URL: https://github.com/akirak/bookmark-frecency.el
- Owner: akirak
- License: gpl-3.0
- Created: 2023-11-20T03:38:54.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-07-23T09:17:15.000Z (4 months ago)
- Last Synced: 2024-07-23T11:24:57.341Z (4 months ago)
- Language: Emacs Lisp
- Size: 42 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* bookmark-frecency-mode for Emacs
[[https://melpa.org/#/bookmark-frecency][file:https://melpa.org/packages/bookmark-frecency-badge.svg]]This library exposes ~bookmark-frecency-mode~, which is a global mode that
tracks access to your bookmarks and sorts them by frecency, using the
algorithm described in [[https://slack.engineering/a-faster-smarter-quick-switcher/][A faster, smarter Quick Switcher - Slack Engineering]].The most notable feature of this library is integration with [[https://github.com/emacs-dashboard/emacs-dashboard][dashboard]] package.
With ~bookmark-frecency-mode~, bookmarks in the dashboard widget will be sorted at the cost of minimum addition to Emacs startup time.
** Installation
This package is available as [[https://melpa.org/#/bookmark-frecency][bookmark-frecency]] from MELPA.
Alternatively, you can just clone the repository and add the directory to ~load-path~ using your favorite Emacs package manager.
** Configuration
Turn on ~bookmark-frecency-mode~.On every visit to a bookmark, the visited bookmark will be updated with the
information needed to calculate the frecency score later.
Thus your bookmarks should be persisted to ~bookmark-file~ at some point after a call to ~bookmark-jump~.
You can customize this behavior by customizing ~bookmark-save-flag~ variable.If you are using [[https://github.com/emacs-dashboard/emacs-dashboard][dashboard]] package, entries in the bookmark widget will be sorted out of the box once you turn on the global mode.
Also, to sort the result of ~bookmark-maybe-sort-alist~ (which is used in ~bookmark-bmenu-list~ and other commmands using ~bookmark-completing-read~) by frecency, set the value of ~bookmark-sort-flag~ to ~last-modified~.
This is weird according to what the option value is supposed to mean, but ~bookmark-bmenu-list~ wouldn't work for a non-standard value.
** Usage
To retrieve a sorted list of bookmarks, use either ~bookmark-all-names~ (only names) or ~bookmark-maybe-sort-alist~ (full records).There is nothing else you have to (or can) do with this package.
When you turn on ~bookmark-frecency-mode~, every visit to a bookmark will have a side-effect on the bookmark set, and all other libraries using ~bookmark-all-names~ and ~bookmark-maybe-sort-alist~ will get a sorted list of bookmarks.
** Acknowledgement
~bookmark-frecency.el~ is inspired by [[https://github.com/alphapapa/frecency.el][frecency.el]] by Adam Porter (a.k.a. alphapapa).
The package is not a dependency of this package because of subtlety in implementation details.