I want to create a library of useful info.

I want to be able to have each info-snippet classified by several keywords


("Jumping Flame Spiders go for your face. Get your pet cat to eat them.")

could be classified with the keywords spiders, everyday-tips-and-tricks and cats.

Later, all searches for any of the combinations of the keywords above should return the line above and all other relevant ones.

Is this possible to do in emacs lisp? Which libraries should I look into? If I have to "shell out", what would be the most multiple-platform friendly way of doing it?

Edit: my main use case will be to provide one piece of info (a paragraph of two) in the mode line or displayed in a buffer. If many info pieces match, I'll select one randomly.

  • 1
    Better title appreciated. Such a system/structure might have a specific name in elisp. Commented Feb 28, 2015 at 19:25
  • Depends on the scale of a project, but I'd go with whitedb.org (it has Python bindings, which can be then used via Pymacs). Graph databases are best for modelling this kind of data. I've heard about Emacs moving towards CFFI of its own, but I've not experimented with it yet, but if that's a reality rather than a wishful thinking, then I'd try to write Elisp bindings for this or similar database (I've started it once in CL, and the API is rather small).
    – wvxvw
    Commented Feb 28, 2015 at 19:54
  • @wvxvw Looks neat, thanks for the tip. It does have the drawback that all users will need to dl a separate program though, but I'll keep it in mind. They do not seem to have a simple install procedure a la brew or sudo apt-get though.... Commented Feb 28, 2015 at 20:29
  • I didn't have problems compiling their code. The project seems to be well-maintained. But there certainly are alternative, more established solutions: SQLite (has ELisp libraries) or BerkleyDB (more robust / can be used to implement a graph database on top of it). There are also popular, simpler to manage ones, like Mongo or Redis / Tokyo Cabinet.
    – wvxvw
    Commented Feb 28, 2015 at 21:11

1 Answer 1

  1. Put your wisdom in a file or files.

  2. Bookmark those locations.

  3. Load library Bookmark+.

  4. Tag your bookmarks with whatever keywords you like.

    Tags are arbitrary strings - not limited to words or symbols. You can also tag a bookmark when you create it (i.e., be prompted automatically to add tags).

  5. Use any combination of tags when you jump to a bookmark.

    The bookmark candidates are filtered by the tags you specify.

  • Since I want to display one wisdom at a time in the mode line or a separate buffer (chosen at random if several are applicable, I guess I will need to write some additional code for this. But thanks, I will look into it. Commented Feb 28, 2015 at 19:50
  • I hope to create a package of this eventually. Will the bookmarks be simple to transfer/install on other machines? I guess having the user point to a base folder in their dotfile should work... Commented Feb 28, 2015 at 19:51
  • You need Bookmark+ to use bookmarks with tags. That's the only requirement - you can use them on any machine/platform. And bookmarks can point to remote files.
    – Drew
    Commented Feb 28, 2015 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.