/tag-edit-mode

Emacs major mode for editing file tags (id3, etc)

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

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.

Features

  • Is a standard Emacs major mode, so keyboard macros, search/replace, etc work as expected.
  • Supports multiple “backends”: kid3, ffmpeg, and possibly others in the future.
  • Not limited to just audio files; supports other file tag types when a supported backend is detected. (Though no others are implemented yet…)
  • Optional automatic backups before writing tags (tag-edit-backup-directory).

Installation

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.

Usage

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

  • tag-edit - Prompt for a file or directory to edit. If a directory is selected, its contents are opened for editing.
  • dired-tag-edit - Edit the files marked in the current dired buffer, or the file under point if nothing is marked.

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:

  • C-c C-c - Write the tags for the file under point.
  • C-x C-s - Write the tags for all changed files in the current buffer.
  • C-c C-k - Revert the tags for the file under point back to what is currently saved in the file.
  • C-c C-M-k - Revert the tags for all files in the buffer.
  • TAB - Collapse (or re-expand) the file under point.
  • M-p - Jump to the previous field.
  • M-n - Jump to the next field.
  • C-c C-p - Jump to the previous file in the buffer.
  • C-c C-n - Jump to the next file in the buffer.
  • C-c C-t - Preview the file under point. Press again to stop the preview.
  • C-c C-o - Edit the file under point in an external editor.

Shell Functions

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

Bash

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

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

Similar Software

“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’ 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.

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.

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.

Emacs interface to the taggit command line tag editing program. Seems likely to be bit-rotted, as taggit is now known as amded. Also of note is that taggit/amded uses the taglib library, just like kid3 does.