Lisp_Object last_show_tip_args;
+/* Maximum size for tooltips; a cons (COLUMNS . ROWS). */
+
+Lisp_Object Vx_max_tooltip_size;
+
static Lisp_Object
unwind_create_tip_frame (frame)
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
+ current_buffer->truncate_lines = Qnil;
Ferase_buffer ();
Finsert (1, &text);
set_buffer_internal_1 (old_buffer);
{
struct frame *f;
struct window *w;
- Lisp_Object buffer, top, left;
+ Lisp_Object buffer, top, left, max_width, max_height;
int root_x, root_y;
struct buffer *old_buffer;
struct text_pos pos;
frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string);
f = XFRAME (frame);
- /* Set up the frame's root window. Currently we use a size of 80
- columns x 40 lines. If someone wants to show a larger tip, he
- will loose. I don't think this is a realistic case. */
+ /* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
w->left = w->top = make_number (0);
- w->width = make_number (80);
- w->height = make_number (40);
+
+ if (CONSP (Vx_max_tooltip_size)
+ && INTEGERP (XCAR (Vx_max_tooltip_size))
+ && XINT (XCAR (Vx_max_tooltip_size)) > 0
+ && INTEGERP (XCDR (Vx_max_tooltip_size))
+ && XINT (XCDR (Vx_max_tooltip_size)) > 0)
+ {
+ w->width = XCAR (Vx_max_tooltip_size);
+ w->height = XCDR (Vx_max_tooltip_size);
+ }
+ else
+ {
+ w->width = make_number (80);
+ w->height = make_number (40);
+ }
+
+ f->window_width = XINT (w->width);
adjust_glyphs (f);
w->pseudo_window_p = 1;
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
+ current_buffer->truncate_lines = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
&& (delete_keycode == 0 || backspace_keycode == 0));
++i)
{
- /* The XKB symbolic key names can be seen most easily
- in the PS file generated by `xkbprint -label name $DISPLAY'. */
+ /* The XKB symbolic key names can be seen most easily in
+ the PS file generated by `xkbprint -label name
+ $DISPLAY'. */
if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
delete_keycode = i;
else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
"A string indicating the foreground color of the cursor box.");
Vx_cursor_fore_pixel = Qnil;
+ DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
+ "Maximum size for tooltips. Value is a pair (COLUMNS . ROWS).\n\
+Text larger than this is clipped.");
+ Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
+
DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
"Non-nil if no X window manager is in use.\n\
Emacs doesn't try to figure this out; this is always nil\n\