aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-06-13 23:50:22 +0000
committerGerd Moellmann2000-06-13 23:50:22 +0000
commitad4f174eb4c7f76a64661285e68c80509c5b9430 (patch)
tree7f76024ca165076198ecb15f53d98b8c744aac13 /src
parent1681ead6ac651997695f1aaadb3169965978d28d (diff)
downloademacs-ad4f174eb4c7f76a64661285e68c80509c5b9430.tar.gz
emacs-ad4f174eb4c7f76a64661285e68c80509c5b9430.zip
(message_truncate_lines, Qmessage_truncate_lines): New
variables. (ensure_echo_area_buffers): Initialize echo buffer's truncate lines setting to nil. (with_echo_area_buffer): Don't set the echo buffer's truncate lines setting here. (set_message_1): Set it here, instead, based on the value of message_truncate_lines. (resize_mini_window): Handle case that lines are truncated. (syms_of_xdisp): Initialize Qmessage_truncate_lines. DEFVAR_BOOL message-truncate-lines.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 7788649e977..be76987311e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -480,7 +480,13 @@ int message_buf_print;
480 specifying a fraction of the available height, or an integer 480 specifying a fraction of the available height, or an integer
481 specifying a number of lines. */ 481 specifying a number of lines. */
482 482
483static Lisp_Object Vmax_mini_window_height; 483Lisp_Object Vmax_mini_window_height;
484
485/* Non-zero means messages should be displayed with truncated
486 lines instead of being continued. */
487
488int message_truncate_lines;
489Lisp_Object Qmessage_truncate_lines;
484 490
485/* Non-zero means we want a hollow cursor in windows that are not 491/* Non-zero means we want a hollow cursor in windows that are not
486 selected. Zero means there's no cursor in such windows. */ 492 selected. Zero means there's no cursor in such windows. */
@@ -5298,6 +5304,7 @@ ensure_echo_area_buffers ()
5298 char name[30]; 5304 char name[30];
5299 sprintf (name, " *Echo Area %d*", i); 5305 sprintf (name, " *Echo Area %d*", i);
5300 echo_buffer[i] = Fget_buffer_create (build_string (name)); 5306 echo_buffer[i] = Fget_buffer_create (build_string (name));
5307 XBUFFER (echo_buffer[i])->truncate_lines = Qnil;
5301 } 5308 }
5302} 5309}
5303 5310
@@ -5379,7 +5386,7 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
5379 w->buffer = buffer; 5386 w->buffer = buffer;
5380 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); 5387 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
5381 } 5388 }
5382 current_buffer->truncate_lines = Qnil; 5389
5383 current_buffer->undo_list = Qt; 5390 current_buffer->undo_list = Qt;
5384 current_buffer->read_only = Qnil; 5391 current_buffer->read_only = Qnil;
5385 5392
@@ -5665,13 +5672,18 @@ resize_mini_window (w, exact_p)
5665 max_height = min (total_height, max_height); 5672 max_height = min (total_height, max_height);
5666 5673
5667 /* Find out the height of the text in the window. */ 5674 /* Find out the height of the text in the window. */
5668 last_height = 0; 5675 if (it.truncate_lines_p)
5669 move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS); 5676 height = 1;
5670 if (it.max_ascent == 0 && it.max_descent == 0)
5671 height = it.current_y + last_height;
5672 else 5677 else
5673 height = it.current_y + it.max_ascent + it.max_descent; 5678 {
5674 height = (height + unit - 1) / unit; 5679 last_height = 0;
5680 move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS);
5681 if (it.max_ascent == 0 && it.max_descent == 0)
5682 height = it.current_y + last_height;
5683 else
5684 height = it.current_y + it.max_ascent + it.max_descent;
5685 height = (height + unit - 1) / unit;
5686 }
5675 5687
5676 /* Compute a suitable window start. */ 5688 /* Compute a suitable window start. */
5677 if (height > max_height) 5689 if (height > max_height)
@@ -5875,6 +5887,8 @@ set_message_1 (s, string, nbytes, multibyte_p)
5875 != !NILP (current_buffer->enable_multibyte_characters)) 5887 != !NILP (current_buffer->enable_multibyte_characters))
5876 Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); 5888 Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
5877 5889
5890 current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil;
5891
5878 /* Insert new message at BEG. */ 5892 /* Insert new message at BEG. */
5879 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 5893 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
5880 5894
@@ -12971,6 +12985,8 @@ syms_of_xdisp ()
12971 staticpro (&Qtrailing_whitespace); 12985 staticpro (&Qtrailing_whitespace);
12972 Qimage = intern ("image"); 12986 Qimage = intern ("image");
12973 staticpro (&Qimage); 12987 staticpro (&Qimage);
12988 Qmessage_truncate_lines = intern ("message-truncate-lines");
12989 staticpro (&Qmessage_truncate_lines);
12974 12990
12975 last_arrow_position = Qnil; 12991 last_arrow_position = Qnil;
12976 last_arrow_string = Qnil; 12992 last_arrow_string = Qnil;
@@ -13161,9 +13177,14 @@ Nil means don't display a cursor there.");
13161 automatic_hscrolling_p = 1; 13177 automatic_hscrolling_p = 1;
13162 13178
13163 DEFVAR_LISP ("image-types", &Vimage_types, 13179 DEFVAR_LISP ("image-types", &Vimage_types,
13164 "List of supported image types.\n\ 13180 "List of supported image types.\n\
13165Each element of the list is a symbol for a supported image type."); 13181Each element of the list is a symbol for a supported image type.");
13166 Vimage_types = Qnil; 13182 Vimage_types = Qnil;
13183
13184 DEFVAR_BOOL ("message-truncate-lines", &message_truncate_lines,
13185 "If non-nil, messages are truncated instead of resizing the echo area.\n\
13186Bind this around calls to `message' to let it take effect.");
13187 message_truncate_lines = 0;
13167} 13188}
13168 13189
13169 13190