Jury-Rigging a Collection Manager in Emacs
Tuesday, August 14, 2012 7:02:08 AM
Given the number of freakishly talented Emacs Lisp developers out there, and Emacs' own infinitely extensible nature, there isn't much you can conceive of which you can't find; either as an external, or built-in library. That said, one thing that – as far as I can tell -- hasn't been created as of yet is some kind of collection manager for images, videos, or what-have-you. When it comes to music, I think EMMS1 has us covered, but below, I want to present a (partial) solution using Bookmark+2.
2 Stuff For Your Init File
2.1 Load Bookmark+
2.2 Associate MIME Types with Particular Applications
- This step is necessary if we want to be able to
<RET>on a bookmark and launch the appropriate application.
'(bmkp-default-handler-associations (quote (("\\.mkv$" . "mplayer") ("\\.mpg$" . "mplayer") ("\\.wmv$" . "mplayer") ("\\.avi$" . "mplayer") ("\\.mp4$" . "mplayer") ("\\.m4a$" . "mplayer"))))
3 Build Your Collection
3.1 Add Files
C-x p c f
/usr/home/user/path/to/file.type; this will add a particular file (say, a video, to
3.2 Tag Files
- You may end up with a lot of files in this buffer, so it behooves us to provide some means of sorting them (after all, that's kinda the point of a collection manager). Tagging provides the easiest method.
- Let's say we've added links to all our Shyla Jennings3 videos in our bookmark file. All we need do now is provide these links with some tags that will allow use to separate them from other links in the file.
- Keeping things simple, we could use
mto mark all the Shyla videos in the buffer, then
T > +in order for Emacs to provide us with a prompt. At the prompt, we enter "shylajennings"
<RET>again in order to complate the process.
3.3 View a Specific Part of the Collection
- So what do we do when we only want to view the links pointing to
Shyla Jennings videos? Simple, we use
P Tto incrementally4 show/hide links in the bookmark buffer according to whether the text we enter matches a given tag.
- In this case, if we begin typing "shyla", only those files we tagged with "shylajennings" will be visible.
- Doing this every time would be a pain, instead, we can actually
create a bookmark for this view of our bookmark file. That might
sound confusing, but in practice, you will quickly realize its
utility. Simply use
C-x r mto get the bookmark prompt, hit
<RET>, then supply a name for the view – for our example, something like "Shyla Videos" would be appropriate.
Bookmark+ is another one of those incredibly powerful Emacs libraries
that is virtually an application unto itself. For that reason, I think
you're going to find it necessary – before, during, and after my
tutorial – to consult the
*HELP* file, at the very least (
by the way). One feature you'll likely want to explore is
"annotations". Using these, you can provide descriptions/notes for the
files you bookmark; for instance, you might want to mention that
such-and-such a video has Shyla performing with Georgia Jones, Jana
Jordan, or whoever. Just like tags, annotations can be matched by
regexp5, so if you were hankerin' for some Shyla on Jana action,
you'd simply do something like:
P A jana to narrow down to just
those videos referencing Jana Jordan in their description.
Although what I have concocted here is far from being a perfect solution, I hope the advantages it confers over a simple directory listing are apparent.
Date: 2012-08-14 Tue
Generated by Org version 7.7 with Emacs version 24