Mercurial > emacs
comparison src/xdisp.c @ 25258:8eefac3ecebf
(line_number_display_limit_width): New var.
(decode_mode_spec): Use it instead of hardcoded value.
(syms_of_xdisp): Defvar it.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sat, 14 Aug 1999 03:13:35 +0000 |
parents | d74ff22998b4 |
children | 273b3c17ce68 |
comparison
equal
deleted
inserted
replaced
25257:0be923a80096 | 25258:8eefac3ecebf |
---|---|
485 int line_number_displayed; | 485 int line_number_displayed; |
486 | 486 |
487 /* Maximum buffer size for which to display line numbers. */ | 487 /* Maximum buffer size for which to display line numbers. */ |
488 | 488 |
489 static int line_number_display_limit; | 489 static int line_number_display_limit; |
490 | |
491 /* line width to consider when repostioning for line number display */ | |
492 | |
493 static int line_number_display_limit_width; | |
490 | 494 |
491 /* Number of lines to keep in the message log buffer. t means | 495 /* Number of lines to keep in the message log buffer. t means |
492 infinite. nil means don't log at all. */ | 496 infinite. nil means don't log at all. */ |
493 | 497 |
494 Lisp_Object Vmessage_log_max; | 498 Lisp_Object Vmessage_log_max; |
11344 || linepos == BUF_BEGV (b)) | 11348 || linepos == BUF_BEGV (b)) |
11345 { | 11349 { |
11346 int limit = BUF_BEGV (b); | 11350 int limit = BUF_BEGV (b); |
11347 int limit_byte = BUF_BEGV_BYTE (b); | 11351 int limit_byte = BUF_BEGV_BYTE (b); |
11348 int position; | 11352 int position; |
11349 int distance = (height * 2 + 30) * 200; | 11353 int distance = (height * 2 + 30) * line_number_display_limit_width; |
11350 | 11354 |
11351 if (startpos - distance > limit) | 11355 if (startpos - distance > limit) |
11352 { | 11356 { |
11353 limit = startpos - distance; | 11357 limit = startpos - distance; |
11354 limit_byte = CHAR_TO_BYTE (limit); | 11358 limit_byte = CHAR_TO_BYTE (limit); |
11357 nlines = display_count_lines (startpos, startpos_byte, | 11361 nlines = display_count_lines (startpos, startpos_byte, |
11358 limit_byte, | 11362 limit_byte, |
11359 - (height * 2 + 30), | 11363 - (height * 2 + 30), |
11360 &position); | 11364 &position); |
11361 /* If we couldn't find the lines we wanted within | 11365 /* If we couldn't find the lines we wanted within |
11362 200 chars per line, | 11366 line_number_display_limit_width chars per line, |
11363 give up on line numbers for this window. */ | 11367 give up on line numbers for this window. */ |
11364 if (position == limit_byte && limit == startpos - distance) | 11368 if (position == limit_byte && limit == startpos - distance) |
11365 { | 11369 { |
11366 w->base_line_pos = w->buffer; | 11370 w->base_line_pos = w->buffer; |
11367 w->base_line_number = Qnil; | 11371 w->base_line_number = Qnil; |
12040 "*Maximum buffer size for which line number should be displayed.\n\ | 12044 "*Maximum buffer size for which line number should be displayed.\n\ |
12041 If the buffer is bigger than this, the line number does not appear\n\ | 12045 If the buffer is bigger than this, the line number does not appear\n\ |
12042 in the mode line."); | 12046 in the mode line."); |
12043 line_number_display_limit = 1000000; | 12047 line_number_display_limit = 1000000; |
12044 | 12048 |
12049 DEFVAR_INT ("line-number-display-limit-width", &line_number_display_limit_width, | |
12050 "*Maximum line width (in characters) for line number display.\n\ | |
12051 If the average length of the lines near point is bigger than this, then the\n\ | |
12052 line number may be omitted from the mode line."); | |
12053 line_number_display_limit_width = 200; | |
12054 | |
12045 DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows, | 12055 DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows, |
12046 "*Non-nil means highlight region even in nonselected windows."); | 12056 "*Non-nil means highlight region even in nonselected windows."); |
12047 highlight_nonselected_windows = 0; | 12057 highlight_nonselected_windows = 0; |
12048 | 12058 |
12049 DEFVAR_BOOL ("multiple-frames", &multiple_frames, | 12059 DEFVAR_BOOL ("multiple-frames", &multiple_frames, |