From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Adding total lines to modeline (NOT percentage)? Date: Fri, 15 Apr 2011 11:21:22 +0300 Message-ID: <831v13rkl9.fsf@gnu.org> References: <4DA73885.8000802@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1302855702 17936 80.91.229.12 (15 Apr 2011 08:21:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Apr 2011 08:21:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 15 10:21:39 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QAeHY-00065H-Ob for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Apr 2011 10:21:36 +0200 Original-Received: from localhost ([::1]:54385 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAeHX-0005ue-MF for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Apr 2011 04:21:35 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAeHQ-0005tv-1R for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 04:21:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAeHO-0002HY-Ra for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 04:21:27 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:56980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAeHO-0002Gk-Ka for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 04:21:26 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LJO00E00PSA2P00@a-mtaout23.012.net.il> for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 11:21:25 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.31.148]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LJO00ET9PVO1E20@a-mtaout23.012.net.il> for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 11:21:25 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80801 Archived-At: > From: Deniz Dogan > Date: Fri, 15 Apr 2011 01:03:50 +0200 > Cc: fork , help-gnu-emacs@gnu.org >=20 > > (list 'line-number-mode " =A0L%l/") > > (list 'line-number-mode (:eval (int-to-string (count-lines (point= -min) > > (point-max))))) >=20 > Note that this method will be affected by narrowing. To get the ful= l > 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 welcom= e.