diff options
| author | Gerd Moellmann | 2000-11-08 17:40:50 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-08 17:40:50 +0000 |
| commit | 6422c1d71f03cca37363c70a88f870034999aa93 (patch) | |
| tree | de3bf3e3dc3b2b33793f5cb5d3cdc429710d8bb1 /src | |
| parent | 60bd558946caff11d85a82500a88951725d5d880 (diff) | |
| download | emacs-6422c1d71f03cca37363c70a88f870034999aa93.tar.gz emacs-6422c1d71f03cca37363c70a88f870034999aa93.zip | |
(syms_of_xdisp): Change doc of max-mini-window-height.
(resize_mini_window): Return quickly if Vresize_mini_window is
nil. Don't return if Vmax_mini_window_height is nil.
(Vresize_mini_window, Qgrow_only): New variables.
(syms_of_xdisp): Initialize them.
(resize_mini_window): Act according to the setting of
Vresize_mini_window.
(syms_of_xdisp): Initialize Vmenu_bar_update_hook to nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 82 |
1 files changed, 64 insertions, 18 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index d5b16ec571a..2b61c26e59c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -225,6 +225,7 @@ Lisp_Object Qredisplay_end_trigger_functions; | |||
| 225 | Lisp_Object Qinhibit_point_motion_hooks; | 225 | Lisp_Object Qinhibit_point_motion_hooks; |
| 226 | Lisp_Object QCeval, Qwhen, QCfile, QCdata; | 226 | Lisp_Object QCeval, Qwhen, QCfile, QCdata; |
| 227 | Lisp_Object Qfontified; | 227 | Lisp_Object Qfontified; |
| 228 | Lisp_Object Qgrow_only; | ||
| 228 | 229 | ||
| 229 | /* Functions called to fontify regions of text. */ | 230 | /* Functions called to fontify regions of text. */ |
| 230 | 231 | ||
| @@ -550,6 +551,13 @@ int automatic_hscrolling_p; | |||
| 550 | 551 | ||
| 551 | Lisp_Object Vimage_types; | 552 | Lisp_Object Vimage_types; |
| 552 | 553 | ||
| 554 | /* The variable `resize-mini-windows'. If nil, don't resize | ||
| 555 | mini-winodws. If t, always resize them to fit the text they | ||
| 556 | display. If `grow-only', let mini-windows grow only until they | ||
| 557 | become empty. */ | ||
| 558 | |||
| 559 | Lisp_Object Vresize_mini_windows; | ||
| 560 | |||
| 553 | /* Value returned from text property handlers (see below). */ | 561 | /* Value returned from text property handlers (see below). */ |
| 554 | 562 | ||
| 555 | enum prop_handled | 563 | enum prop_handled |
| @@ -6078,7 +6086,7 @@ resize_mini_window (w, exact_p) | |||
| 6078 | xassert (MINI_WINDOW_P (w)); | 6086 | xassert (MINI_WINDOW_P (w)); |
| 6079 | 6087 | ||
| 6080 | /* Nil means don't try to resize. */ | 6088 | /* Nil means don't try to resize. */ |
| 6081 | if (NILP (Vmax_mini_window_height) | 6089 | if (NILP (Vresize_mini_windows) |
| 6082 | || (FRAME_X_P (f) && f->output_data.x == NULL)) | 6090 | || (FRAME_X_P (f) && f->output_data.x == NULL)) |
| 6083 | return 0; | 6091 | return 0; |
| 6084 | 6092 | ||
| @@ -6132,22 +6140,50 @@ resize_mini_window (w, exact_p) | |||
| 6132 | SET_TEXT_POS (start, BEGV, BEGV_BYTE); | 6140 | SET_TEXT_POS (start, BEGV, BEGV_BYTE); |
| 6133 | SET_MARKER_FROM_TEXT_POS (w->start, start); | 6141 | SET_MARKER_FROM_TEXT_POS (w->start, start); |
| 6134 | 6142 | ||
| 6135 | /* Let it grow only, until we display an empty message, in which | 6143 | if (EQ (Vresize_mini_windows, Qgrow_only)) |
| 6136 | case the window shrinks again. */ | ||
| 6137 | if (height > XFASTINT (w->height)) | ||
| 6138 | { | 6144 | { |
| 6139 | int old_height = XFASTINT (w->height); | 6145 | /* Let it grow only, until we display an empty message, in which |
| 6140 | freeze_window_starts (f, 1); | 6146 | case the window shrinks again. */ |
| 6141 | grow_mini_window (w, height - XFASTINT (w->height)); | 6147 | if (height > XFASTINT (w->height)) |
| 6142 | window_height_changed_p = XFASTINT (w->height) != old_height; | 6148 | { |
| 6149 | int old_height = XFASTINT (w->height); | ||
| 6150 | freeze_window_starts (f, 1); | ||
| 6151 | grow_mini_window (w, height - XFASTINT (w->height)); | ||
| 6152 | window_height_changed_p = XFASTINT (w->height) != old_height; | ||
| 6153 | } | ||
| 6154 | else if (height < XFASTINT (w->height) | ||
| 6155 | && (exact_p || BEGV == ZV)) | ||
| 6156 | { | ||
| 6157 | int old_height = XFASTINT (w->height); | ||
| 6158 | freeze_window_starts (f, 0); | ||
| 6159 | shrink_mini_window (w); | ||
| 6160 | window_height_changed_p = XFASTINT (w->height) != old_height; | ||
| 6161 | } | ||
| 6143 | } | 6162 | } |
| 6144 | else if (height < XFASTINT (w->height) | 6163 | else |
| 6145 | && (exact_p || BEGV == ZV)) | ||
| 6146 | { | 6164 | { |
| 6147 | int old_height = XFASTINT (w->height); | 6165 | /* Always resize to exact size needed. */ |
| 6148 | freeze_window_starts (f, 0); | 6166 | if (height > XFASTINT (w->height)) |
| 6149 | shrink_mini_window (w); | 6167 | { |
| 6150 | window_height_changed_p = XFASTINT (w->height) != old_height; | 6168 | int old_height = XFASTINT (w->height); |
| 6169 | freeze_window_starts (f, 1); | ||
| 6170 | grow_mini_window (w, height - XFASTINT (w->height)); | ||
| 6171 | window_height_changed_p = XFASTINT (w->height) != old_height; | ||
| 6172 | } | ||
| 6173 | else if (height < XFASTINT (w->height)) | ||
| 6174 | { | ||
| 6175 | int old_height = XFASTINT (w->height); | ||
| 6176 | freeze_window_starts (f, 0); | ||
| 6177 | shrink_mini_window (w); | ||
| 6178 | |||
| 6179 | if (height) | ||
| 6180 | { | ||
| 6181 | freeze_window_starts (f, 1); | ||
| 6182 | grow_mini_window (w, height - XFASTINT (w->height)); | ||
| 6183 | } | ||
| 6184 | |||
| 6185 | window_height_changed_p = XFASTINT (w->height) != old_height; | ||
| 6186 | } | ||
| 6151 | } | 6187 | } |
| 6152 | } | 6188 | } |
| 6153 | 6189 | ||
| @@ -13661,6 +13697,8 @@ syms_of_xdisp () | |||
| 13661 | staticpro (&Qimage); | 13697 | staticpro (&Qimage); |
| 13662 | Qmessage_truncate_lines = intern ("message-truncate-lines"); | 13698 | Qmessage_truncate_lines = intern ("message-truncate-lines"); |
| 13663 | staticpro (&Qmessage_truncate_lines); | 13699 | staticpro (&Qmessage_truncate_lines); |
| 13700 | Qgrow_only = intern ("grow-only"); | ||
| 13701 | staticpro (&Qgrow_only); | ||
| 13664 | 13702 | ||
| 13665 | last_arrow_position = Qnil; | 13703 | last_arrow_position = Qnil; |
| 13666 | last_arrow_string = Qnil; | 13704 | last_arrow_string = Qnil; |
| @@ -13839,10 +13877,18 @@ displayed according to the current fontset."); | |||
| 13839 | DEFVAR_LISP ("max-mini-window-height", &Vmax_mini_window_height, | 13877 | DEFVAR_LISP ("max-mini-window-height", &Vmax_mini_window_height, |
| 13840 | "*Maximum height for resizing mini-windows.\n\ | 13878 | "*Maximum height for resizing mini-windows.\n\ |
| 13841 | If a float, it specifies a fraction of the mini-window frame's height.\n\ | 13879 | If a float, it specifies a fraction of the mini-window frame's height.\n\ |
| 13842 | If an integer, it specifies a number of lines.\n\ | 13880 | If an integer, it specifies a number of lines."); |
| 13843 | If nil, don't resize."); | ||
| 13844 | Vmax_mini_window_height = make_float (0.25); | 13881 | Vmax_mini_window_height = make_float (0.25); |
| 13845 | 13882 | ||
| 13883 | DEFVAR_LISP ("resize-mini-windows", &Vresize_mini_windows, | ||
| 13884 | "*How to resize the mini-window.\n\ | ||
| 13885 | A value of nil means don't automatically resize mini-windows.\n\ | ||
| 13886 | A value of t means resize it to fit the text displayed in it.\n\ | ||
| 13887 | A value of `grow-only', the default, means let mini-windows grow\n\ | ||
| 13888 | only, until the its display becomes empty, at which point the mini-window\n\ | ||
| 13889 | goes back to its normal size."); | ||
| 13890 | Vresize_mini_windows = Qgrow_only; | ||
| 13891 | |||
| 13846 | DEFVAR_BOOL ("cursor-in-non-selected-windows", | 13892 | DEFVAR_BOOL ("cursor-in-non-selected-windows", |
| 13847 | &cursor_in_non_selected_windows, | 13893 | &cursor_in_non_selected_windows, |
| 13848 | "*Non-nil means display a hollow cursor in non-selected windows.\n\ | 13894 | "*Non-nil means display a hollow cursor in non-selected windows.\n\ |
| @@ -13866,7 +13912,7 @@ Bind this around calls to `message' to let it take effect."); | |||
| 13866 | DEFVAR_LISP ("menu-bar-update-hook", &Vmenu_bar_update_hook, | 13912 | DEFVAR_LISP ("menu-bar-update-hook", &Vmenu_bar_update_hook, |
| 13867 | "Normal hook run for clicks on menu bar, before displaying a submenu.\n\ | 13913 | "Normal hook run for clicks on menu bar, before displaying a submenu.\n\ |
| 13868 | Can be used to update submenus whose contents should vary."); | 13914 | Can be used to update submenus whose contents should vary."); |
| 13869 | 13915 | Vmenu_bar_update_hook = Qnil; | |
| 13870 | } | 13916 | } |
| 13871 | 13917 | ||
| 13872 | 13918 | ||