Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4de81ee0
Commit
4de81ee0
authored
Sep 01, 2010
by
Stefan Monnier
Browse files
* lisp/emacs-lisp/pcase.el (pcase-split-memq): Overenthusiastic optimisation.
(pcase-u1): Handle the case of a lambda pred.
parent
da43765d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/emacs-lisp/pcase.el
lisp/emacs-lisp/pcase.el
+20
-14
lisp/htmlfontify.el
lisp/htmlfontify.el
+1
-1
No files found.
lisp/ChangeLog
View file @
4de81ee0
2010-09-01 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/pcase.el (pcase-split-memq):
Fix overenthusiastic optimisation.
(pcase-u1): Handle the case of a lambda pred.
2010-08-31 Masatake YAMATO <yamato@redhat.com>
* textmodes/nroff-mode.el (nroff-view): New command.
...
...
lisp/emacs-lisp/pcase.el
View file @
4de81ee0
...
...
@@ -290,9 +290,13 @@ MATCH is the pattern that needs to be matched, of the form:
(
defun
pcase-split-memq
(
elems
pat
)
;; Based on pcase-split-eq.
(
cond
;; The same match will give the same result.
;; The same match will give the same result, but we don't know how
;; to check it.
;; (???
;; (cons :pcase-succeed nil))
;; A match for one of the elements may succeed or fail.
((
and
(
eq
(
car-safe
pat
)
'\`
)
(
member
(
cadr
pat
)
elems
))
(
cons
:pcase-succeed
nil
)
)
nil
)
;; A different match will fail if this one succeeds.
((
and
(
eq
(
car-safe
pat
)
'\`
)
;; (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
`
(
,
(
cadr
upat
)
,
sym
)
(
let*
((
exp
(
cadr
upat
))
;; `vs' is an upper bound on the vars we need.
(
vs
(
pcase-fgrep
(
mapcar
#'
car
vars
)
exp
)))
(
if
vs
;; Let's not replace `vars' in `exp' since it's
;; too difficult to do it right, instead just
;; let-bind `vars' around `exp'.
`
(
let
,
(
mapcar
(
lambda
(
var
)
(
list
var
(
cdr
(
assq
var
vars
))))
vs
)
;; FIXME: `vars' can capture `sym'. E.g.
;; (pcase x ((and `(,x . ,y) (pred (fun x)))))
(
,@
exp
,
sym
))
`
(
,@
exp
,
sym
))))
(
vs
(
pcase-fgrep
(
mapcar
#'
car
vars
)
exp
))
(
call
(
if
(
functionp
exp
)
`
(
,
exp
,
sym
)
`
(
,@
exp
,
sym
))))
(
if
(
null
vs
)
call
;; Let's not replace `vars' in `exp' since it's
;; too difficult to do it right, instead just
;; let-bind `vars' around `exp'.
`
(
let
,
(
mapcar
(
lambda
(
var
)
(
list
var
(
cdr
(
assq
var
vars
))))
vs
)
;; FIXME: `vars' can capture `sym'. E.g.
;; (pcase x ((and `(,x . ,y) (pred (fun x)))))
,
call
))))
(
pcase-u1
matches
code
vars
then-rest
)
(
pcase-u
else-rest
))))
((
symbolp
upat
)
...
...
lisp/htmlfontify.el
View file @
4de81ee0
...
...
@@ -2349,7 +2349,7 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'."
;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file)
;;;;;; "hfy-cmap" "hfy-cmap.el" "
3de2db2d213813bb3afe170ffd66cdde
")
;;;;;; "hfy-cmap" "hfy-cmap.el" "
7e622e4b131ea5efbe9d258f719822d6
")
;;; Generated autoloads from hfy-cmap.el
(
autoload
'htmlfontify-load-rgb-file
"hfy-cmap"
"\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment