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-browser.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-browser.el')
-rw-r--r-- | emms-browser.el | 11 |
1 files changed, 7 insertions, 4 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." |