]> code.delx.au - gnu-emacs/commitdiff
Add pcase-defmacro, as well as `quote' and `app' patterns.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 22 Sep 2014 18:22:02 +0000 (14:22 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 22 Sep 2014 18:22:02 +0000 (14:22 -0400)
* loadup.el: Increase max-lisp-eval-depth when macroexpanding macroexp.
* emacs-lisp/pcase.el: Allow (F . ARGS) in `app' patterns.
(pcase--funcall, pcase--eval): New functions.
(pcase--u1): Use them for guard, pred, let, and app.
(\`): Use the new feature to generate better code for vector patterns.
* emacs-lisp/pcase.el: Use pcase-defmacro to handle backquote.
(pcase--upat): Remove.
(pcase--macroexpand): Don't hardcode handling of `.
(pcase--split-consp, pcase--split-vector): Remove.
(pcase--split-equal): Disregard ` since it's expanded away.
(pcase--split-member): Optimize for quote rather than for `.
(pcase--split-pred): Optimize for quote rather than for `.
(pcase--u1): Remove handling of ` (and of `or' and `and').
Quote non-selfquoting values when passing them to `eq'.
Drop `app's let-binding if the variable is not used.
(pcase--q1): Remove.
(`): Define as a pattern macro.
* emacs-lisp/pcase.el (pcase--match): New smart-constructor function.
(pcase--expand pcase--q1, pcase--app-subst-match): Use it.
(pcase--macroexpand): Handle self-quoting patterns here, expand them to
quote patterns.
(pcase--split-match): Don't hoist or/and here any more.
(pcase--split-equal): Optimize quote patterns as well as ` patterns.
(pcase--flip): New helper macro.
(pcase--u1): Optimize the memq case directly.
Don't handle neither self-quoting nor and/or patterns any more.
* emacs-lisp/pcase.el (pcase-defmacro): New macro.
(pcase--macroexpand): New function.
(pcase--expand): Use it.
* emacs-lisp/pcase.el (pcase--app-subst-match, pcase--app-subst-rest):
New optimization functions.
(pcase--u1): Add support for `quote' and `app'.
(pcase): Document them in the docstring.

lisp/ChangeLog
src/ChangeLog
src/fileio.c

index 32806b24ea4925afddea73d457e51a84d714186c..256ec8135111bf110b999ced2fec2a0078480804 100644 (file)
@@ -1,12 +1,11 @@
 2014-09-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * loadup.el: Increase max-lisp-eval-depth while macroexpanding macroexp.el.
-
+       Add pcase-defmacro, as well as `quote' and `app' patterns.
+       * loadup.el: Increase max-lisp-eval-depth when macroexpanding macroexp.
        * emacs-lisp/pcase.el: Allow (F . ARGS) in `app' patterns.
        (pcase--funcall, pcase--eval): New functions.
        (pcase--u1): Use them for guard, pred, let, and app.
        (\`): Use the new feature to generate better code for vector patterns.
-
        * emacs-lisp/pcase.el: Use pcase-defmacro to handle backquote.
        (pcase--upat): Remove.
        (pcase--macroexpand): Don't hardcode handling of `.
@@ -19,7 +18,6 @@
        Drop `app's let-binding if the variable is not used.
        (pcase--q1): Remove.
        (`): Define as a pattern macro.
-
        * emacs-lisp/pcase.el (pcase--match): New smart-constructor function.
        (pcase--expand pcase--q1, pcase--app-subst-match): Use it.
        (pcase--macroexpand): Handle self-quoting patterns here, expand them to
        (pcase--flip): New helper macro.
        (pcase--u1): Optimize the memq case directly.
        Don't handle neither self-quoting nor and/or patterns any more.
-
        * emacs-lisp/pcase.el (pcase-defmacro): New macro.
        (pcase--macroexpand): New function.
        (pcase--expand): Use it.
-
-       Add support for `quote' and `app'.
        * emacs-lisp/pcase.el (pcase--app-subst-match, pcase--app-subst-rest):
        New optimization functions.
        (pcase--u1): Add support for `quote' and `app'.
index b7858c609b49b60032aedbdb86f1455a96e9e56a..5aad2f91834b6fd000bd001361288041245e4de4 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-22  Eli Zaretskii  <eliz@gnu.org>
+
+       * fileio.c (Fexpand_file_name) [DOS_NT]: Make sure newdirlim is
+       always set to a valid value.  Make sure the size passed to alloca
+       is always positive.  (Bug#18516)
+
 2014-09-22  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Avoid extra call to oblookup when interning symbols.
index 80905c63d3a2acd8d047a00710ce507ee23c5b46..13e2c889020144b7ec70c2982bd25e6ab8594bc9 100644 (file)
@@ -1237,6 +1237,8 @@ filesystem tree, not (expand-file-name ".."  dirname).  */)
              newdirlim = adir + SBYTES (tem);
              memcpy (adir, SSDATA (tem), SBYTES (tem) + 1);
            }
+         else
+           newdirlim = adir + strlen (adir);
        }
       if (!adir)
        {
@@ -1383,6 +1385,7 @@ filesystem tree, not (expand-file-name ".."  dirname).  */)
 
   /* Now concatenate the directory and name to new space in the stack frame.  */
   tlen = length + file_name_as_directory_slop + (nmlim - nm) + 1;
+  eassert (tlen > file_name_as_directory_slop + 1);
 #ifdef DOS_NT
   /* Reserve space for drive specifier and escape prefix, since either
      or both may need to be inserted.  (The Microsoft x86 compiler