diff options
author | Damien Elmes <emms@repose.cx> | 2006-06-08 09:07:00 +0000 |
---|---|---|
committer | Damien Elmes <emms@repose.cx> | 2006-06-08 09:07:00 +0000 |
commit | 0ac8fee949bfd85e4d7c1d3213297ab6dfeae7be (patch) | |
tree | 55e8e391f737860af97dcdda34ee0de477b9ac83 /emms-playlist-mode.el | |
parent | 4ccf4e44c94e4b7471ee0aee968a05a9a0720982 (diff) |
fix RET on trailing \n
\n isn't propertized which means hitting RET on a playlist or browser
entry fails. this patch moves the point before trying to read the
properties.
darcs-hash:20060608090703-4e3e3-56f8e91f35d92f217517222b1f1e3206f83b1825.gz
Diffstat (limited to 'emms-playlist-mode.el')
-rw-r--r-- | emms-playlist-mode.el | 24 |
1 files changed, 14 insertions, 10 deletions
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. |