diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-05 13:25:37 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-05 13:30:29 -0800 |
commit | 14dd9101ec4838f75addf25bf6b06ef33f8a7e97 (patch) | |
tree | 500eb382ab23735af5b722b5ad7882c05bdfa965 /lisp/emacs-lisp/check-declare.el | |
parent | b7fa6b1f1cee9d1b71553fa665843774d2e5cf3d (diff) | |
download | emacs-14dd9101ec4838f75addf25bf6b06ef33f8a7e97.tar.gz emacs-14dd9101ec4838f75addf25bf6b06ef33f8a7e97.tar.bz2 emacs-14dd9101ec4838f75addf25bf6b06ef33f8a7e97.zip |
Signal list cycles in ‘length’ etc.
Use macros like FOR_EACH_TAIL instead of maybe_quit to
catch list cycles automatically instead of relying on the
user becoming impatient and typing C-g (Bug#25606).
* src/fns.c (Flength, Fmember, Fmemq, Fmemql, Fassq, Fassoc, Frassq)
(Frassoc, Fdelete, Freverse):
Use FOR_EACH_TAIL instead of maybe_quit.
(Fnreverse): Use simple EQ to check for circular list instead
of rarely_quit, as this suffices in this unusual case.
(Fplist_put, Flax_plist_put, Flax_plist_put):
Use FOR_EACH_TAIL_CONS instead of maybe_quit.
(internal_equal): Use FOR_EACH_TAIL_CONS to check lists, instead
of by-hand tail recursion that did not catch cycles.
* src/fns.c (Fsafe_length, Fplist_get):
* src/xdisp.c (display_mode_element):
Use FOR_EACH_TAIL_SAFE instead of by-hand Floyd’s algorithm.
* src/lisp.h (QUIT_COUNT_HEURISTIC): Remove; no longer needed.
(rarely_quit): Simply count toward USHRT_MAX + 1, since the
fancier versions are no longer needed.
(FOR_EACH_TAIL_CONS, FOR_EACH_TAIL_SAFE)
(FOR_EACH_TAIL_INTERNAL): New macros, the last with definiens
mostly taken from FOR_EACH_TAIL.
(FOR_EACH_TAIL): Rewrite in terms of FOR_EACH_TAIL_INTERNAL.
Diffstat (limited to 'lisp/emacs-lisp/check-declare.el')
0 files changed, 0 insertions, 0 deletions