From 359e1d38d09060b5f7860320649d6c30b71e4bbe Mon Sep 17 00:00:00 2001 From: Fran Burstall Date: Thu, 22 Nov 2018 19:32:42 +0000 Subject: * lisp/emms-browser.el: bug fix Don't rely on (interactive "r"): it can error out if no mark ever set. --- lisp/emms-browser.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el index 3eaca92..b930d8b 100644 --- a/lisp/emms-browser.el +++ b/lisp/emms-browser.el @@ -1291,20 +1291,20 @@ Return point. If at level one, return the current point." ;; User-visible commands ;; -------------------------------------------------- -(defun emms-browser-add-tracks (&optional start end) +(defun emms-browser-add-tracks () "Add all tracks at point or in region if active. When the region is not active, a numeric prefix argument inserts that many tracks from point. Return the playlist buffer point-max before adding." - (interactive "r") + (interactive) (let ((count (cond ((use-region-p) - (1+ (- (line-number-at-pos end) (line-number-at-pos start)))) + (1+ (- (line-number-at-pos (region-end)) (line-number-at-pos (region-beginning))))) ((numberp current-prefix-arg) current-prefix-arg) (t 1))) (first-new-track (with-current-emms-playlist (point-max)))) - (when (use-region-p) (goto-char start)) + (when (use-region-p) (goto-char (region-beginning))) (dotimes (_ count first-new-track) (let ((bdata (emms-browser-bdata-at-point))) (when bdata -- cgit v1.2.3