summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/map.el
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add new function map-doNicolas Petton2016-06-181-1/+25
| | | | | | | | | | | | * lisp/emacs-lisp/map.el (map-do, map--do-alist, map--do-array): New functions. * test/lisp/emacs-lisp/map-tests.el: Add a unit test for map-do.
* | map.el (map-merge*): Use `map-into' at beginning rather than endStefan Monnier2016-06-181-11/+18
|/ | | | | | | * lisp/emacs-lisp/map.el (map-merge): Use `map-into' for the first map, and don't use of an intermediate alist. (map-merge-with): Same, plus use `cl-callf' to try and avoid performing 3 lookups per inner iteration.
* Fix map-put and map-delete for alists (Bug#23105)Nicolas Petton2016-03-251-26/+10
| | | | | | * lisp/emacs-lisp/map.el (map-put): Do not bind the evaluated place expression to a new symbol. * test/lisp/emacs-lisp/map-tests.el: Add a regression test.
* Quoting fixes in doc strings and diagnosticsPaul Eggert2016-02-031-1/+1
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-setq, byte-compile-funcall): * lisp/gnus/mml-smime.el (mml-smime-get-dns-cert) (mml-smime-get-ldap-cert): Follow user style preference when quoting diagnostics.
* * lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macroNicolas Petton2016-02-031-8/+9
|
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Rename seq-p and map-p to seqp and mappNicolas Petton2015-11-111-3/+3
| | | | | | | * lisp/emacs-lisp/seq.el (seqp): New name. * lisp/emacs-lisp/map.el (mapp): New name. * doc/lispref/sequences.texi: Update the documentation for seqp. * test/automated/map-tests.el: Update the tests for mapp.
* * lisp/emacs-lisp/map.el (map-merge-with): New functionArtur Malabarba2015-11-101-5/+20
| | | | * test/automated/map-tests.el (test-map-merge-with): New test
* * lisp/emacs-lisp/map.el: Better docstrings.Nicolas Petton2015-10-261-11/+12
|
* Fix typos in docstringsNicolas Petton2015-10-141-1/+1
| | | | | | * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/seq.el: Fix typos in the docstrings of the pcase macros.
* Better docstrings in seq.el and map.elNicolas Petton2015-10-141-3/+7
| | | | | * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/seq.el: Improve the docstring for the pcase patterns.
* Improve the semantic of map-someNicolas Petton2015-09-061-2/+3
| | | | | | | | | | Update map-some to return the returned by the predicate, similar to seq-some. * lisp/emacs-lisp/map.el (map-some): Update the function to return the return value of the predicate. * test/automated/map-tests.el (test-map-some): Update the test to check for non-nil values only.
* Rename map-contains-key-p and map-some-pNicolas Petton2015-09-061-4/+4
| | | | | | | | Remove the "-p" suffix from both function names. * lisp/emacs-lisp/map.el (map-contains-key, map-some): Rename the functions. * test/automated/map-tests.el (test-map-contains-key, test-map-some): Update both test functions.
* Add support for gv.el in map.elNicolas Petton2015-07-091-66/+60
| | | | | | | * lisp/emacs-lisp/map.el (map-elt, map-delete): Declare a gv-expander. * lisp/emacs-lisp/map.el (map-put): Refactor using `setf' and `map-elt'. * test/automated/map-tests.el: Update tests to work with the new implementations of map-elt and map-put.
* Revert "Define `map-elt' as a generalized variable"Nicolas Petton2015-06-211-28/+24
| | | | This reverts commit 8b6d82d3ca86f76ed964063b3941a7c6ab0bf1c6.
* Define `map-elt' as a generalized variableNicolas Petton2015-06-211-24/+28
| | | | | | | | | | | * lisp/emacs-lisp/map.el (map-elt): Define a gv-expander. * lisp/emacs-lisp/map.el (map--dispatch): Tighten the code. * lisp/emacs-lisp/map.el (map-put): Redefine it as a function using a `setf' with `map-elt'. * test/automated/map-tests.el: Comment out `test-map-put-literal'.
* Reuse `alist-get' in map.elNicolas Petton2015-06-211-10/+2
| | | | | * lisp/emacs-lisp/map.el (map-elt): Use `alist-get' to retrieve alist elements.
* * lisp/emacs-lisp/map.el (map-into): Fix a byte-compiler warning.Nicolas Petton2015-06-161-2/+2
|
* * lisp/emacs-lisp/map.el (map-let): Better docstring.Nicolas Petton2015-06-151-3/+6
|
* * lisp/emacs-lisp/map.el (map-let): Better docstring.Nicolas Petton2015-06-061-8/+13
|
* Better syntax for the map pcase patternNicolas Petton2015-06-061-1/+1
| | | | | * lisp/emacs-lisp/map.el: Improves the map pcase pattern to take bindings of the form (KEY PAT) or SYMBOL. KEY is not quoted.
* * lisp/emacs-lisp/map.el (map--dispatch): Better docstring.Nicolas Petton2015-06-061-2/+2
|
* ; * lisp/emacs-lisp/map.el: Fix formatting.Nicolas Petton2015-06-061-7/+7
|
* Fix a byte-compiler error in map-put and map-deleteNicolas Petton2015-06-061-10/+16
| | | | | * lisp/emacs-lisp/map.el (map-put, map-delete): Ensure that `setq' is called with a symbol.
* * lisp/emacs-lisp/map.el (map--dispatch): Move before use.Glenn Morris2015-06-051-32/+32
| | | | (map--delete-array): Fix typo.
* * lisp/emacs-lisp/map.el: Better docstring for the map pcase macro.Nicolas Petton2015-06-041-1/+2
|
* Add a pcase pattern for maps and `map-let' based on itNicolas Petton2015-06-021-0/+35
| | | | | | * lisp/emacs-lisp/map.el (map-let): New macro. (map--make-pcase-bindings, map--make-pcase-patterns): New functions. * test/automated/map-tests.el: New test for `map-let'.
* Improve the docstring of functions in map.elNicolas Petton2015-05-161-19/+58
| | | | | | | | Since a map is not a data structure but a concept, adding information about the possible types of maps can be useful information. * lisp/emacs-lisp/map.el: Add documentation about the type of MAP to each public function.
* Faster implementation of map-empty-pNicolas Petton2015-04-291-1/+5
| | | | | * lisp/emacs-lisp/map.el (map-empty-p): Faster implementation using specific tests depending on the type of the map.
* * lisp/emacs-lisp/map.el: Better docstrings.Nicolas Petton2015-04-291-9/+6
|
* * lisp/emacs-lisp/map.el (map-pairs): Dump redundant lambdaArtur Malabarba2015-04-251-3/+1
|
* * lisp/emacs-lisp/map.el (map--elt-list): Better docstring.Nicolas Petton2015-04-251-1/+1
|
* * lisp/emacs-lisp/map.el (map--elt-list): Minor refactoring.Nicolas Petton2015-04-251-1/+1
|
* Fix a false negative in `map-elt' with alists and values being nilNicolas Petton2015-04-251-2/+11
| | | | | | | | * lisp/emacs-lisp/map.el (map-elt): If map is an alist and key is found but its associated value is nil, do not return the default value. * test/automated/map-tests.el: Add a regression test.
* * lisp/emacs-lisp/map.el (map--dispatch): Improve the docstring.Nicolas Petton2015-04-241-1/+1
|
* Do not signal an error when trying to delete a key from an arrayNicolas Petton2015-04-241-2/+9
| | | | | | | | * 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.
* * lisp/emacs-lisp/map.el: Better docstring.Nicolas Petton2015-04-241-1/+2
|
* Minor improvement in map-elt.Nicolas Petton2015-04-241-2/+11
| | | | | | | | | * 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.
* * lisp/emacs-lisp/map.el (map-into): Better error message.Nicolas Petton2015-04-181-1/+1
|
* * lisp/emacs-lisp/map.el: Removes byte-compilation warnings.Nicolas Petton2015-04-181-4/+4
|
* Throw an error when converting a map into an unknown map typeNicolas Petton2015-04-181-1/+2
| | | | | * lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid. * test/automated/map-test.el: Add a regression test.
* New library map.el similar to seq.el but for mapping data structures.Nicolas Petton2015-04-181-0/+270
* test/automated/map-test.el: New file. * lisp/emacs-lisp/map.el: New file.