diff options
| author | Stefan Monnier | 2010-09-01 12:03:08 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-09-01 12:03:08 +0200 |
| commit | 4de81ee0d223f3ffda6c22ac630ace93f0fc47f7 (patch) | |
| tree | ad0145f9974fb577529bde4f3efcdec5fa3f55c8 /lisp | |
| parent | da43765da1e8cadedcbb447422ced1840a2ef618 (diff) | |
| download | emacs-4de81ee0d223f3ffda6c22ac630ace93f0fc47f7.tar.gz emacs-4de81ee0d223f3ffda6c22ac630ace93f0fc47f7.zip | |
* lisp/emacs-lisp/pcase.el (pcase-split-memq): Overenthusiastic optimisation.
(pcase-u1): Handle the case of a lambda pred.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/pcase.el | 34 | ||||
| -rw-r--r-- | lisp/htmlfontify.el | 2 |
3 files changed, 27 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4003df33554..f59b457252c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-09-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/pcase.el (pcase-split-memq): | ||
| 4 | Fix overenthusiastic optimisation. | ||
| 5 | (pcase-u1): Handle the case of a lambda pred. | ||
| 6 | |||
| 1 | 2010-08-31 Masatake YAMATO <yamato@redhat.com> | 7 | 2010-08-31 Masatake YAMATO <yamato@redhat.com> |
| 2 | 8 | ||
| 3 | * textmodes/nroff-mode.el (nroff-view): New command. | 9 | * textmodes/nroff-mode.el (nroff-view): New command. |
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 0b46eb2a301..b2b27a0e0d6 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -290,9 +290,13 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 290 | (defun pcase-split-memq (elems pat) | 290 | (defun pcase-split-memq (elems pat) |
| 291 | ;; Based on pcase-split-eq. | 291 | ;; Based on pcase-split-eq. |
| 292 | (cond | 292 | (cond |
| 293 | ;; The same match will give the same result. | 293 | ;; The same match will give the same result, but we don't know how |
| 294 | ;; to check it. | ||
| 295 | ;; (??? | ||
| 296 | ;; (cons :pcase-succeed nil)) | ||
| 297 | ;; A match for one of the elements may succeed or fail. | ||
| 294 | ((and (eq (car-safe pat) '\`) (member (cadr pat) elems)) | 298 | ((and (eq (car-safe pat) '\`) (member (cadr pat) elems)) |
| 295 | (cons :pcase-succeed nil)) | 299 | nil) |
| 296 | ;; A different match will fail if this one succeeds. | 300 | ;; A different match will fail if this one succeeds. |
| 297 | ((and (eq (car-safe pat) '\`) | 301 | ((and (eq (car-safe pat) '\`) |
| 298 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) | 302 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) |
| @@ -383,18 +387,20 @@ and otherwise defers to REST which is a list of branches of the form | |||
| 383 | `(,(cadr upat) ,sym) | 387 | `(,(cadr upat) ,sym) |
| 384 | (let* ((exp (cadr upat)) | 388 | (let* ((exp (cadr upat)) |
| 385 | ;; `vs' is an upper bound on the vars we need. | 389 | ;; `vs' is an upper bound on the vars we need. |
| 386 | (vs (pcase-fgrep (mapcar #'car vars) exp))) | 390 | (vs (pcase-fgrep (mapcar #'car vars) exp)) |
| 387 | (if vs | 391 | (call (if (functionp exp) |
| 388 | ;; Let's not replace `vars' in `exp' since it's | 392 | `(,exp ,sym) `(,@exp ,sym)))) |
| 389 | ;; too difficult to do it right, instead just | 393 | (if (null vs) |
| 390 | ;; let-bind `vars' around `exp'. | 394 | call |
| 391 | `(let ,(mapcar (lambda (var) | 395 | ;; Let's not replace `vars' in `exp' since it's |
| 392 | (list var (cdr (assq var vars)))) | 396 | ;; too difficult to do it right, instead just |
| 393 | vs) | 397 | ;; let-bind `vars' around `exp'. |
| 394 | ;; FIXME: `vars' can capture `sym'. E.g. | 398 | `(let ,(mapcar (lambda (var) |
| 395 | ;; (pcase x ((and `(,x . ,y) (pred (fun x))))) | 399 | (list var (cdr (assq var vars)))) |
| 396 | (,@exp ,sym)) | 400 | vs) |
| 397 | `(,@exp ,sym)))) | 401 | ;; FIXME: `vars' can capture `sym'. E.g. |
| 402 | ;; (pcase x ((and `(,x . ,y) (pred (fun x))))) | ||
| 403 | ,call)))) | ||
| 398 | (pcase-u1 matches code vars then-rest) | 404 | (pcase-u1 matches code vars then-rest) |
| 399 | (pcase-u else-rest)))) | 405 | (pcase-u else-rest)))) |
| 400 | ((symbolp upat) | 406 | ((symbolp upat) |
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 5c491b0c371..bfa81595085 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -2349,7 +2349,7 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'." | |||
| 2349 | 2349 | ||
| 2350 | 2350 | ||
| 2351 | ;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file) | 2351 | ;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file) |
| 2352 | ;;;;;; "hfy-cmap" "hfy-cmap.el" "3de2db2d213813bb3afe170ffd66cdde") | 2352 | ;;;;;; "hfy-cmap" "hfy-cmap.el" "7e622e4b131ea5efbe9d258f719822d6") |
| 2353 | ;;; Generated autoloads from hfy-cmap.el | 2353 | ;;; Generated autoloads from hfy-cmap.el |
| 2354 | 2354 | ||
| 2355 | (autoload 'htmlfontify-load-rgb-file "hfy-cmap" "\ | 2355 | (autoload 'htmlfontify-load-rgb-file "hfy-cmap" "\ |