# New Emacs packages: zk and zk-index

edited January 31

Hello Zettelkasten friends,

I've made a few packages for working with my archive in Emacs, and thought you might like to take a look.

The general package, "zk," is a basic set of functions for working with notes -- creating new notes, creating links, finding backlinks, renaming, searching, etc. It uses only built-in features of Emacs --- so no external dependencies. And it can be extended and modified in all the ways that Emacs can be extended and modified. My thought is that it could provide a baseline for people to fork and craft a set of functions to their own liking.

It just became available on Melpa and you can see a demonstration here: https://youtu.be/BixlUK4QTNk

The other package is called "zk-index," offers two additional interfaces for browsing your notes.

The "ZK-Index" interface is a persistent listing of notes, in a dedicated buffer, that can be sorted (by date of modification or creation) and narrowed down by title or note contents.

The other interface, called "ZK-Desktop" (included in "zk-index"), offers a way of working with smaller selections of notes, for specific projects for example. You can select notes from the index to "send to the desktop," where you can arrange them however you want, add commentary about the arrangements, etc. Like working with notecards on a desktop.

You can see a demontration of the index and desktop features here: https://youtu.be/7qNT87dphiA

Note that "zk-index" is still a work in progress, so it's only available in the dev branch of the zk repository. But it's been working for me, so if you give it a shot and have some notes, please let me know, either here or in Github Issues!

On compatibility, "zk" is fairly configurable, so it should be able to work with your current archive, maybe with a little configuring. I started my own note-taking using "The Archive," and the format of my notes and hasn't changed at all, so these packages should (I hope!) work with your existing archive.

Let me know what you think!

• This is very interesting, thank you for sharing! I've been working on an emacs package myself (my Lisp skills are more basic, though). The completion-at-point feature is such a nice idea! I also liked your agnostic approach to completing-read (my implementation is dependent on helm).

Don't you feel any need to use some caching mechanisms? I've made something simple, basically borrowing from deft the strategy of keeping information on hash tables.

I hope to have more time soon to dive deeper into your package.

• edited February 3

Thanks for checking it out! Phi-notes looks cool. The sidebar feature looks particularly useful. I might have to see about adding that to my 'zk-index' somehow...

As for caching, it's not really necessary since most of the heavy lifting is done by simple string searches conducted on demand by grep, which is pretty bonkers fast at searching through a plaintext directory.

The only thing in 'zk' that is cache-like is an alist called zk--alist, in which each note is represented by a triple consisting of ("id" "title" "filepath"). But this is only used by one function, zk--parse-id, and it's produced each time the function is called. So, I'm not sure it counts as a cache, really, except in a very narrow sense.

Truly, grep is what makes the whole thing run smoothly without a true cache. Maybe it'll fall apart at some point, but I stress test things on a 20,000 file directory and haven't had any real issues yet. But we'll see!

If you want to borrow anything from 'zk', whether it's code snippets or ideas, and you want any help implementing things, feel free to ping me on Github.