aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPaul Eggert2017-02-05 13:25:37 -0800
committerPaul Eggert2017-02-05 13:30:29 -0800
commit14dd9101ec4838f75addf25bf6b06ef33f8a7e97 (patch)
tree500eb382ab23735af5b722b5ad7882c05bdfa965 /etc
parentb7fa6b1f1cee9d1b71553fa665843774d2e5cf3d (diff)
downloademacs-14dd9101ec4838f75addf25bf6b06ef33f8a7e97.tar.gz
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 'etc')
-rw-r--r--etc/NEWS3
1 files changed, 3 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index cbf2b70c821..4d8ae091a7c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -900,6 +900,9 @@ collection).
900** 'if-let*', 'when-let*', and 'and-let*' are new in subr-x.el. 900** 'if-let*', 'when-let*', and 'and-let*' are new in subr-x.el.
901The incumbent 'if-let' and 'when-let' are now aliases. 901The incumbent 'if-let' and 'when-let' are now aliases.
902 902
903** Low-level list functions like 'length' and 'member' now do a better
904job of signaling list cycles instead of looping indefinitely.
905
903+++ 906+++
904** The new functions 'make-nearby-temp-file' and 'temporary-file-directory' 907** The new functions 'make-nearby-temp-file' and 'temporary-file-directory'
905can be used for creation of temporary files of remote or mounted directories. 908can be used for creation of temporary files of remote or mounted directories.