Subject: seq-mapn fails with circular sequence
From: "Phillip Lord" <[email-masked]>
To: [email-masked]
Date: Tue, 11 Apr 2017 08:12:40 -0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On Emacs-25 circular structures cause seq-mapn not to terminate
although the documentation suggest that they should.

Consider:

    (defvar l '(a c d))
    (setq l (nconc l l))
    (seq-mapn #'cons l '(1))

This should return '((a . 1)) but actually does not terminate.

The problem is caused by call to seq-into which includes:

    (append sequence nil)

The problem does exist on trunk which does this instead:

    (if (listp sequence)
        sequence
      (append sequence nil)))