diff options
| -rw-r--r-- | src/haikufns.c | 27 | ||||
| -rw-r--r-- | src/nsfns.m | 30 | ||||
| -rw-r--r-- | src/pgtkfns.c | 27 | ||||
| -rw-r--r-- | src/xfns.c | 27 |
4 files changed, 102 insertions, 9 deletions
diff --git a/src/haikufns.c b/src/haikufns.c index e0a65b499f4..67f79a31669 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -2330,6 +2330,10 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 2330 | int old_windows_or_buffers_changed = windows_or_buffers_changed; | 2330 | int old_windows_or_buffers_changed = windows_or_buffers_changed; |
| 2331 | specpdl_ref count = SPECPDL_INDEX (); | 2331 | specpdl_ref count = SPECPDL_INDEX (); |
| 2332 | Lisp_Object window, size, tip_buf; | 2332 | Lisp_Object window, size, tip_buf; |
| 2333 | bool displayed; | ||
| 2334 | #ifdef ENABLE_CHECKING | ||
| 2335 | struct glyph_row *row, *end; | ||
| 2336 | #endif | ||
| 2333 | AUTO_STRING (tip, " *tip*"); | 2337 | AUTO_STRING (tip, " *tip*"); |
| 2334 | 2338 | ||
| 2335 | specbind (Qinhibit_redisplay, Qt); | 2339 | specbind (Qinhibit_redisplay, Qt); |
| @@ -2558,7 +2562,26 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 2558 | clear_glyph_matrix (w->desired_matrix); | 2562 | clear_glyph_matrix (w->desired_matrix); |
| 2559 | clear_glyph_matrix (w->current_matrix); | 2563 | clear_glyph_matrix (w->current_matrix); |
| 2560 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 2564 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 2561 | try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); | 2565 | displayed = try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 2566 | |||
| 2567 | if (!displayed && NILP (Vx_max_tooltip_size)) | ||
| 2568 | { | ||
| 2569 | #ifdef ENABLE_CHECKING | ||
| 2570 | row = w->desired_matrix->rows; | ||
| 2571 | end = w->desired_matrix->rows + w->desired_matrix->nrows; | ||
| 2572 | |||
| 2573 | while (row < end) | ||
| 2574 | { | ||
| 2575 | if (!row->displays_text_p | ||
| 2576 | || row->ends_at_zv_p) | ||
| 2577 | break; | ||
| 2578 | ++row; | ||
| 2579 | } | ||
| 2580 | |||
| 2581 | eassert (row < end && row->ends_at_zv_p); | ||
| 2582 | #endif | ||
| 2583 | } | ||
| 2584 | |||
| 2562 | /* Calculate size of tooltip window. */ | 2585 | /* Calculate size of tooltip window. */ |
| 2563 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, | 2586 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, |
| 2564 | make_fixnum (w->pixel_height), Qnil, | 2587 | make_fixnum (w->pixel_height), Qnil, |
| @@ -3179,7 +3202,7 @@ syms_of_haikufns (void) | |||
| 3179 | 3202 | ||
| 3180 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, | 3203 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, |
| 3181 | doc: /* SKIP: real doc in xfns.c. */); | 3204 | doc: /* SKIP: real doc in xfns.c. */); |
| 3182 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); | 3205 | Vx_max_tooltip_size = Qnil; |
| 3183 | 3206 | ||
| 3184 | DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel, | 3207 | DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel, |
| 3185 | doc: /* SKIP: real doc in xfns.c. */); | 3208 | doc: /* SKIP: real doc in xfns.c. */); |
diff --git a/src/nsfns.m b/src/nsfns.m index 16174210669..b0b779bd41c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -3210,7 +3210,8 @@ x_hide_tip (bool delete) | |||
| 3210 | 3210 | ||
| 3211 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | 3211 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, |
| 3212 | doc: /* SKIP: real doc in xfns.c. */) | 3212 | doc: /* SKIP: real doc in xfns.c. */) |
| 3213 | (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) | 3213 | (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, |
| 3214 | Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) | ||
| 3214 | { | 3215 | { |
| 3215 | int root_x, root_y; | 3216 | int root_x, root_y; |
| 3216 | specpdl_ref count = SPECPDL_INDEX (); | 3217 | specpdl_ref count = SPECPDL_INDEX (); |
| @@ -3224,6 +3225,10 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 3224 | Lisp_Object window, size, tip_buf; | 3225 | Lisp_Object window, size, tip_buf; |
| 3225 | char *str; | 3226 | char *str; |
| 3226 | NSWindow *nswindow; | 3227 | NSWindow *nswindow; |
| 3228 | bool displayed; | ||
| 3229 | #ifdef ENABLE_CHECKING | ||
| 3230 | struct glyph_row *row, *end; | ||
| 3231 | #endif | ||
| 3227 | 3232 | ||
| 3228 | AUTO_STRING (tip, " *tip*"); | 3233 | AUTO_STRING (tip, " *tip*"); |
| 3229 | 3234 | ||
| @@ -3454,7 +3459,26 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 3454 | clear_glyph_matrix (w->desired_matrix); | 3459 | clear_glyph_matrix (w->desired_matrix); |
| 3455 | clear_glyph_matrix (w->current_matrix); | 3460 | clear_glyph_matrix (w->current_matrix); |
| 3456 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 3461 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 3457 | try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); | 3462 | displayed = try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 3463 | |||
| 3464 | if (!displayed && NILP (Vx_max_tooltip_size)) | ||
| 3465 | { | ||
| 3466 | #ifdef ENABLE_CHECKING | ||
| 3467 | row = w->desired_matrix->rows; | ||
| 3468 | end = w->desired_matrix->rows + w->desired_matrix->nrows; | ||
| 3469 | |||
| 3470 | while (row < end) | ||
| 3471 | { | ||
| 3472 | if (!row->displays_text_p | ||
| 3473 | || row->ends_at_zv_p) | ||
| 3474 | break; | ||
| 3475 | ++row; | ||
| 3476 | } | ||
| 3477 | |||
| 3478 | eassert (row < end && row->ends_at_zv_p); | ||
| 3479 | #endif | ||
| 3480 | } | ||
| 3481 | |||
| 3458 | /* Calculate size of tooltip window. */ | 3482 | /* Calculate size of tooltip window. */ |
| 3459 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, | 3483 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, |
| 3460 | make_fixnum (w->pixel_height), Qnil, | 3484 | make_fixnum (w->pixel_height), Qnil, |
| @@ -3889,7 +3913,7 @@ Default is t. */); | |||
| 3889 | 3913 | ||
| 3890 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, | 3914 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, |
| 3891 | doc: /* SKIP: real doc in xfns.c. */); | 3915 | doc: /* SKIP: real doc in xfns.c. */); |
| 3892 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); | 3916 | Vx_max_tooltip_size = Qnil; |
| 3893 | 3917 | ||
| 3894 | defsubr (&Sns_read_file_name); | 3918 | defsubr (&Sns_read_file_name); |
| 3895 | defsubr (&Sns_get_resource); | 3919 | defsubr (&Sns_get_resource); |
diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 5c43e5f3607..d998c3d938c 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c | |||
| @@ -3130,6 +3130,10 @@ Text larger than the specified size is clipped. */) | |||
| 3130 | int old_windows_or_buffers_changed = windows_or_buffers_changed; | 3130 | int old_windows_or_buffers_changed = windows_or_buffers_changed; |
| 3131 | specpdl_ref count = SPECPDL_INDEX (); | 3131 | specpdl_ref count = SPECPDL_INDEX (); |
| 3132 | Lisp_Object window, size, tip_buf; | 3132 | Lisp_Object window, size, tip_buf; |
| 3133 | bool displayed; | ||
| 3134 | #ifdef ENABLE_CHECKING | ||
| 3135 | struct glyph_row *row, *end; | ||
| 3136 | #endif | ||
| 3133 | AUTO_STRING (tip, " *tip*"); | 3137 | AUTO_STRING (tip, " *tip*"); |
| 3134 | 3138 | ||
| 3135 | specbind (Qinhibit_redisplay, Qt); | 3139 | specbind (Qinhibit_redisplay, Qt); |
| @@ -3334,7 +3338,26 @@ Text larger than the specified size is clipped. */) | |||
| 3334 | clear_glyph_matrix (w->desired_matrix); | 3338 | clear_glyph_matrix (w->desired_matrix); |
| 3335 | clear_glyph_matrix (w->current_matrix); | 3339 | clear_glyph_matrix (w->current_matrix); |
| 3336 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 3340 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 3337 | try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); | 3341 | displayed = try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 3342 | |||
| 3343 | if (!displayed && NILP (Vx_max_tooltip_size)) | ||
| 3344 | { | ||
| 3345 | #ifdef ENABLE_CHECKING | ||
| 3346 | row = w->desired_matrix->rows; | ||
| 3347 | end = w->desired_matrix->rows + w->desired_matrix->nrows; | ||
| 3348 | |||
| 3349 | while (row < end) | ||
| 3350 | { | ||
| 3351 | if (!row->displays_text_p | ||
| 3352 | || row->ends_at_zv_p) | ||
| 3353 | break; | ||
| 3354 | ++row; | ||
| 3355 | } | ||
| 3356 | |||
| 3357 | eassert (row < end && row->ends_at_zv_p); | ||
| 3358 | #endif | ||
| 3359 | } | ||
| 3360 | |||
| 3338 | /* Calculate size of tooltip window. */ | 3361 | /* Calculate size of tooltip window. */ |
| 3339 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, | 3362 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, |
| 3340 | make_fixnum (w->pixel_height), Qnil, | 3363 | make_fixnum (w->pixel_height), Qnil, |
| @@ -3924,7 +3947,7 @@ syms_of_pgtkfns (void) | |||
| 3924 | 3947 | ||
| 3925 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, | 3948 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, |
| 3926 | doc: /* SKIP: real doc in xfns.c. */); | 3949 | doc: /* SKIP: real doc in xfns.c. */); |
| 3927 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); | 3950 | Vx_max_tooltip_size = Qnil; |
| 3928 | 3951 | ||
| 3929 | DEFSYM (Qmono, "mono"); | 3952 | DEFSYM (Qmono, "mono"); |
| 3930 | DEFSYM (Qassq_delete_all, "assq-delete-all"); | 3953 | DEFSYM (Qassq_delete_all, "assq-delete-all"); |
diff --git a/src/xfns.c b/src/xfns.c index 44208ffd515..ce867c1619c 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -8623,6 +8623,10 @@ Text larger than the specified size is clipped. */) | |||
| 8623 | Window child; | 8623 | Window child; |
| 8624 | XWindowAttributes child_attrs; | 8624 | XWindowAttributes child_attrs; |
| 8625 | int dest_x_return, dest_y_return; | 8625 | int dest_x_return, dest_y_return; |
| 8626 | bool displayed; | ||
| 8627 | #ifdef ENABLE_CHECKING | ||
| 8628 | struct glyph_row *row, *end; | ||
| 8629 | #endif | ||
| 8626 | AUTO_STRING (tip, " *tip*"); | 8630 | AUTO_STRING (tip, " *tip*"); |
| 8627 | 8631 | ||
| 8628 | specbind (Qinhibit_redisplay, Qt); | 8632 | specbind (Qinhibit_redisplay, Qt); |
| @@ -8835,7 +8839,26 @@ Text larger than the specified size is clipped. */) | |||
| 8835 | clear_glyph_matrix (w->desired_matrix); | 8839 | clear_glyph_matrix (w->desired_matrix); |
| 8836 | clear_glyph_matrix (w->current_matrix); | 8840 | clear_glyph_matrix (w->current_matrix); |
| 8837 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 8841 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 8838 | try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); | 8842 | displayed = try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 8843 | |||
| 8844 | if (!displayed && NILP (Vx_max_tooltip_size)) | ||
| 8845 | { | ||
| 8846 | #ifdef ENABLE_CHECKING | ||
| 8847 | row = w->desired_matrix->rows; | ||
| 8848 | end = w->desired_matrix->rows + w->desired_matrix->nrows; | ||
| 8849 | |||
| 8850 | while (row < end) | ||
| 8851 | { | ||
| 8852 | if (!row->displays_text_p | ||
| 8853 | || row->ends_at_zv_p) | ||
| 8854 | break; | ||
| 8855 | ++row; | ||
| 8856 | } | ||
| 8857 | |||
| 8858 | eassert (row < end && row->ends_at_zv_p); | ||
| 8859 | #endif | ||
| 8860 | } | ||
| 8861 | |||
| 8839 | /* Calculate size of tooltip window. */ | 8862 | /* Calculate size of tooltip window. */ |
| 8840 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, | 8863 | size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, |
| 8841 | make_fixnum (w->pixel_height), Qnil, | 8864 | make_fixnum (w->pixel_height), Qnil, |
| @@ -9949,7 +9972,7 @@ or when you set the mouse color. */); | |||
| 9949 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, | 9972 | DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, |
| 9950 | doc: /* Maximum size for tooltips. | 9973 | doc: /* Maximum size for tooltips. |
| 9951 | Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); | 9974 | Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); |
| 9952 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); | 9975 | Vx_max_tooltip_size = Qnil; |
| 9953 | 9976 | ||
| 9954 | DEFVAR_LISP ("x-no-window-manager", Vx_no_window_manager, | 9977 | DEFVAR_LISP ("x-no-window-manager", Vx_no_window_manager, |
| 9955 | doc: /* Non-nil if no X window manager is in use. | 9978 | doc: /* Non-nil if no X window manager is in use. |