GNU bug report logs - #49848
27.2.50; map-merge plist return alist

Previous Next

Package: emacs;

Reported by: Rajeev N <rajeev.jnk <at> sivalik.com>

Date: Tue, 3 Aug 2021 19:40:02 UTC

Severity: normal

Tags: patch

Found in version 27.2.50

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 49848 <at> debbugs.gnu.org
Cc: rajeev.jnk <at> sivalik.com
Subject: bug#49848: 27.2.50; map-merge plist return alist
Date: Tue, 03 Aug 2021 23:59:14 +0200
Rajeev N via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> (map-merge 'plist nil '(:a 1))
> expected: '(:a 1)
> got: '((:a . 1))

I can reproduce this behavior and consider it a bug.

The implementation of `map-merge' starts with an empty plist "RESULT"
(i.e., nil) and fills it like

      (map-do (lambda (key value)
                (setf (map-elt result key) value))
              (pop maps))

The setter of `map-elt' treats nil as empty alist (at the end, this is
decided by `map--plist-p' which doesn't consider nil a plist).

So the underlying problem is more general, maybe this is not the only
issue this ambiguity causes.

Michael.




This bug report was last modified 3 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.