aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFran Burstall <fran.burstall@gmail.com>2018-11-22 19:32:42 +0000
committerFran Burstall <fran.burstall@gmail.com>2018-11-22 19:32:42 +0000
commit359e1d38d09060b5f7860320649d6c30b71e4bbe (patch)
tree9b52dd3e8f8e5db275707bfb61c7e5968ba15d88
parent56d9ec27dbbe75496e338f6621e196c04472470f (diff)
* lisp/emms-browser.el: bug fix
Don't rely on (interactive "r"): it can error out if no mark ever set.
-rw-r--r--lisp/emms-browser.el8
1 files 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