aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-playlist-mode.el14
-rw-r--r--emms.el2
2 files changed, 13 insertions, 3 deletions
diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index 28c34e6..e2fcdaf 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -16,7 +16,7 @@
;;; (1) Lukhas wants `emms-list-playlist-buffers' to list all the
;;; playlist buffers.
;;;
-;;; (2) Add multi-line formatting and arbitrary comment entry.
+;;; (2) Arbitrary comment entry with color overlays.
;;;
;;; (3) Font-locking for unselected tracks via overlays.
@@ -138,7 +138,8 @@ FUN should be a function."
(defun emms-playlist-mode-kill-track ()
"Kill the track at point."
(interactive)
- (let ((region (emms-property-region (point) 'emms-track)))
+ (let ((region (emms-property-region (point) 'emms-track))
+ (inhibit-read-only t))
(cond ((not (emms-playlist-track-at))
(kill-line 1)) ; Purposfully kills only one line
((and (not (emms-playlist-mode-selected-at))
@@ -179,6 +180,12 @@ FACE should be a valid face."
(let ((o (make-overlay (point-at-bol) (point-at-eol))))
(overlay-put o 'face face)))
+(defun emms-playlist-mode-overlay-unselected ()
+ ;; point-mix/max because -insert-source narrows the world
+ (emms-playlist-mode-overlay-track (point-min)
+ (point-max)
+ 'emms-playlist-track-face))
+
;; Selected track overlaying track in constant time.
(defun emms-playlist-mode-overlay-selected ()
"Place an overlay over the currently selected track."
@@ -199,6 +206,9 @@ FACE should be a valid face."
;;; Hooks
;;; --------------------------------------------------------
+(add-hook 'emms-playlist-source-inserted-hook
+ 'emms-playlist-mode-overlay-unselected)
+
(add-hook 'emms-playlist-selection-changed-hook
'emms-playlist-mode-overlay-selected)
diff --git a/emms.el b/emms.el
index d503685..19e19e4 100644
--- a/emms.el
+++ b/emms.el
@@ -694,7 +694,7 @@ This uses `emms-playlist-insert-track-function'."
(narrow-to-region (point)
(point))
(apply source args)
- (run-hooks emms-playlist-source-inserted-hook))))
+ (run-hooks 'emms-playlist-source-inserted-hook))))
(defun emms-playlist-tracks-in-region (beg end)
"Return all tracks between BEG and END."