defaultxr / tag-edit-mode

Emacs major mode for editing file tags (id3, etc)
GNU General Public License v3.0
5 stars 0 forks source link
audio-tag audio-tagger audio-tagging emacs ffmpeg id3

+TITLE: tag-edit-mode

An Emacs major mode to edit file tags (id3, vorbis, etc). Quickly and easily edit tags with the power of Emacs!

WARNING: This is currently beta-quality software; if you use it, you're using it at your own risk!

Even though tag-edit-mode has an option to make backups (~tag-edit-backup-directory~), you should still make your own backups of any files you care about.

NOTE: Currently, tag-edit-mode only supports one set of tags per file. So if a file has both id3v1 and id3v2, only id3v2 is read. If a file only has id3v1, id3v1 is read, but id3v2 is written.

Ensure you have ~kid3-cli~ or ~ffmpeg~ installed and in your ~$PATH~, since tag-edit-mode currently requires one of them in order to read and write tags.

After installing tag-edit-mode by putting its directory in your ~load-path~, type ~M-: (require 'tag-edit-mode) RET~ to load it.

FIX: Maybe also add instructions for adding to init.el.

After installing tag-edit-mode, you can start editing tags with one of the following commands:

** Bindings

Once you've opened files for editing, you will see the current tags for each file, as well as a standard list of tags that are always displayed for files (~tag-edit-standard-tags~). Tag-edit-mode buffers support the following built-in bindings:

FIX: we should probably just attempt to catch normal kill/yank and just ensure tag-edit-mode makes them "do the right thing".

- ~C-c M-w~ - Copy the tags of the file under point to the kill ring.

- ~C-c C-w~ - Cut the tags of the file under point to the kill ring.

- ~C-c C-y~ - Paste tags from the kill ring to the file under point.

** Shell Functions

FIX: these functions should handle the user specifying more than one file.

To easily call tag-edit-mode from your shell, you can define a function like so:

*** Bash

+begin_src bash

tag-edit() { emacsclient --eval "(tag-edit-directory \"$(readlink -f "$1")\")" }

+end_src

*** Fish

+begin_src fish

function tag-edit -d "Edit the media tags of the specified file in tag-edit-mode in Emacs." emacsclient --eval "(tag-edit-directory \"$(path resolve $argv[1])\")" end

+end_src

** [[https://beets.io][beets]] "The music geek’s media organizer". Beets catalogs your collection, automatically improving its metadata as it goes using MusicBrainz or similar databases. Then it provides a bouquet of tools for manipulating and accessing your music. Because beets is designed as a library, it can do almost anything you can imagine for your music collection.

Beets' [[https://beets.readthedocs.io/en/stable/plugins/edit.html][edit plugin]] adds the ability to edit tags of media files using a text editor of your choice. Unlike tag-edit-mode, though, the plugin's interface is a lot more sparse (doesn't show all tags), less featureful, and does not have bindings in Emacs.

** [[https://kid3.kde.org/][kid3]] Media tag editor from the KDE project. If you want to easily tag multiple MP3, Ogg/Vorbis, FLAC, Monkey’s Audio, MPC, MP4/AAC, MP2, Opus, Speex, TrueAudio, WavPack, WMA/WMV, WAV and AIFF files (e.g. full albums) without typing the same information again and again and have control over both ID3v1 and ID3v2 tags, then Kid3 is the program you are looking for.

Kid3 even has its own command line interface, but it is not specialized for Emacs. This command line interface is actually what tag-edit-mode uses for the kid3 backend.

** [[https://www.gnu.org/software/emms/][Emms]] Emms is the Emacs Multimedia System. Emms displays and plays multimedia from within GNU/Emacs using a variety of external players and from different sources.

Emms can run as a minimalist player and controlled with a handful of M-x Emacs commands, or a fully-fledged, interactive media browser. Emms can display album art, play streaming audio, tag music files, search for lyrics, provide MPD connectivity, control the volume, and more.

As noted, Emms does have the ability to edit tags for music files, however this may be overkill if you only want to edit tags in Emacs and don't care about the other tasks.

** [[https://github.com/pft/elisp-assorted/blob/master/taggit.el][taggit.el]] Emacs interface to the ~taggit~ command line tag editing program. Seems likely to be bit-rotted, as taggit is now known as [[https://github.com/ft/amded][amded]]. Also of note is that taggit/amded uses the taglib library, just like kid3 does.