summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2021-08-04 00:48:50 +0100
committerBasil L. Contovounesios <contovob@tcd.ie>2021-08-14 11:24:54 +0100
commit37d48edf6d406a4730caa0393f7695de2bfadfcc (patch)
treef2fad1ae506e4def91c2c59be3b74ffaea3ee46b /etc
parent1bfbb2b706db6a7ca9420b27d22a737deccdd5b0 (diff)
downloademacs-37d48edf6d406a4730caa0393f7695de2bfadfcc.tar.gz
Fix merging of ambiguous nil maps
* lisp/emacs-lisp/map.el: Bump version to 3.1. (map--merge): New merging subroutine that uses a hash table in place of lists, for both efficiency and avoiding ambiguities (bug#49848). (map-merge): Rewrite in terms of map--merge. (map-merge-with): Ditto. This ensures that FUNCTION is called whenever two keys are merged, even if they are not eql (which could happen until now). It also makes map-merge-with consistent with map-merge, thus achieving greater overall predictability. * etc/NEWS: Announce this weakening of guarantees. * test/lisp/emacs-lisp/map-tests.el (test-map-merge) (test-map-merge-with): Don't depend on specific orderings. Test that nil is correctly merged into a plist.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS8
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 366ea1abd6d..a321ffd81f1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1636,6 +1636,14 @@ This is a slightly deeper copy than the previous 'copy-sequence'.
---
*** The function 'map-contains-key' now supports plists.
+---
+*** More consistent duplicate key handling in 'map-merge-with'.
+Until now, 'map-merge-with' promised to call its function argument
+whenever multiple maps contained 'eql' keys. However, this did not
+always coincide with the keys that were actually merged, which could
+be 'equal' instead. The function argument is now called whenever keys
+are merged, for greater consistency with 'map-merge' and 'map-elt'.
+
** Package
---