diff options
| author | Paul Eggert | 2015-02-06 19:28:09 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-02-06 19:28:56 -0800 |
| commit | cf498e5b9a73329edea0bdbf1bd8dfe06fdd75e2 (patch) | |
| tree | 8002975a1b3ece544f24d606fe87f2a0098d4b7d /src | |
| parent | 66e6398505356b019edee4477b6d4f5f8cdec42d (diff) | |
| download | emacs-cf498e5b9a73329edea0bdbf1bd8dfe06fdd75e2.tar.gz emacs-cf498e5b9a73329edea0bdbf1bd8dfe06fdd75e2.zip | |
Remove no-longer-used cursor_in_echo_area code
* dispnew.c (set_window_cursor_after_update, update_frame_1):
Remove checks for negative cursor_in_echo_area, since this var is
a boolean, and has been a boolean for some time. Simplify.
* dispnew.c (init_display):
* xdisp.c (message3_nolog, vmessage): Use bool for boolean.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/dispnew.c | 135 | ||||
| -rw-r--r-- | src/xdisp.c | 4 |
3 files changed, 66 insertions, 82 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 15d8d27a921..cd72f98c116 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2015-02-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Remove no-longer-used cursor_in_echo_area code | ||
| 4 | * dispnew.c (set_window_cursor_after_update, update_frame_1): | ||
| 5 | Remove checks for negative cursor_in_echo_area, since this var is | ||
| 6 | a boolean, and has been a boolean for some time. Simplify. | ||
| 7 | * dispnew.c (init_display): | ||
| 8 | * xdisp.c (message3_nolog, vmessage): Use bool for boolean. | ||
| 9 | |||
| 1 | 2015-02-05 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2015-02-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * eval.c (Ffunction): Handle the new (:documentation ...) form. | 12 | * eval.c (Ffunction): Handle the new (:documentation ...) form. |
diff --git a/src/dispnew.c b/src/dispnew.c index 3c8117e6b65..a1782913154 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3904,45 +3904,35 @@ set_window_cursor_after_update (struct window *w) | |||
| 3904 | { | 3904 | { |
| 3905 | cx = cy = vpos = hpos = 0; | 3905 | cx = cy = vpos = hpos = 0; |
| 3906 | 3906 | ||
| 3907 | if (cursor_in_echo_area >= 0) | 3907 | /* If the mini-buffer is several lines high, find the last |
| 3908 | line that has any text on it. Note: either all lines | ||
| 3909 | are enabled or none. Otherwise we wouldn't be able to | ||
| 3910 | determine Y. */ | ||
| 3911 | struct glyph_row *last_row = NULL; | ||
| 3912 | int yb = window_text_bottom_y (w); | ||
| 3913 | |||
| 3914 | for (struct glyph_row *row = w->current_matrix->rows; | ||
| 3915 | row->enabled_p && (!last_row || MATRIX_ROW_BOTTOM_Y (row) <= yb); | ||
| 3916 | row++) | ||
| 3917 | if (row->used[TEXT_AREA] && row->glyphs[TEXT_AREA][0].charpos >= 0) | ||
| 3918 | last_row = row; | ||
| 3919 | |||
| 3920 | if (last_row) | ||
| 3908 | { | 3921 | { |
| 3909 | /* If the mini-buffer is several lines high, find the last | 3922 | struct glyph *start = last_row->glyphs[TEXT_AREA]; |
| 3910 | line that has any text on it. Note: either all lines | 3923 | struct glyph *last = start + last_row->used[TEXT_AREA] - 1; |
| 3911 | are enabled or none. Otherwise we wouldn't be able to | ||
| 3912 | determine Y. */ | ||
| 3913 | struct glyph_row *row, *last_row; | ||
| 3914 | struct glyph *glyph; | ||
| 3915 | int yb = window_text_bottom_y (w); | ||
| 3916 | |||
| 3917 | last_row = NULL; | ||
| 3918 | row = w->current_matrix->rows; | ||
| 3919 | while (row->enabled_p | ||
| 3920 | && (last_row == NULL | ||
| 3921 | || MATRIX_ROW_BOTTOM_Y (row) <= yb)) | ||
| 3922 | { | ||
| 3923 | if (row->used[TEXT_AREA] | ||
| 3924 | && row->glyphs[TEXT_AREA][0].charpos >= 0) | ||
| 3925 | last_row = row; | ||
| 3926 | ++row; | ||
| 3927 | } | ||
| 3928 | 3924 | ||
| 3929 | if (last_row) | 3925 | while (last > start && last->charpos < 0) |
| 3930 | { | 3926 | --last; |
| 3931 | struct glyph *start = last_row->glyphs[TEXT_AREA]; | ||
| 3932 | struct glyph *last = start + last_row->used[TEXT_AREA] - 1; | ||
| 3933 | |||
| 3934 | while (last > start && last->charpos < 0) | ||
| 3935 | --last; | ||
| 3936 | 3927 | ||
| 3937 | for (glyph = start; glyph < last; ++glyph) | 3928 | for (struct glyph *glyph = start; glyph < last; glyph++) |
| 3938 | { | 3929 | { |
| 3939 | cx += glyph->pixel_width; | 3930 | cx += glyph->pixel_width; |
| 3940 | ++hpos; | 3931 | hpos++; |
| 3941 | } | ||
| 3942 | |||
| 3943 | cy = last_row->y; | ||
| 3944 | vpos = MATRIX_ROW_VPOS (last_row, w->current_matrix); | ||
| 3945 | } | 3932 | } |
| 3933 | |||
| 3934 | cy = last_row->y; | ||
| 3935 | vpos = MATRIX_ROW_VPOS (last_row, w->current_matrix); | ||
| 3946 | } | 3936 | } |
| 3947 | } | 3937 | } |
| 3948 | else | 3938 | else |
| @@ -4557,58 +4547,43 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p, | |||
| 4557 | && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) | 4547 | && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) |
| 4558 | { | 4548 | { |
| 4559 | int top = WINDOW_TOP_EDGE_LINE (XWINDOW (FRAME_MINIBUF_WINDOW (f))); | 4549 | int top = WINDOW_TOP_EDGE_LINE (XWINDOW (FRAME_MINIBUF_WINDOW (f))); |
| 4560 | int row, col; | 4550 | int col; |
| 4561 | 4551 | ||
| 4562 | if (cursor_in_echo_area < 0) | 4552 | /* Put cursor at the end of the prompt. If the mini-buffer |
| 4553 | is several lines high, find the last line that has | ||
| 4554 | any text on it. */ | ||
| 4555 | int row = FRAME_TOTAL_LINES (f); | ||
| 4556 | do | ||
| 4563 | { | 4557 | { |
| 4564 | /* Negative value of cursor_in_echo_area means put | 4558 | row--; |
| 4565 | cursor at beginning of line. */ | ||
| 4566 | row = top; | ||
| 4567 | col = 0; | 4559 | col = 0; |
| 4568 | } | ||
| 4569 | else | ||
| 4570 | { | ||
| 4571 | /* Positive value of cursor_in_echo_area means put | ||
| 4572 | cursor at the end of the prompt. If the mini-buffer | ||
| 4573 | is several lines high, find the last line that has | ||
| 4574 | any text on it. */ | ||
| 4575 | row = FRAME_TOTAL_LINES (f); | ||
| 4576 | do | ||
| 4577 | { | ||
| 4578 | --row; | ||
| 4579 | col = 0; | ||
| 4580 | 4560 | ||
| 4581 | if (MATRIX_ROW_ENABLED_P (current_matrix, row)) | 4561 | if (MATRIX_ROW_ENABLED_P (current_matrix, row)) |
| 4582 | { | 4562 | { |
| 4583 | /* Frame rows are filled up with spaces that | 4563 | /* Frame rows are filled up with spaces that |
| 4584 | must be ignored here. */ | 4564 | must be ignored here. */ |
| 4585 | struct glyph_row *r = MATRIX_ROW (current_matrix, | 4565 | struct glyph_row *r = MATRIX_ROW (current_matrix, row); |
| 4586 | row); | 4566 | struct glyph *start = r->glyphs[TEXT_AREA]; |
| 4587 | struct glyph *start = r->glyphs[TEXT_AREA]; | 4567 | |
| 4588 | struct glyph *last = start + r->used[TEXT_AREA]; | 4568 | col = r->used[TEXT_AREA]; |
| 4589 | 4569 | while (0 < col && start[col - 1].charpos < 0) | |
| 4590 | while (last > start | 4570 | col--; |
| 4591 | && (last - 1)->charpos < 0) | ||
| 4592 | --last; | ||
| 4593 | |||
| 4594 | col = last - start; | ||
| 4595 | } | ||
| 4596 | } | 4571 | } |
| 4597 | while (row > top && col == 0); | 4572 | } |
| 4573 | while (row > top && col == 0); | ||
| 4598 | 4574 | ||
| 4599 | /* Make sure COL is not out of range. */ | 4575 | /* Make sure COL is not out of range. */ |
| 4600 | if (col >= FRAME_CURSOR_X_LIMIT (f)) | 4576 | if (col >= FRAME_CURSOR_X_LIMIT (f)) |
| 4577 | { | ||
| 4578 | /* If we have another row, advance cursor into it. */ | ||
| 4579 | if (row < FRAME_TOTAL_LINES (f) - 1) | ||
| 4601 | { | 4580 | { |
| 4602 | /* If we have another row, advance cursor into it. */ | 4581 | col = FRAME_LEFT_SCROLL_BAR_COLS (f); |
| 4603 | if (row < FRAME_TOTAL_LINES (f) - 1) | 4582 | row++; |
| 4604 | { | ||
| 4605 | col = FRAME_LEFT_SCROLL_BAR_COLS (f); | ||
| 4606 | row++; | ||
| 4607 | } | ||
| 4608 | /* Otherwise move it back in range. */ | ||
| 4609 | else | ||
| 4610 | col = FRAME_CURSOR_X_LIMIT (f) - 1; | ||
| 4611 | } | 4583 | } |
| 4584 | /* Otherwise move it back in range. */ | ||
| 4585 | else | ||
| 4586 | col = FRAME_CURSOR_X_LIMIT (f) - 1; | ||
| 4612 | } | 4587 | } |
| 4613 | 4588 | ||
| 4614 | cursor_to (f, row, col); | 4589 | cursor_to (f, row, col); |
| @@ -5954,7 +5929,7 @@ init_display (void) | |||
| 5954 | space_glyph.charpos = -1; | 5929 | space_glyph.charpos = -1; |
| 5955 | 5930 | ||
| 5956 | inverse_video = 0; | 5931 | inverse_video = 0; |
| 5957 | cursor_in_echo_area = 0; | 5932 | cursor_in_echo_area = false; |
| 5958 | 5933 | ||
| 5959 | /* Now is the time to initialize this; it's used by init_sys_modes | 5934 | /* Now is the time to initialize this; it's used by init_sys_modes |
| 5960 | during startup. */ | 5935 | during startup. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 5c3e641fdfe..ef9d72d5ab9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10116,7 +10116,7 @@ message3_nolog (Lisp_Object m) | |||
| 10116 | 10116 | ||
| 10117 | fwrite (SDATA (s), SBYTES (s), 1, stderr); | 10117 | fwrite (SDATA (s), SBYTES (s), 1, stderr); |
| 10118 | } | 10118 | } |
| 10119 | if (cursor_in_echo_area == 0) | 10119 | if (!cursor_in_echo_area) |
| 10120 | fprintf (stderr, "\n"); | 10120 | fprintf (stderr, "\n"); |
| 10121 | fflush (stderr); | 10121 | fflush (stderr); |
| 10122 | } | 10122 | } |
| @@ -10258,7 +10258,7 @@ vmessage (const char *m, va_list ap) | |||
| 10258 | putc ('\n', stderr); | 10258 | putc ('\n', stderr); |
| 10259 | noninteractive_need_newline = 0; | 10259 | noninteractive_need_newline = 0; |
| 10260 | vfprintf (stderr, m, ap); | 10260 | vfprintf (stderr, m, ap); |
| 10261 | if (cursor_in_echo_area == 0) | 10261 | if (!cursor_in_echo_area) |
| 10262 | fprintf (stderr, "\n"); | 10262 | fprintf (stderr, "\n"); |
| 10263 | fflush (stderr); | 10263 | fflush (stderr); |
| 10264 | } | 10264 | } |