From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alexis Newsgroups: gmane.emacs.bugs Subject: bug#27847: 26.0.50; mode-line-percent-position: line-based instead of char-based (optionally) Date: Fri, 28 Jul 2017 12:44:12 +1000 Message-ID: <87r2x1i8lf.fsf@gmail.com> References: <83shhh4wsk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1501209917 19985 195.159.176.226 (28 Jul 2017 02:45:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Jul 2017 02:45:17 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 25.2.1 Cc: 27847@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 28 04:45:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1davH4-0004kT-0c for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jul 2017 04:45:10 +0200 Original-Received: from localhost ([::1]:45558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1davH8-0007jk-19 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jul 2017 22:45:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1davH1-0007iH-Et for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 22:45:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1davGw-0004l7-HV for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 22:45:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1davGw-0004kt-EA for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 22:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1davGw-0005HP-4Y for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 22:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alexis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jul 2017 02:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27847 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27847-submit@debbugs.gnu.org id=B27847.150120986520241 (code B ref 27847); Fri, 28 Jul 2017 02:45:02 +0000 Original-Received: (at 27847) by debbugs.gnu.org; 28 Jul 2017 02:44:25 +0000 Original-Received: from localhost ([127.0.0.1]:59066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1davGK-0005GP-UI for submit@debbugs.gnu.org; Thu, 27 Jul 2017 22:44:25 -0400 Original-Received: from mail-pg0-f45.google.com ([74.125.83.45]:38216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1davGI-0005GA-P0 for 27847@debbugs.gnu.org; Thu, 27 Jul 2017 22:44:23 -0400 Original-Received: by mail-pg0-f45.google.com with SMTP id k190so39775622pgk.5 for <27847@debbugs.gnu.org>; Thu, 27 Jul 2017 19:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=U+YptL0vYNKfWh3I0y1ZC/mZvkGo6XUyayLFabuWn5Y=; b=WathRaKczESL4UcFv+N+qGbbuc5dQ7P/w4IsUDWG5ZUa2eHBopsp7mvhaF+Zt38SeG +cpVCKdRP942ewmUtHB7bZp5W9LY71j8jikR7n5HD7CPSyX4/MYPovy0fA0Hkl+i5ZnB rCXwQ2KnS+we3mNZN4xBTZhg19aV+k3/De4kjidOFgSbGgzJPudzQbgQ5eR4lCV5nMLd 35iOc2dVt0Ue/y5lx0AGNKbO7KNadQ0spdDHGwCHrOtLRMsuIUOoOo3vcW1yuHyN+bHm +rjx/UZ0B1bxgYY8OkiekhRwg5W2Aq0PilvWb/2rRgf/KhGRsbeiBvpsWZV8OD/C6qQo 0ZEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=U+YptL0vYNKfWh3I0y1ZC/mZvkGo6XUyayLFabuWn5Y=; b=QmwK3LX4nsytqj6P4Jq/+WULQXocTNdn+MTgmzO7zlhNWc+jzI4g3aS/GNfN2NnZTX DQyapxqXe5B6aGM1LTslEs7CEpms10COUat9mSJy613iQ9vI9BZKCN5cY4ywKUPVQJkW rtuVy+iXZ8pSXIObjMIkVCM6DaWdsFyfwOSYWUU9j1xZWg3TVa0O/EmAJZeN2pOdm2R5 oDMGrz+TvOtoULOyfXtwrSSCtML9sG6UmqzKe0L+9U6Ll4QhZ0MALaB0RbRylpYIwoPg wmZzwSCT4P9TtYv56N395oPDXrmGztPKO6GnudWWZ7H3ng1vbLvbbzP8o8cIlmuhlpNg bwGA== X-Gm-Message-State: AIVw113vrFnMHVHqo+yHGx+IG9EREeXg0jEJxN51qwZeQN4W0VT83xst ArBBYWYt5HRqnA== X-Received: by 10.99.60.83 with SMTP id i19mr5982590pgn.51.1501209856827; Thu, 27 Jul 2017 19:44:16 -0700 (PDT) Original-Received: from localhost (CAPCPE-124-189-167-250.rsqv1.lon.bigpond.net.au. [124.189.167.250]) by smtp.gmail.com with ESMTPSA id c64sm3328731pfj.91.2017.07.27.19.44.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jul 2017 19:44:16 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135061 Archived-At: Dani Moncayo writes: >>> I'd prefer this (those) percentage(s) to be based on the >>> number of >>> _lines_ instead >> >> What do you want to be displayed in that case when line numbers >> are >> not counted and displayed as "???" ? Do you want Emacs to >> count lines >> even though the limits which control that are exceeded? > > In cases where line numbers are not counted (I didn't know about > such > cases, BTW), I guess Emacs could display "??" as the percentage, > meaning that the value is unknown at that moment. > >> Also note that for your feature to be implemented, Emacs needs >> to >> count lines in the entire buffer each time the buffer is >> changed, so I >> expect this feature to slow down redisplay. > > Maybe this computation could be optimized somehow. In any case, > if > someone implements it and the slow down is observable, it could > be > advertised in the manual and/or the docstring of the variable > which > enables this feature. As a data point, i have this as part of my `mode-line-format` setup: '(:eval (let ((buffer-line-count (count-lines (point-min) (point-max)))) (number-to-string (round (* 100 (/ (float (count-lines 1 (point))) (if (equal 0 buffer-line-count) 1 buffer-line-count))))))) "%%" which gives me at least a rough percentage (i.e. 'good enough' for my needs), and i've not noticed any slowdown as a result. Alexis.