diff options
| author | Daniel Colascione | 2014-03-22 23:00:18 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2014-03-22 23:00:18 -0700 |
| commit | 7eab98da1b67fb50195cfd0bfa20ddca75e67465 (patch) | |
| tree | 339022ac422974e8851dc5255b1d78988380d87d | |
| parent | 0ceba22e53c3ce48448f37311b8ec2294ef8238c (diff) | |
| download | emacs-7eab98da1b67fb50195cfd0bfa20ddca75e67465.tar.gz emacs-7eab98da1b67fb50195cfd0bfa20ddca75e67465.zip | |
Fix keyword argument parsing. Please bootstrap.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 3 | ||||
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/cl-lib.el | 6 |
4 files changed, 20 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24248ded265..2a0840031b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-03-23 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop' | ||
| 4 | list to look for keyword arguments instead of `memq', fixing | ||
| 5 | (Bug#3647) --- unfortunately, only for freshly-compiled code. | ||
| 6 | Please make bootstrap. | ||
| 7 | |||
| 1 | 2014-03-23 Richard Stallman <rms@gnu.org> | 8 | 2014-03-23 Richard Stallman <rms@gnu.org> |
| 2 | 9 | ||
| 3 | * battery.el (battery-linux-sysfs): Search for each field | 10 | * battery.el (battery-linux-sysfs): Search for each field |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index b1861cf7dfa..ae939c9c0e9 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -503,7 +503,8 @@ its argument list allows full Common Lisp conventions." | |||
| 503 | (varg (if (consp (car arg)) (cl-cadar arg) (car arg))) | 503 | (varg (if (consp (car arg)) (cl-cadar arg) (car arg))) |
| 504 | (def (if (cdr arg) (cadr arg) | 504 | (def (if (cdr arg) (cadr arg) |
| 505 | (or (car cl--bind-defs) (cadr (assq varg cl--bind-defs))))) | 505 | (or (car cl--bind-defs) (cadr (assq varg cl--bind-defs))))) |
| 506 | (look `(memq ',karg ,restarg))) | 506 | (look `(cl-loop for cl--arg on ,restarg by #'cddr |
| 507 | when (eq (car cl--arg) ',karg) return cl--arg))) | ||
| 507 | (and def cl--bind-enquote (setq def `',def)) | 508 | (and def cl--bind-enquote (setq def `',def)) |
| 508 | (if (cddr arg) | 509 | (if (cddr arg) |
| 509 | (let* ((temp (or (nth 2 arg) (make-symbol "--cl-var--"))) | 510 | (let* ((temp (or (nth 2 arg) (make-symbol "--cl-var--"))) |
diff --git a/test/ChangeLog b/test/ChangeLog index 9560397fa3f..15677e76468 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-03-23 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New | ||
| 4 | test: correct parsing of keyword arguments. | ||
| 5 | |||
| 1 | 2014-03-23 Dmitry Gutov <dgutov@yandex.ru> | 6 | 2014-03-23 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 7 | ||
| 3 | * automated/package-test.el (package-test-describe-package): | 8 | * automated/package-test.el (package-test-describe-package): |
diff --git a/test/automated/cl-lib.el b/test/automated/cl-lib.el index 8b6ed6d6634..f7f4314e1cb 100644 --- a/test/automated/cl-lib.el +++ b/test/automated/cl-lib.el | |||
| @@ -195,4 +195,10 @@ | |||
| 195 | (should (eql (cl-mismatch "Aa" "aA") 0)) | 195 | (should (eql (cl-mismatch "Aa" "aA") 0)) |
| 196 | (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) | 196 | (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) |
| 197 | 197 | ||
| 198 | (ert-deftest cl-lib-keyword-names-versus-values () | ||
| 199 | (should (equal | ||
| 200 | (funcall (cl-function (lambda (&key a b) (list a b))) | ||
| 201 | :b :a :a 42) | ||
| 202 | '(42 :a)))) | ||
| 203 | |||
| 198 | ;;; cl-lib.el ends here | 204 | ;;; cl-lib.el ends here |