[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emms-help] emms-browser-add-tracks weirdness

From: Fran Burstall (Gmail)
Subject: Re: [emms-help] emms-browser-add-tracks weirdness
Date: Wed, 21 Nov 2018 09:05:51 +0000


I am using emms 5.1 (I am tracking master) and the code you show is the code I see.

The issue arises when (interactive "r") is confronted with nil values for start and end.  I do not understand why this is happening because I can write test functions where this form does not barf on nil arguments but it errors out when used by emms-browser-add-tracks.


On Wed, 21 Nov 2018 at 08:52, Pierre Neidhardt <address@hidden> wrote:
I remember I had this issue a while back, but if I'm not mistaken this has been
Are you running Emms 5.1?

Here is the code in 5.1:

--8<---------------cut here---------------start------------->8---
(defun emms-browser-add-tracks (&optional start end)
  "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")
  (let ((count (cond
                 (1+ (- (line-number-at-pos end) (line-number-at-pos start))))
                ((numberp current-prefix-arg)
                (t 1)))
        (first-new-track (with-current-emms-playlist (point-max))))
    (when (use-region-p) (goto-char start))
    (dotimes (_ count first-new-track)
      (let ((bdata (emms-browser-bdata-at-point)))
        (when bdata
           bdata (emms-browser-bdata-level bdata))
    (run-hook-with-args 'emms-browser-tracks-added-hook
--8<---------------cut here---------------end--------------->8---

I don't see a problem there, but I could be wrong.

Pierre Neidhardt

reply via email to

[Prev in Thread] Current Thread [Next in Thread]