diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c index 8745ba9ef99..50de60c936c 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -787,7 +787,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 787 | LOADHIST_ATTACH (sym); | 787 | LOADHIST_ATTACH (sym); |
| 788 | } | 788 | } |
| 789 | else if (!NILP (Vinternal_interpreter_environment) | 789 | else if (!NILP (Vinternal_interpreter_environment) |
| 790 | && !XSYMBOL (sym)->u.s.declared_special) | 790 | && (SYMBOLP (sym) && !XSYMBOL (sym)->u.s.declared_special)) |
| 791 | /* A simple (defvar foo) with lexical scoping does "nothing" except | 791 | /* A simple (defvar foo) with lexical scoping does "nothing" except |
| 792 | declare that var to be dynamically scoped *locally* (i.e. within | 792 | declare that var to be dynamically scoped *locally* (i.e. within |
| 793 | the current file or let-block). */ | 793 | the current file or let-block). */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 11b14e2cf95..04033665d76 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21185,8 +21185,12 @@ maybe_produce_line_number (struct it *it) | |||
| 21185 | an L2R paragraph. */ | 21185 | an L2R paragraph. */ |
| 21186 | tem_it.bidi_it.resolved_level = 2; | 21186 | tem_it.bidi_it.resolved_level = 2; |
| 21187 | 21187 | ||
| 21188 | /* We must leave space for 2 glyphs for continuation and truncation, | ||
| 21189 | and at least one glyph for buffer text. */ | ||
| 21190 | int width_limit = | ||
| 21191 | tem_it.last_visible_x - tem_it.first_visible_x | ||
| 21192 | - 3 * FRAME_COLUMN_WIDTH (it->f); | ||
| 21188 | /* Produce glyphs for the line number in a scratch glyph_row. */ | 21193 | /* Produce glyphs for the line number in a scratch glyph_row. */ |
| 21189 | int n_glyphs_before; | ||
| 21190 | for (const char *p = lnum_buf; *p; p++) | 21194 | for (const char *p = lnum_buf; *p; p++) |
| 21191 | { | 21195 | { |
| 21192 | /* For continuation lines and lines after ZV, instead of a line | 21196 | /* For continuation lines and lines after ZV, instead of a line |
| @@ -21210,18 +21214,18 @@ maybe_produce_line_number (struct it *it) | |||
| 21210 | else | 21214 | else |
| 21211 | tem_it.c = tem_it.char_to_display = *p; | 21215 | tem_it.c = tem_it.char_to_display = *p; |
| 21212 | tem_it.len = 1; | 21216 | tem_it.len = 1; |
| 21213 | n_glyphs_before = scratch_glyph_row.used[TEXT_AREA]; | ||
| 21214 | /* Make sure these glyphs will have a "position" of -1. */ | 21217 | /* Make sure these glyphs will have a "position" of -1. */ |
| 21215 | SET_TEXT_POS (tem_it.position, -1, -1); | 21218 | SET_TEXT_POS (tem_it.position, -1, -1); |
| 21216 | PRODUCE_GLYPHS (&tem_it); | 21219 | PRODUCE_GLYPHS (&tem_it); |
| 21217 | 21220 | ||
| 21218 | /* Stop producing glyphs if we don't have enough space on | 21221 | /* Stop producing glyphs, and refrain from producing the line |
| 21219 | this line. FIXME: should we refrain from producing the | 21222 | number, if we don't have enough space on this line. */ |
| 21220 | line number at all in that case? */ | 21223 | if (tem_it.current_x >= width_limit) |
| 21221 | if (tem_it.current_x > tem_it.last_visible_x) | ||
| 21222 | { | 21224 | { |
| 21223 | scratch_glyph_row.used[TEXT_AREA] = n_glyphs_before; | 21225 | it->lnum_width = 0; |
| 21224 | break; | 21226 | it->lnum_pixel_width = 0; |
| 21227 | bidi_unshelve_cache (itdata, false); | ||
| 21228 | return; | ||
| 21225 | } | 21229 | } |
| 21226 | } | 21230 | } |
| 21227 | 21231 | ||