summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-09-25 11:55:51 +0300
committerEli Zaretskii <eliz@gnu.org>2020-09-25 11:55:51 +0300
commitcc8fef2bddfcf4e1c3bab35a18621dd7666d022e (patch)
tree8f022dfad75b8298d05b2bb17fb9943b3137494b /src
parent395f10cb98af122404bcdc2eb60d30decf297625 (diff)
downloademacs-cc8fef2bddfcf4e1c3bab35a18621dd7666d022e.tar.gz
Avoid infinite recursion with 'relative' line numbers display
* src/xdisp.c (display_count_lines_visually): Bind 'display-line-numbers' to 'relative' around 'start_display' as well, since that can invoke 'move_it_to' internally, thus causing infinite recursion. (Bug#43589)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index d191ef51700..2af6144975a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -22682,10 +22682,11 @@ display_count_lines_visually (struct it *it)
SET_TEXT_POS (from, PT, PT_BYTE);
to = IT_CHARPOS (*it);
}
- start_display (&tem_it, it->w, from);
/* Need to disable visual mode temporarily, since otherwise the
- call to move_it_to will cause infinite recursion. */
+ call to move_it_to below and inside start_display will cause
+ infinite recursion. */
specbind (Qdisplay_line_numbers, Qrelative);
+ start_display (&tem_it, it->w, from);
/* Some redisplay optimizations could invoke us very far from
PT, which will make the caller painfully slow. There should
be no need to go too far beyond the window's bottom, as any