aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-browser.el11
-rw-r--r--emms-playlist-mode.el24
2 files changed, 21 insertions, 14 deletions
diff --git a/emms-browser.el b/emms-browser.el
index a9487da..1901e98 100644
--- a/emms-browser.el
+++ b/emms-browser.el
@@ -252,7 +252,6 @@ If called interactively, the new buffer is also selected."
"Add a single ENTRY -> TRACKS mapping to the buffer."
(emms-browser-ensure-browser-buffer)
(emms-with-inhibit-read-only-t
- ;; why don't we propertize the \n?
(insert (emms-propertize entry
'emms-tracks tracks
'face 'emms-browser-tracks-face) "\n")))
@@ -289,9 +288,13 @@ If called interactively, the new buffer is also selected."
(defun emms-browser-tracks-at (&optional pos)
"Return the tracks at POS (point if not given), or nil if none."
(emms-browser-ensure-browser-buffer)
- (emms-with-widened-buffer
- (get-text-property (or pos (point))
- 'emms-tracks)))
+ (save-excursion
+ ;; move the point to the start of the line, since the trailing new
+ ;; line is not propertized
+ (move-beginning-of-line nil)
+ (emms-with-widened-buffer
+ (get-text-property (or pos (point))
+ 'emms-tracks))))
(defun emms-isearch-buffer ()
"Isearch through the buffer."
diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index ec94c8f..6e049f2 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -173,16 +173,20 @@ non-nil, load the playlist at point into a new buffer.
Otherwise play the track immediately."
(interactive)
- (if (not emms-playlist-mode-open-playlists)
- (emms-playlist-mode-play-current-track)
- (let* ((track (emms-playlist-track-at))
- (name (emms-track-get track 'name))
- (type (emms-track-get track 'type)))
- (if (or (eq type 'playlist)
- (and (eq type 'file)
- (string-match "\\.\\(m3u\\|pls\\)\\'" name)))
- (emms-playlist-mode-load-playlist)
- (emms-playlist-mode-play-current-track)))))
+ (save-excursion
+ ;; move to the start of the line, in case the point is on the \n,
+ ;; which isn't propertized
+ (move-beginning-of-line nil)
+ (if (not emms-playlist-mode-open-playlists)
+ (emms-playlist-mode-play-current-track)
+ (let* ((track (emms-playlist-track-at))
+ (name (emms-track-get track 'name))
+ (type (emms-track-get track 'type)))
+ (if (or (eq type 'playlist)
+ (and (eq type 'file)
+ (string-match "\\.\\(m3u\\|pls\\)\\'" name)))
+ (emms-playlist-mode-load-playlist)
+ (emms-playlist-mode-play-current-track))))))
(defun emms-playlist-mode-switch-buffer ()
"Switch to the playlist buffer and then switch back if called again.