help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding total lines to modeline (NOT percentage)?


From: Eli Zaretskii
Subject: Re: Adding total lines to modeline (NOT percentage)?
Date: Fri, 15 Apr 2011 11:21:22 +0300

> From: Deniz Dogan <address@hidden>
> Date: Fri, 15 Apr 2011 01:03:50 +0200
> Cc: fork <address@hidden>, address@hidden
> 
> > (list 'line-number-mode "  L%l/")
> > (list 'line-number-mode (:eval (int-to-string (count-lines (point-min)
> > (point-max)))))
> 
> Note that this method will be affected by narrowing. To get the full
> number of lines in the buffer use (1+ (count-lines 1 (buffer-size))).
> This could also get rather sluggish when used in large buffers.

You bet!  The default method has some clever wizardry in the display
engine to not count too many lines unless necessary.  If we want to
support N/M display, we should make it part of the display engine, to
avoid re-counting each time redisplay is entered.  Patches are welcome.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]