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
78012bd2
Commit
78012bd2
authored
Sep 11, 2009
by
Andreas Schwab
Browse files
(display_mode_element): Detect cycles.
parent
7e0aa125
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/ChangeLog
src/ChangeLog
+4
-0
src/xdisp.c
src/xdisp.c
+9
-7
No files found.
src/ChangeLog
View file @
78012bd2
2009-09-11 Andreas Schwab <schwab@linux-m68k.org>
* xdisp.c (display_mode_element): Detect cycles.
2009-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
* keymap.c (where_is_internal): Don't erroneously return nil right after
...
...
src/xdisp.c
View file @
78012bd2
...
...
@@ -17750,14 +17750,10 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
}
else if (STRINGP (car) || CONSP (car))
{
register int limit = 5000;
/* Limit is to protect against circular lists.
The limit used to be 50, but if you use enough minor modes,
minor-mode-alist will easily grow past 50. Circular lists
are rather unlikely, so it's better for the limit to be
"too large" rather than "too small". */
Lisp_Object halftail = elt;
int len = 0;
while (CONSP (elt)
&& --limit > 0
&& (precision <= 0 || n < precision))
{
n += display_mode_element (it, depth,
...
...
@@ -17769,6 +17765,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
precision - n, XCAR (elt),
props, risky);
elt = XCDR (elt);
len++;
if ((len & 1) == 0)
halftail = XCDR (halftail);
/* Check for cycle. */
if (EQ (halftail, elt))
break;
}
}
}
...
...
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