<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/test/src/eval-tests.el, branch scratch/octave-eldoc-fixes</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Give warning if losing value to defvaralias (Bug#5950)</title>
<updated>2018-06-12T11:40:33+00:00</updated>
<author>
<name>Noam Postavsky</name>
</author>
<published>2018-05-25T12:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c912db0836f6975519dea57fb0a4adc2988da1b1'/>
<id>c912db0836f6975519dea57fb0a4adc2988da1b1</id>
<content type='text'>
* src/eval.c (Fdefvaralias): Call `display-warning' if the alias
target has a non-eq value to the variable being aliased.
* test/src/eval-tests.el (defvaralias-overwrite-warning): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/eval.c (Fdefvaralias): Call `display-warning' if the alias
target has a non-eq value to the variable being aliased.
* test/src/eval-tests.el (defvaralias-overwrite-warning): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid undefined behavior in 'defvar' (Bug#31072)</title>
<updated>2018-04-16T06:50:06+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2018-04-16T06:45:27+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9f2d21ca536ea7ca1da98e7bd57ae535ab394997'/>
<id>9f2d21ca536ea7ca1da98e7bd57ae535ab394997</id>
<content type='text'>
* src/eval.c (Fdefvar): Check that first argument is a symbol.
* test/src/eval-tests.el (defvar/bug31072): New unit test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/eval.c (Fdefvar): Check that first argument is a symbol.
* test/src/eval-tests.el (defvar/bug31072): New unit test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow `&amp;rest' or `&amp;optional' without following variable (Bug#29165)</title>
<updated>2018-03-25T11:56:35+00:00</updated>
<author>
<name>Noam Postavsky</name>
</author>
<published>2018-01-20T16:27:23+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1d47d777ef24c0be9153b0a1c8ba21918fa1025a'/>
<id>1d47d777ef24c0be9153b0a1c8ba21918fa1025a</id>
<content type='text'>
This is sometimes convenient when writing macros, so that the empty
variable case doesn't need to be handled specially.  Older versions of
Emacs accepted this in some cases (especially the interpreter in Emacs
25 and below was very accepting).

                            |   interpreted/compiled   |
| arglist                   | 25 &amp; earlier | 26  | 27  |
|---------------------------+--------------+-----+-----|
| (&amp;rest)                   | y/n          | n/n | y/y |
| (&amp;rest &amp;rest)             | y/n          | n/n | n/n |
| (&amp;rest &amp;rest x)           | y/n          | n/n | n/n |
| (&amp;rest x &amp;rest)           | y/n          | n/n | n/n |
| (&amp;rest x &amp;rest y)         | y/n          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&amp;optional)               | y/n          | n/n | y/y |
| (&amp;optional &amp;optional)     | y/n          | n/n | n/n |
| (&amp;optional x &amp;optional)   | y/n          | n/n | n/n |
| (&amp;optional x &amp;optional y) | y/y          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&amp;optional &amp;rest)         | y/n          | n/n | y/y |
| (&amp;optional x &amp;rest)       | y/n          | n/n | y/y |
| (&amp;optional &amp;rest y)       | y/y          | n/n | y/y |
|---------------------------+--------------+-----+-----|
| (&amp;rest &amp;optional)         | y/n          | n/n | n/n |
| (&amp;rest &amp;optional y)       | y/n          | n/n | n/n |
| (&amp;rest x &amp;optional y)     | y/n          | n/n | n/n |

The values in the table above can be produced with the following code:

(with-current-buffer (get-buffer-create "*ck-args*")
  (erase-buffer)
  (dolist (arglist '((&amp;rest)
                     (&amp;rest &amp;rest)
                     (&amp;rest &amp;rest x)
                     (&amp;rest x &amp;rest)
                     (&amp;rest x &amp;rest y)
                     (&amp;optional)
                     (&amp;optional &amp;optional)
                     (&amp;optional x &amp;optional)
                     (&amp;optional x &amp;optional y)
                     (&amp;optional &amp;rest)
                     (&amp;optional x &amp;rest)
                     (&amp;optional &amp;rest y)
                     (&amp;rest &amp;optional)
                     (&amp;rest &amp;optional y)
                     (&amp;rest x &amp;optional y)))
    (insert
     (format "%c/%c\n"
             (condition-case err
                 (progn (funcall `(lambda ,arglist 'ok))
                        ?y)
               (error ?n))
             (condition-case err
                 (progn (byte-compile-check-lambda-list arglist)
                        ?y)
               (error ?n))))
    (display-buffer (current-buffer))))

* src/eval.c (funcall_lambda):
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): Don't
check for missing variables after `&amp;rest' and `&amp;optional'.
* test/src/eval-tests.el (eval-tests--bugs-24912-and-24913)
(eval-tests-accept-empty-optional-rest): Update tests accordingly.
* etc/NEWS: Update announcement accordingly.
* doc/lispref/functions.texi (Argument List): Update manual to
indicate that variable names are optional.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is sometimes convenient when writing macros, so that the empty
variable case doesn't need to be handled specially.  Older versions of
Emacs accepted this in some cases (especially the interpreter in Emacs
25 and below was very accepting).

                            |   interpreted/compiled   |
| arglist                   | 25 &amp; earlier | 26  | 27  |
|---------------------------+--------------+-----+-----|
| (&amp;rest)                   | y/n          | n/n | y/y |
| (&amp;rest &amp;rest)             | y/n          | n/n | n/n |
| (&amp;rest &amp;rest x)           | y/n          | n/n | n/n |
| (&amp;rest x &amp;rest)           | y/n          | n/n | n/n |
| (&amp;rest x &amp;rest y)         | y/n          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&amp;optional)               | y/n          | n/n | y/y |
| (&amp;optional &amp;optional)     | y/n          | n/n | n/n |
| (&amp;optional x &amp;optional)   | y/n          | n/n | n/n |
| (&amp;optional x &amp;optional y) | y/y          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&amp;optional &amp;rest)         | y/n          | n/n | y/y |
| (&amp;optional x &amp;rest)       | y/n          | n/n | y/y |
| (&amp;optional &amp;rest y)       | y/y          | n/n | y/y |
|---------------------------+--------------+-----+-----|
| (&amp;rest &amp;optional)         | y/n          | n/n | n/n |
| (&amp;rest &amp;optional y)       | y/n          | n/n | n/n |
| (&amp;rest x &amp;optional y)     | y/n          | n/n | n/n |

The values in the table above can be produced with the following code:

(with-current-buffer (get-buffer-create "*ck-args*")
  (erase-buffer)
  (dolist (arglist '((&amp;rest)
                     (&amp;rest &amp;rest)
                     (&amp;rest &amp;rest x)
                     (&amp;rest x &amp;rest)
                     (&amp;rest x &amp;rest y)
                     (&amp;optional)
                     (&amp;optional &amp;optional)
                     (&amp;optional x &amp;optional)
                     (&amp;optional x &amp;optional y)
                     (&amp;optional &amp;rest)
                     (&amp;optional x &amp;rest)
                     (&amp;optional &amp;rest y)
                     (&amp;rest &amp;optional)
                     (&amp;rest &amp;optional y)
                     (&amp;rest x &amp;optional y)))
    (insert
     (format "%c/%c\n"
             (condition-case err
                 (progn (funcall `(lambda ,arglist 'ok))
                        ?y)
               (error ?n))
             (condition-case err
                 (progn (byte-compile-check-lambda-list arglist)
                        ?y)
               (error ?n))))
    (display-buffer (current-buffer))))

* src/eval.c (funcall_lambda):
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): Don't
check for missing variables after `&amp;rest' and `&amp;optional'.
* test/src/eval-tests.el (eval-tests--bugs-24912-and-24913)
(eval-tests-accept-empty-optional-rest): Update tests accordingly.
* etc/NEWS: Update announcement accordingly.
* doc/lispref/functions.texi (Argument List): Update manual to
indicate that variable names are optional.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid memory corruption with specpdl overflow + edebug (Bug#30481)</title>
<updated>2018-02-17T03:13:34+00:00</updated>
<author>
<name>Noam Postavsky</name>
</author>
<published>2018-02-16T03:13:51+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c352434ab89617b48c7c1f29342a22e5a5685504'/>
<id>c352434ab89617b48c7c1f29342a22e5a5685504</id>
<content type='text'>
If grow_specpdl fails due to outgrowing max_specpdl_size, it will
signal an error *before* growing the specpdl array.  Therefore, when
handling the signal, specpdl_ptr points past the end of the specpdl
array and any further use of of specpdl before unwinding (e.g., if
edebug binds signal-hook-function) will cause memory corruption.
* src/eval.c (signal_or_quit): Don't call `signal-hook-function' if
the specpdl_ptr is already past the end of the specpdl array.
* test/src/eval-tests.el (eval-tests--exceed-specbind-limit)
(eval-exceed-specbind-with-signal-hook): New test &amp; helper function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If grow_specpdl fails due to outgrowing max_specpdl_size, it will
signal an error *before* growing the specpdl array.  Therefore, when
handling the signal, specpdl_ptr points past the end of the specpdl
array and any further use of of specpdl before unwinding (e.g., if
edebug binds signal-hook-function) will cause memory corruption.
* src/eval.c (signal_or_quit): Don't call `signal-hook-function' if
the specpdl_ptr is already past the end of the specpdl array.
* test/src/eval-tests.el (eval-tests--exceed-specbind-limit)
(eval-exceed-specbind-with-signal-hook): New test &amp; helper function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2018</title>
<updated>2018-01-01T08:57:59+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2018-01-01T08:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5c7dd8a783fa2503f042f6671279e5fca38c35cb'/>
<id>5c7dd8a783fa2503f042f6671279e5fca38c35cb</id>
<content type='text'>
Run admin/update-copyright.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run admin/update-copyright.
</pre>
</div>
</content>
</entry>
<entry>
<title>; Replace non-ascii quote characters in doc strings etc</title>
<updated>2017-12-20T21:23:11+00:00</updated>
<author>
<name>Glenn Morris</name>
</author>
<published>2017-12-20T21:23:11+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=471b6c163f16fbc0b7c58c223bdb7f18ac7656e7'/>
<id>471b6c163f16fbc0b7c58c223bdb7f18ac7656e7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer HTTPS to FTP and HTTP in documentation</title>
<updated>2017-09-13T22:54:37+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-09-13T22:52:52+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=bc511a64f6da9ab51acc7c8865e80c4a4cb655c2'/>
<id>bc511a64f6da9ab51acc7c8865e80c4a4cb655c2</id>
<content type='text'>
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some crashes on self-modifying Elisp code</title>
<updated>2017-08-06T23:58:35+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-08-06T23:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=93511e94735de5862880f5ea9bf12705c1440363'/>
<id>93511e94735de5862880f5ea9bf12705c1440363</id>
<content type='text'>
Prompted by a problem report by Alex in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html
* src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub):
Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs,
it is likely to run a bit faster with typical hardware caches.
(Fif): Use Fcdr instead of XCDR, to avoid crashing on
self-modifying S-expressions.
(Fsetq, Flet, eval_sub): Count the number of arguments as we go
instead of trusting an Flength prepass, to avoid problems when the
code is self-modifying.
(Fquote, Ffunction, Fdefvar, Fdefconst): Prefer !NILP to CONSP
where either will do.  This is mostly to document the fact that
the value must be a proper list.  It's also a tiny bit faster on
typical machines nowadays.
(Fdefconst, FletX): Prefer XCAR+XCDR to Fcar+Fcdr when either will do.
(eval_sub): Check that the args are a list as opposed to some
other object that has a length. This prevents e.g. (if . "string")
from making Emacs dump core in some cases.
* test/src/eval-tests.el (eval-tests--if-dot-string)
(eval-tests--let-with-circular-defs, eval-tests--mutating-cond):
New tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prompted by a problem report by Alex in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html
* src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub):
Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs,
it is likely to run a bit faster with typical hardware caches.
(Fif): Use Fcdr instead of XCDR, to avoid crashing on
self-modifying S-expressions.
(Fsetq, Flet, eval_sub): Count the number of arguments as we go
instead of trusting an Flength prepass, to avoid problems when the
code is self-modifying.
(Fquote, Ffunction, Fdefvar, Fdefconst): Prefer !NILP to CONSP
where either will do.  This is mostly to document the fact that
the value must be a proper list.  It's also a tiny bit faster on
typical machines nowadays.
(Fdefconst, FletX): Prefer XCAR+XCDR to Fcar+Fcdr when either will do.
(eval_sub): Check that the args are a list as opposed to some
other object that has a length. This prevents e.g. (if . "string")
from making Emacs dump core in some cases.
* test/src/eval-tests.el (eval-tests--if-dot-string)
(eval-tests--let-with-circular-defs, eval-tests--mutating-cond):
New tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't require bytecomp for running ert tests</title>
<updated>2017-04-23T03:17:59+00:00</updated>
<author>
<name>Noam Postavsky</name>
</author>
<published>2017-04-05T03:48:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b20d05c6d76ddaf7e70da1430c9aac56ef1d6b31'/>
<id>b20d05c6d76ddaf7e70da1430c9aac56ef1d6b31</id>
<content type='text'>
"Fix ert-tests when running compiled" 2016-12-06 accidentally
introduced a dependency on `bytecomp' into `ert'.  As mentioned in
"Avoid ert test failures" 2017-04-18, the accidental dependency of ert
on bytecomp was masked by loading other libraries until recently.

* lisp/emacs-lisp/ert.el (ert--expand-should-1): Only use
`byte-compile-macro-environment' if it's bound.
* test/src/eval-tests.el: Add defvar for dynamic variable
`byte-compile-debug'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"Fix ert-tests when running compiled" 2016-12-06 accidentally
introduced a dependency on `bytecomp' into `ert'.  As mentioned in
"Avoid ert test failures" 2017-04-18, the accidental dependency of ert
on bytecomp was masked by loading other libraries until recently.

* lisp/emacs-lisp/ert.el (ert--expand-should-1): Only use
`byte-compile-macro-environment' if it's bound.
* test/src/eval-tests.el: Add defvar for dynamic variable
`byte-compile-debug'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check that variable lists are actually lists</title>
<updated>2017-01-19T16:17:50+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2017-01-18T18:49:58+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9c4e3097b595c739bb29261759b9ba631431329e'/>
<id>9c4e3097b595c739bb29261759b9ba631431329e</id>
<content type='text'>
'let' and 'let*' document that their first argument has to be a list,
but don't check for that; instead, they allow (and silently ignore)
other types.  Introduce an explicit type check.

* src/eval.c (Flet, FletX): Check that the variable list is indeed a
list.
* test/src/eval-tests.el: Add unit tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'let' and 'let*' document that their first argument has to be a list,
but don't check for that; instead, they allow (and silently ignore)
other types.  Introduce an explicit type check.

* src/eval.c (Flet, FletX): Check that the variable list is indeed a
list.
* test/src/eval-tests.el: Add unit tests.
</pre>
</div>
</content>
</entry>
</feed>
