diff options
| author | Bozhidar Batsov | 2013-11-04 17:34:42 +0200 |
|---|---|---|
| committer | Bozhidar Batsov | 2013-11-04 17:34:42 +0200 |
| commit | 7b530552e80abf7701aa6c965e30ff22528c42ab (patch) | |
| tree | ea3e7700a98a68a39a560569f44927928441e459 | |
| parent | b27cc9fc02ca67204df9261381e58dc206fbeeff (diff) | |
| download | emacs-7b530552e80abf7701aa6c965e30ff22528c42ab.tar.gz emacs-7b530552e80abf7701aa6c965e30ff22528c42ab.zip | |
* lisp/helpers.el: Actually commit the library code.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/helpers.el | 42 |
3 files changed, 51 insertions, 0 deletions
| @@ -742,6 +742,10 @@ frame. | |||
| 742 | +++ | 742 | +++ |
| 743 | ** New macro with-eval-after-load. Like eval-after-load, but better behaved. | 743 | ** New macro with-eval-after-load. Like eval-after-load, but better behaved. |
| 744 | 744 | ||
| 745 | ** New library helpers.el for misc helper functions | ||
| 746 | *** `hash-table-keys' | ||
| 747 | *** `hash-table-values' | ||
| 748 | |||
| 745 | ** Obsoleted functions: | 749 | ** Obsoleted functions: |
| 746 | *** `log10' | 750 | *** `log10' |
| 747 | *** `dont-compile' | 751 | *** `dont-compile' |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e351b73fbd6..4530afbde21 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -13,6 +13,11 @@ | |||
| 13 | 13 | ||
| 14 | 2013-11-04 Bozhidar Batsov <bozhidar@batsov.com> | 14 | 2013-11-04 Bozhidar Batsov <bozhidar@batsov.com> |
| 15 | 15 | ||
| 16 | * progmodes/ruby-mode.el (ruby-mode): Clean up docstring. | ||
| 17 | |||
| 18 | * subr.el (version<, version<=, version=): | ||
| 19 | Update docstrings with information for snapshot versions. | ||
| 20 | |||
| 16 | * helpers.el: New library for misc helper functions. | 21 | * helpers.el: New library for misc helper functions. |
| 17 | (hash-table-keys): New function returning a list of hash keys. | 22 | (hash-table-keys): New function returning a list of hash keys. |
| 18 | (hash-table-values): New function returning a list of hash values. | 23 | (hash-table-values): New function returning a list of hash values. |
diff --git a/lisp/helpers.el b/lisp/helpers.el new file mode 100644 index 00000000000..51361043eb2 --- /dev/null +++ b/lisp/helpers.el | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | ;;; helpers.el --- Some non-essential library extensions | ||
| 2 | |||
| 3 | ;; Copyright (C) 2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: FSF | ||
| 6 | ;; Keywords: convenience | ||
| 7 | ;; Package: emacs | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | (defsubst hash-table-keys (hash-table) | ||
| 29 | "Return a list of keys in HASH-TABLE." | ||
| 30 | (let ((keys '())) | ||
| 31 | (maphash (lambda (k v) (push k keys)) hash-table) | ||
| 32 | keys)) | ||
| 33 | |||
| 34 | (defsubst hash-table-values (hash-table) | ||
| 35 | "Return a list of values in HASH-TABLE." | ||
| 36 | (let ((values '())) | ||
| 37 | (maphash (lambda (k v) (push v values)) hash-table) | ||
| 38 | values)) | ||
| 39 | |||
| 40 | (provide 'helpers) | ||
| 41 | |||
| 42 | ;;; helpers.el ends here | ||