aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2014-06-07 17:35:27 -0700
committerGlenn Morris2014-06-07 17:35:27 -0700
commit36cf8493aff99b652b2ad8c9e4d55a18688e8484 (patch)
treef8ff499c2ee5e91b20d8576841f0e6bf91d1ba34 /src
parent2be772ff45057215c1c70252008c1f9703ef3bff (diff)
parentda8de2908c35ad1fd5c437486d2ea5f6ebb75ca3 (diff)
downloademacs-36cf8493aff99b652b2ad8c9e4d55a18688e8484.tar.gz
emacs-36cf8493aff99b652b2ad8c9e4d55a18688e8484.zip
Merge from emacs-24; up to 2014-06-01T23:37:59Z!eggert@cs.ucla.edu
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog32
-rw-r--r--src/callproc.c7
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c33
-rw-r--r--src/sysdep.c2
-rw-r--r--src/term.c16
6 files changed, 69 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3b625ebf5d4..4aada1d5279 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12014-06-08 Eli Zaretskii <eliz@gnu.org>
2
3 * sysdep.c (reset_sys_modes): Use cursorX, not curX, as the latter
4 contains garbage on WINDOWSNT (which could potentially infloop at
5 exit).
6
7 Minimize cursor motion during TTY menu updates.
8 * term.c (tty_menu_display): Don't position cursor here.
9 Instead, pass the cursor coordinates to update_frame_with_menu.
10 (tty_menu_activate): Send the hide cursor command only once in an
11 iteration through the outer 'while' loop.
12
13 * dispnew.c (update_frame_1): Accept an additional argument
14 SET_CURSOR_P, and position the cursor at the end of the frame
15 update only if that argument is non-zero. All callers changed to
16 provide the additional argument as non-zero, except for
17 update_frame_with_menu.
18 (update_frame_with_menu): Accept 2 additional arguments ROW and
19 COL; if they are non-negative, instruct update_frame_1 not to
20 position the cursor, and instead position it according to ROW and COL.
21
22 * dispextern.h (update_frame_with_menu): Update prototype.
23
242014-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
25
26 * callproc.c (call_process): Don't check read-only if we don't insert
27 anything (bug#17666).
28
292014-06-08 Eli Zaretskii <eliz@gnu.org>
30
31 * dispnew.c (update_frame_with_menu): Set display_completed.
32
12014-06-07 Eli Zaretskii <eliz@gnu.org> 332014-06-07 Eli Zaretskii <eliz@gnu.org>
2 34
3 * term.c (tty_menu_show) [WINDOWSNT]: Make tty_menu_show extern 35 * term.c (tty_menu_show) [WINDOWSNT]: Make tty_menu_show extern
diff --git a/src/callproc.c b/src/callproc.c
index 38cde017187..9fbc7e5b713 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -805,8 +805,10 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
805 /* Now NREAD is the total amount of data in the buffer. */ 805 /* Now NREAD is the total amount of data in the buffer. */
806 immediate_quit = 0; 806 immediate_quit = 0;
807 807
808 if (NILP (BVAR (current_buffer, enable_multibyte_characters)) 808 if (!nread)
809 && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) 809 ;
810 else if (NILP (BVAR (current_buffer, enable_multibyte_characters))
811 && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
810 insert_1_both (buf, nread, nread, 0, 1, 0); 812 insert_1_both (buf, nread, nread, 0, 1, 0);
811 else 813 else
812 { /* We have to decode the input. */ 814 { /* We have to decode the input. */
@@ -814,6 +816,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
814 ptrdiff_t count1 = SPECPDL_INDEX (); 816 ptrdiff_t count1 = SPECPDL_INDEX ();
815 817
816 XSETBUFFER (curbuf, current_buffer); 818 XSETBUFFER (curbuf, current_buffer);
819 /* FIXME: Call signal_after_change! */
817 prepare_to_modify_buffer (PT, PT, NULL); 820 prepare_to_modify_buffer (PT, PT, NULL);
818 /* We cannot allow after-change-functions be run 821 /* We cannot allow after-change-functions be run
819 during decoding, because that might modify the 822 during decoding, because that might modify the
diff --git a/src/dispextern.h b/src/dispextern.h
index 9ecd4ecdf7e..8ccc3d35d8c 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3454,7 +3454,7 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part,
3454 int *, int *, int *, int *); 3454 int *, int *, int *, int *);
3455extern void redraw_frame (struct frame *); 3455extern void redraw_frame (struct frame *);
3456extern bool update_frame (struct frame *, bool, bool); 3456extern bool update_frame (struct frame *, bool, bool);
3457extern void update_frame_with_menu (struct frame *); 3457extern void update_frame_with_menu (struct frame *, int, int);
3458extern void bitch_at_user (void); 3458extern void bitch_at_user (void);
3459extern void adjust_frame_glyphs (struct frame *); 3459extern void adjust_frame_glyphs (struct frame *);
3460void free_glyphs (struct frame *); 3460void free_glyphs (struct frame *);
diff --git a/src/dispnew.c b/src/dispnew.c
index 7833f8e8af5..163780952a6 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -92,7 +92,7 @@ static void check_matrix_pointers (struct glyph_matrix *,
92static void mirror_line_dance (struct window *, int, int, int *, char *); 92static void mirror_line_dance (struct window *, int, int, int *, char *);
93static bool update_window_tree (struct window *, bool); 93static bool update_window_tree (struct window *, bool);
94static bool update_window (struct window *, bool); 94static bool update_window (struct window *, bool);
95static bool update_frame_1 (struct frame *, bool, bool); 95static bool update_frame_1 (struct frame *, bool, bool, bool);
96static bool scrolling (struct frame *); 96static bool scrolling (struct frame *);
97static void set_window_cursor_after_update (struct window *); 97static void set_window_cursor_after_update (struct window *);
98static void adjust_frame_glyphs_for_window_redisplay (struct frame *); 98static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
@@ -3070,7 +3070,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3070 3070
3071 /* Update the display */ 3071 /* Update the display */
3072 update_begin (f); 3072 update_begin (f);
3073 paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p); 3073 paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1);
3074 update_end (f); 3074 update_end (f);
3075 3075
3076 if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) 3076 if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
@@ -3100,12 +3100,17 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3100 glyphs. This is like the second part of update_frame, but it 3100 glyphs. This is like the second part of update_frame, but it
3101 doesn't call build_frame_matrix, because we already have the 3101 doesn't call build_frame_matrix, because we already have the
3102 desired matrix prepared, and don't want it to be overwritten by the 3102 desired matrix prepared, and don't want it to be overwritten by the
3103 text of the normal display. */ 3103 text of the normal display.
3104
3105 ROW and COL, if non-negative, are the row and column of the TTY
3106 frame where to position the cursor after the frame update is
3107 complete. Negative values mean ask update_frame_1 to position the
3108 cursor "normally", i.e. at point in the selected window. */
3104void 3109void
3105update_frame_with_menu (struct frame *f) 3110update_frame_with_menu (struct frame *f, int row, int col)
3106{ 3111{
3107 struct window *root_window = XWINDOW (f->root_window); 3112 struct window *root_window = XWINDOW (f->root_window);
3108 bool paused_p; 3113 bool paused_p, cursor_at_point_p;
3109 3114
3110 eassert (FRAME_TERMCAP_P (f)); 3115 eassert (FRAME_TERMCAP_P (f));
3111 3116
@@ -3115,9 +3120,14 @@ update_frame_with_menu (struct frame *f)
3115 3120
3116 /* Update the display. */ 3121 /* Update the display. */
3117 update_begin (f); 3122 update_begin (f);
3123 cursor_at_point_p = !(row >= 0 && col >= 0);
3118 /* Force update_frame_1 not to stop due to pending input, and not 3124 /* Force update_frame_1 not to stop due to pending input, and not
3119 try scrolling. */ 3125 try scrolling. */
3120 paused_p = update_frame_1 (f, 1, 1); 3126 paused_p = update_frame_1 (f, 1, 1, cursor_at_point_p);
3127 /* ROW and COL tell us where in the menu to position the cursor, so
3128 that screen readers know the active region on the screen. */
3129 if (!cursor_at_point_p)
3130 cursor_to (f, row, col);
3121 update_end (f); 3131 update_end (f);
3122 3132
3123 if (FRAME_TTY (f)->termscript) 3133 if (FRAME_TTY (f)->termscript)
@@ -3132,12 +3142,11 @@ update_frame_with_menu (struct frame *f)
3132 check_window_matrix_pointers (root_window); 3142 check_window_matrix_pointers (root_window);
3133#endif 3143#endif
3134 add_frame_display_history (f, paused_p); 3144 add_frame_display_history (f, paused_p);
3135#else
3136 IF_LINT ((void) paused_p);
3137#endif 3145#endif
3138 3146
3139 /* Reset flags indicating that a window should be updated. */ 3147 /* Reset flags indicating that a window should be updated. */
3140 set_window_update_flags (root_window, false); 3148 set_window_update_flags (root_window, false);
3149 display_completed = !paused_p;
3141} 3150}
3142 3151
3143 3152
@@ -4414,12 +4423,14 @@ scrolling_window (struct window *w, bool header_line_p)
4414/* Update the desired frame matrix of frame F. 4423/* Update the desired frame matrix of frame F.
4415 4424
4416 FORCE_P means that the update should not be stopped by pending input. 4425 FORCE_P means that the update should not be stopped by pending input.
4417 INHIBIT_HAIRY_ID_P means that scrolling should not be tried. 4426 INHIBIT_ID_P means that scrolling by insert/delete should not be tried.
4427 SET_CURSOR_P false means do not set cursor at point in selected window.
4418 4428
4419 Value is true if update was stopped due to pending input. */ 4429 Value is true if update was stopped due to pending input. */
4420 4430
4421static bool 4431static bool
4422update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p) 4432update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
4433 bool set_cursor_p)
4423{ 4434{
4424 /* Frame matrices to work on. */ 4435 /* Frame matrices to work on. */
4425 struct glyph_matrix *current_matrix = f->current_matrix; 4436 struct glyph_matrix *current_matrix = f->current_matrix;
@@ -4491,7 +4502,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p)
4491 pause_p = 0 < i && i < FRAME_LINES (f) - 1; 4502 pause_p = 0 < i && i < FRAME_LINES (f) - 1;
4492 4503
4493 /* Now just clean up termcap drivers and set cursor, etc. */ 4504 /* Now just clean up termcap drivers and set cursor, etc. */
4494 if (!pause_p) 4505 if (!pause_p && set_cursor_p)
4495 { 4506 {
4496 if ((cursor_in_echo_area 4507 if ((cursor_in_echo_area
4497 /* If we are showing a message instead of the mini-buffer, 4508 /* If we are showing a message instead of the mini-buffer,
diff --git a/src/sysdep.c b/src/sysdep.c
index 480813e6cbc..2eedd1fc6cb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1270,7 +1270,7 @@ reset_sys_modes (struct tty_display_info *tty_out)
1270 int i; 1270 int i;
1271 tty_turn_off_insert (tty_out); 1271 tty_turn_off_insert (tty_out);
1272 1272
1273 for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++) 1273 for (i = cursorX (tty_out); i < FrameCols (tty_out) - 1; i++)
1274 { 1274 {
1275 fputc (' ', tty_out->output); 1275 fputc (' ', tty_out->output);
1276 } 1276 }
diff --git a/src/term.c b/src/term.c
index eaac66c3a41..37a938e338d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2934,8 +2934,7 @@ tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces,
2934 display_tty_menu_item (menu->text[j], max_width, face, x, y + i, 2934 display_tty_menu_item (menu->text[j], max_width, face, x, y + i,
2935 menu->submenu[j] != NULL); 2935 menu->submenu[j] != NULL);
2936 } 2936 }
2937 update_frame_with_menu (sf); 2937 update_frame_with_menu (sf, row, col);
2938 cursor_to (sf, row, col);
2939} 2938}
2940 2939
2941/* --------------------------- X Menu emulation ---------------------- */ 2940/* --------------------------- X Menu emulation ---------------------- */
@@ -3106,7 +3105,7 @@ static void
3106screen_update (struct frame *f, struct glyph_matrix *mtx) 3105screen_update (struct frame *f, struct glyph_matrix *mtx)
3107{ 3106{
3108 restore_desired_matrix (f, mtx); 3107 restore_desired_matrix (f, mtx);
3109 update_frame_with_menu (f); 3108 update_frame_with_menu (f, -1, -1);
3110} 3109}
3111 3110
3112typedef enum { 3111typedef enum {
@@ -3255,7 +3254,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3255 3254
3256 /* Force update of the current frame, so that the desired and the 3255 /* Force update of the current frame, so that the desired and the
3257 current matrices are identical. */ 3256 current matrices are identical. */
3258 update_frame_with_menu (sf); 3257 update_frame_with_menu (sf, -1, -1);
3259 state[0].menu = menu; 3258 state[0].menu = menu;
3260 state[0].screen_behind = save_and_enable_current_matrix (sf); 3259 state[0].screen_behind = save_and_enable_current_matrix (sf);
3261 3260
@@ -3400,8 +3399,6 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3400 state[statecount - 1].y, 3399 state[statecount - 1].y,
3401 state[statecount - 1].pane, 3400 state[statecount - 1].pane,
3402 faces, x, y, first_item, 1); 3401 faces, x, y, first_item, 1);
3403 tty_hide_cursor (tty);
3404 fflush (tty->output);
3405 /* The call to display help-echo below will move the cursor, 3402 /* The call to display help-echo below will move the cursor,
3406 so remember its current position as computed by 3403 so remember its current position as computed by
3407 tty_menu_display. */ 3404 tty_menu_display. */
@@ -3420,10 +3417,13 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3420 item, so that screen readers and other accessibility aids 3417 item, so that screen readers and other accessibility aids
3421 know where the active region is. */ 3418 know where the active region is. */
3422 cursor_to (sf, row, col); 3419 cursor_to (sf, row, col);
3423 tty_hide_cursor (tty);
3424 fflush (tty->output);
3425 prev_menu_help_message = menu_help_message; 3420 prev_menu_help_message = menu_help_message;
3426 } 3421 }
3422 /* Both tty_menu_display and help_callback invoke update_end,
3423 which calls tty_show_cursor. Re-hide it, so it doesn't show
3424 through the menus. */
3425 tty_hide_cursor (tty);
3426 fflush (tty->output);
3427 } 3427 }
3428 3428
3429 sf->mouse_moved = 0; 3429 sf->mouse_moved = 0;