diff options
| author | Glenn Morris | 2014-12-10 16:18:46 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-12-10 16:18:46 -0500 |
| commit | 7b244600872bda831a2d80c4797b8fb13b73197c (patch) | |
| tree | 63dc96293dfed7d9ca1251c75827180a2ada6384 | |
| parent | 98582c0079ea51b7cbadbec9021a4d07f807faf0 (diff) | |
| download | emacs-7b244600872bda831a2d80c4797b8fb13b73197c.tar.gz emacs-7b244600872bda831a2d80c4797b8fb13b73197c.zip | |
* lisp/let-alist.el: Cosmetic changes.
| -rw-r--r-- | lisp/let-alist.el | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/lisp/let-alist.el b/lisp/let-alist.el index 1cf5c27af3e..982dd2ee523 100644 --- a/lisp/let-alist.el +++ b/lisp/let-alist.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; let-alist.el --- Easily let-bind values of an assoc-list by their names. | 1 | ;;; let-alist.el --- Easily let-bind values of an assoc-list by their names |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2014 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2014 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -9,8 +9,23 @@ | |||
| 9 | ;; Prefix: let-alist | 9 | ;; Prefix: let-alist |
| 10 | ;; Separator: - | 10 | ;; Separator: - |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | ||
| 13 | |||
| 14 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 15 | ;; it under the terms of the GNU General Public License as published by | ||
| 16 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 17 | ;; (at your option) any later version. | ||
| 18 | |||
| 19 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | ;; GNU General Public License for more details. | ||
| 23 | |||
| 24 | ;; You should have received a copy of the GNU General Public License | ||
| 25 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 26 | |||
| 12 | ;;; Commentary: | 27 | ;;; Commentary: |
| 13 | ;; | 28 | |
| 14 | ;; This package offers a single macro, `let-alist'. This macro takes a | 29 | ;; This package offers a single macro, `let-alist'. This macro takes a |
| 15 | ;; first argument (whose value must be an alist) and a body. | 30 | ;; first argument (whose value must be an alist) and a body. |
| 16 | ;; | 31 | ;; |
| @@ -39,28 +54,11 @@ | |||
| 39 | ;; invocations, the inner one can't access the variables of the outer | 54 | ;; invocations, the inner one can't access the variables of the outer |
| 40 | ;; one. | 55 | ;; one. |
| 41 | 56 | ||
| 42 | ;;; License: | ||
| 43 | ;; | ||
| 44 | ;; This file is part of GNU Emacs. | ||
| 45 | ;; | ||
| 46 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 47 | ;; it under the terms of the GNU General Public License as published by | ||
| 48 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 49 | ;; (at your option) any later version. | ||
| 50 | ;; | ||
| 51 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 52 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 53 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 54 | ;; GNU General Public License for more details. | ||
| 55 | ;; | ||
| 56 | ;; You should have received a copy of the GNU General Public License | ||
| 57 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 58 | |||
| 59 | ;;; Code: | 57 | ;;; Code: |
| 60 | 58 | ||
| 61 | 59 | ||
| 62 | (defun let-alist--deep-dot-search (data) | 60 | (defun let-alist--deep-dot-search (data) |
| 63 | "Return alist of symbols inside DATA which start with a `.'. | 61 | "Return alist of symbols inside DATA that start with a `.'. |
| 64 | Perform a deep search and return an alist where each car is the | 62 | Perform a deep search and return an alist where each car is the |
| 65 | symbol, and each cdr is the same symbol without the `.'." | 63 | symbol, and each cdr is the same symbol without the `.'." |
| 66 | (cond | 64 | (cond |
| @@ -77,9 +75,8 @@ symbol, and each cdr is the same symbol without the `.'." | |||
| 77 | ;;;###autoload | 75 | ;;;###autoload |
| 78 | (defmacro let-alist (alist &rest body) | 76 | (defmacro let-alist (alist &rest body) |
| 79 | "Let-bind dotted symbols to their cdrs in ALIST and execute BODY. | 77 | "Let-bind dotted symbols to their cdrs in ALIST and execute BODY. |
| 80 | Dotted symbol is any symbol starting with a `.'. Only those | 78 | Dotted symbol is any symbol starting with a `.'. Only those present |
| 81 | present in BODY are let-bound and this search is done at compile | 79 | in BODY are let-bound and this search is done at compile time. |
| 82 | time. | ||
| 83 | 80 | ||
| 84 | For instance, the following code | 81 | For instance, the following code |
| 85 | 82 | ||
| @@ -103,8 +100,4 @@ expands to | |||
| 103 | 100 | ||
| 104 | (provide 'let-alist) | 101 | (provide 'let-alist) |
| 105 | 102 | ||
| 106 | ;; Local Variables: | ||
| 107 | ;; sentence-end-double-space: t | ||
| 108 | ;; End: | ||
| 109 | |||
| 110 | ;;; let-alist.el ends here | 103 | ;;; let-alist.el ends here |