static int line_number_display_limit;
+/* line width to consider when repostioning for line number display */
+
+static int line_number_display_limit_width;
+
/* Number of lines to keep in the message log buffer. t means
infinite. nil means don't log at all. */
int limit = BUF_BEGV (b);
int limit_byte = BUF_BEGV_BYTE (b);
int position;
- int distance = (height * 2 + 30) * 200;
+ int distance = (height * 2 + 30) * line_number_display_limit_width;
if (startpos - distance > limit)
{
- (height * 2 + 30),
&position);
/* If we couldn't find the lines we wanted within
- 200 chars per line,
+ line_number_display_limit_width chars per line,
give up on line numbers for this window. */
if (position == limit_byte && limit == startpos - distance)
{
in the mode line.");
line_number_display_limit = 1000000;
+ DEFVAR_INT ("line-number-display-limit-width", &line_number_display_limit_width,
+ "*Maximum line width (in characters) for line number display.\n\
+If the average length of the lines near point is bigger than this, then the\n\
+line number may be omitted from the mode line.");
+ line_number_display_limit_width = 200;
+
DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows,
"*Non-nil means highlight region even in nonselected windows.");
highlight_nonselected_windows = 0;