diff options
author | Tassilo Horn <tassilo@member.fsf.org> | 2007-02-22 16:51:00 +0000 |
---|---|---|
committer | Tassilo Horn <tassilo@member.fsf.org> | 2007-02-22 16:51:00 +0000 |
commit | 4cb782eaac1243423c82587729ccf5811b51841d (patch) | |
tree | a40d3444b788bcd49a31aac9e623600a064378b5 | |
parent | 0a2a9b02e30a9d9755102a07a41cac8bddccdab9 (diff) |
improve-emms-mark-and-write-docs.dpatch
Fixed emms-mark-track so that you can (un)mark backwards
with `C-u -3 m'.
Wrote texinfo docs for emms-mark.el.
darcs-hash:20070222165136-c06f4-ececc4b3161d92d827588400d52ad97186a784a5.gz
-rw-r--r-- | emms-mark.el | 22 | ||||
-rw-r--r-- | emms.texinfo | 56 |
2 files changed, 73 insertions, 5 deletions
diff --git a/emms-mark.el b/emms-mark.el index 3ea0b96..802b1f6 100644 --- a/emms-mark.el +++ b/emms-mark.el @@ -73,15 +73,26 @@ (save-excursion (beginning-of-line) (while (and (not (eobp)) - (> arg 0)) + (/= arg 0)) (setq track (get-text-property (point) 'emms-track)) (delete-char 1) (insert (emms-propertize (string emms-mark-char) 'emms-track track)) (backward-char 1) - (put-text-property (point) (progn (forward-line 1) (point)) - 'face face) - (setq arg (1- arg)))))) + (if (> arg 0) + ;; Propertizing forward... + (put-text-property (point) + (progn (forward-line 1) (point)) + 'face face) + ;; ... and backward + (let ((start (save-excursion (end-of-line) (point)))) + (put-text-property (progn (beginning-of-line) (point)) + start + 'face face)) + (forward-line -1)) + (setq arg (if (> arg 0) + (1- arg) + (1+ arg))))))) (defun emms-mark-unmark-track (&optional arg) (interactive "p") @@ -208,6 +219,9 @@ collect the result of FUNC." ;;{{{ mode stuff (defconst emms-mark-mode-map (let ((map (make-sparse-keymap))) + (define-key map "W" 'emms-mark-copy-marked-tracks) + (define-key map "K" 'emms-mark-kill-marked-tracks) + (define-key map "D" 'emms-mark-delete-marked-tracks) (define-key map "m" 'emms-mark-forward) (define-key map "u" 'emms-mark-unmark-forward) (define-key map "U" 'emms-mark-unmark-all) diff --git a/emms.texinfo b/emms.texinfo index 6c8eb33..5970c3d 100644 --- a/emms.texinfo +++ b/emms.texinfo @@ -921,7 +921,61 @@ within the playlist. @cindex Markable Playlists -Write me. +The Markable Playlists provided by the file @file{emms-mark.el} are an +alternative to the default interactive playlists, @xref{Interactive +Playlists}. They allow marking tracks with keybindings familiar to users +of dired. + +To enable the Markable Playlists you have to add + +@lisp +(require 'emms-mark) +@end lisp + +to your @file{.emacs}. Then you can activate @command{emms-mark-mode} by +executing @command{M-x emms-mark-mode} in a playlist buffer. You can +return to the default interactive playlist mode with @command{M-x +emms-mark-mode-disable}. + +@table @kbd +@item m +@findex emms-mark-forward +Marks the current track and sets point one line forward. If a prefix +argument ARG is given, it will mark the next ARG tracks and set point +accordingly. A negative argument marks backward. +@item U +@findex emms-mark-unmark-all +Unmarks all tracks in the playlist. +@item t +@findex emms-mark-toggle +Toggles mark on the current track. +@item u +@findex emms-mark-unmark-forward +Unmarks same way as @command{emms-mark-forward} marks. +@item % m +@findex emms-mark-regexp +Marks all tracks in the playlist matching the given regular expression. +@item % u +@findex emms-mark-unmark-regexp +Unmarks same way as @command{emms-mark-regexp} marks. +@end table + +When tracks are marked you can operate on them: + +@table @kbd +@item D +@findex emms-mark-delete-marked-tracks +Deletes the marked tracks from the playlist. +@item K +@findex emms-mark-kill-marked-tracks +Deletes the marked tracks from the playlist and places them in the +kill-ring, so that you can @command{yank} in into another playlist. +@item W +@findex emms-mark-copy-marked-tracks +Adds the marked tracks to the kill-ring, so that you can @command{yank} +them into another playlist. +@end table + @node Extending Emms @chapter Extending Emms |