From 0ac8fee949bfd85e4d7c1d3213297ab6dfeae7be Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 8 Jun 2006 09:07:00 +0000 Subject: 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 --- emms-browser.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'emms-browser.el') 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." -- cgit v1.2.3