diff options
| author | Gerd Moellmann | 2001-07-26 13:14:02 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-07-26 13:14:02 +0000 |
| commit | d63931a26f6390e3dd44ec52bdb211ef46d4f604 (patch) | |
| tree | bf2028a3c3d64df6b7586c19f1b64b09be8055d3 /src | |
| parent | f6e6cdf26a9cba29ddd2b042c03d5ea84ed7637b (diff) | |
| download | emacs-d63931a26f6390e3dd44ec52bdb211ef46d4f604.tar.gz emacs-d63931a26f6390e3dd44ec52bdb211ef46d4f604.zip | |
(Vx_max_tooltip_size): New variable.
(syms_of_xfns): DEFVAR_LISP it.
(Fx_show_tip): Set frame's window_width to the width of the
window. Use a maximum tooltip size specified by
Vx_max_tooltip_size, if that has valid contents.
(x_create_tip_frame): Set tooltip buffer's truncate-lines to nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/src/xfns.c b/src/xfns.c index 1713c8ef963..0b1a492a758 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -10484,6 +10484,10 @@ Window tip_window; | |||
| 10484 | 10484 | ||
| 10485 | Lisp_Object last_show_tip_args; | 10485 | Lisp_Object last_show_tip_args; |
| 10486 | 10486 | ||
| 10487 | /* Maximum size for tooltips; a cons (COLUMNS . ROWS). */ | ||
| 10488 | |||
| 10489 | Lisp_Object Vx_max_tooltip_size; | ||
| 10490 | |||
| 10487 | 10491 | ||
| 10488 | static Lisp_Object | 10492 | static Lisp_Object |
| 10489 | unwind_create_tip_frame (frame) | 10493 | unwind_create_tip_frame (frame) |
| @@ -10557,6 +10561,7 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 10557 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); | 10561 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); |
| 10558 | old_buffer = current_buffer; | 10562 | old_buffer = current_buffer; |
| 10559 | set_buffer_internal_1 (XBUFFER (buffer)); | 10563 | set_buffer_internal_1 (XBUFFER (buffer)); |
| 10564 | current_buffer->truncate_lines = Qnil; | ||
| 10560 | Ferase_buffer (); | 10565 | Ferase_buffer (); |
| 10561 | Finsert (1, &text); | 10566 | Finsert (1, &text); |
| 10562 | set_buffer_internal_1 (old_buffer); | 10567 | set_buffer_internal_1 (old_buffer); |
| @@ -10893,7 +10898,7 @@ DY added (default is -10).") | |||
| 10893 | { | 10898 | { |
| 10894 | struct frame *f; | 10899 | struct frame *f; |
| 10895 | struct window *w; | 10900 | struct window *w; |
| 10896 | Lisp_Object buffer, top, left; | 10901 | Lisp_Object buffer, top, left, max_width, max_height; |
| 10897 | int root_x, root_y; | 10902 | int root_x, root_y; |
| 10898 | struct buffer *old_buffer; | 10903 | struct buffer *old_buffer; |
| 10899 | struct text_pos pos; | 10904 | struct text_pos pos; |
| @@ -10981,19 +10986,33 @@ DY added (default is -10).") | |||
| 10981 | frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string); | 10986 | frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string); |
| 10982 | f = XFRAME (frame); | 10987 | f = XFRAME (frame); |
| 10983 | 10988 | ||
| 10984 | /* Set up the frame's root window. Currently we use a size of 80 | 10989 | /* Set up the frame's root window. */ |
| 10985 | columns x 40 lines. If someone wants to show a larger tip, he | ||
| 10986 | will loose. I don't think this is a realistic case. */ | ||
| 10987 | w = XWINDOW (FRAME_ROOT_WINDOW (f)); | 10990 | w = XWINDOW (FRAME_ROOT_WINDOW (f)); |
| 10988 | w->left = w->top = make_number (0); | 10991 | w->left = w->top = make_number (0); |
| 10989 | w->width = make_number (80); | 10992 | |
| 10990 | w->height = make_number (40); | 10993 | if (CONSP (Vx_max_tooltip_size) |
| 10994 | && INTEGERP (XCAR (Vx_max_tooltip_size)) | ||
| 10995 | && XINT (XCAR (Vx_max_tooltip_size)) > 0 | ||
| 10996 | && INTEGERP (XCDR (Vx_max_tooltip_size)) | ||
| 10997 | && XINT (XCDR (Vx_max_tooltip_size)) > 0) | ||
| 10998 | { | ||
| 10999 | w->width = XCAR (Vx_max_tooltip_size); | ||
| 11000 | w->height = XCDR (Vx_max_tooltip_size); | ||
| 11001 | } | ||
| 11002 | else | ||
| 11003 | { | ||
| 11004 | w->width = make_number (80); | ||
| 11005 | w->height = make_number (40); | ||
| 11006 | } | ||
| 11007 | |||
| 11008 | f->window_width = XINT (w->width); | ||
| 10991 | adjust_glyphs (f); | 11009 | adjust_glyphs (f); |
| 10992 | w->pseudo_window_p = 1; | 11010 | w->pseudo_window_p = 1; |
| 10993 | 11011 | ||
| 10994 | /* Display the tooltip text in a temporary buffer. */ | 11012 | /* Display the tooltip text in a temporary buffer. */ |
| 10995 | old_buffer = current_buffer; | 11013 | old_buffer = current_buffer; |
| 10996 | set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); | 11014 | set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); |
| 11015 | current_buffer->truncate_lines = Qnil; | ||
| 10997 | clear_glyph_matrix (w->desired_matrix); | 11016 | clear_glyph_matrix (w->desired_matrix); |
| 10998 | clear_glyph_matrix (w->current_matrix); | 11017 | clear_glyph_matrix (w->current_matrix); |
| 10999 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 11018 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| @@ -11359,8 +11378,9 @@ usual X keysyms.") | |||
| 11359 | && (delete_keycode == 0 || backspace_keycode == 0)); | 11378 | && (delete_keycode == 0 || backspace_keycode == 0)); |
| 11360 | ++i) | 11379 | ++i) |
| 11361 | { | 11380 | { |
| 11362 | /* The XKB symbolic key names can be seen most easily | 11381 | /* The XKB symbolic key names can be seen most easily in |
| 11363 | in the PS file generated by `xkbprint -label name $DISPLAY'. */ | 11382 | the PS file generated by `xkbprint -label name |
| 11383 | $DISPLAY'. */ | ||
| 11364 | if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0) | 11384 | if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0) |
| 11365 | delete_keycode = i; | 11385 | delete_keycode = i; |
| 11366 | else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) | 11386 | else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) |
| @@ -11596,6 +11616,11 @@ or when you set the mouse color."); | |||
| 11596 | "A string indicating the foreground color of the cursor box."); | 11616 | "A string indicating the foreground color of the cursor box."); |
| 11597 | Vx_cursor_fore_pixel = Qnil; | 11617 | Vx_cursor_fore_pixel = Qnil; |
| 11598 | 11618 | ||
| 11619 | DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, | ||
| 11620 | "Maximum size for tooltips. Value is a pair (COLUMNS . ROWS).\n\ | ||
| 11621 | Text larger than this is clipped."); | ||
| 11622 | Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); | ||
| 11623 | |||
| 11599 | DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, | 11624 | DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, |
| 11600 | "Non-nil if no X window manager is in use.\n\ | 11625 | "Non-nil if no X window manager is in use.\n\ |
| 11601 | Emacs doesn't try to figure this out; this is always nil\n\ | 11626 | Emacs doesn't try to figure this out; this is always nil\n\ |