Commit graph

57 commits

Author SHA1 Message Date
Nicolas Petton
d75151a671 Do not signal an error when trying to delete a key from an array
* lisp/emacs-lisp/map.el (map-delete): When map is an array, check if
the key is present to avoid signaling an error.

* test/automated/map-tests.el: Add a test for deleting non-existing
keys from maps.
2015-04-24 19:29:59 +02:00
Nicolas Petton
79d9757c23 * lisp/emacs-lisp/map.el: Better docstring. 2015-04-24 19:15:23 +02:00
Nicolas Petton
f37e265ea9 Minor improvement in map-elt.
* lisp/emacs-lisp/map.el (map-elt): Do not use `ignore-errors' when
doing a lookup in arrays, but check the boundaries of the array
instead.

* test/automated/map-tests.el: Adds a test for `map-elt' with arrays
and a negative integer as key.
2015-04-24 19:10:45 +02:00
Nicolas Petton
a76628fd56 * lisp/emacs-lisp/map.el (map-into): Better error message. 2015-04-18 20:07:34 +02:00
Nicolas Petton
924ea3ff9d * lisp/emacs-lisp/map.el: Removes byte-compilation warnings. 2015-04-18 20:04:17 +02:00
Nicolas Petton
35c27cd581 Throw an error when converting a map into an unknown map type
* lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid.
* test/automated/map-test.el: Add a regression test.
2015-04-18 16:35:43 +02:00
Nicolas Petton
c3acb3258d New library map.el similar to seq.el but for mapping data structures.
* test/automated/map-test.el: New file.
* lisp/emacs-lisp/map.el: New file.
2015-04-18 16:22:16 +02:00