From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23598: 25.0.94; linum Date: Sun, 22 May 2016 18:20:59 +0300 Message-ID: <83a8ji6rvo.fsf@gnu.org> References: <7a0dc6bb83120238947224388cd5f898@posteo.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1463930554 14752 80.91.229.3 (22 May 2016 15:22:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 May 2016 15:22:34 +0000 (UTC) Cc: 23598@debbugs.gnu.org To: freezer@posteo.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 22 17:22:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b4VCr-0005jF-IM for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 May 2016 17:22:17 +0200 Original-Received: from localhost ([::1]:43347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4VCn-0007NV-3a for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 May 2016 11:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4VCh-0007NK-Fc for bug-gnu-emacs@gnu.org; Sun, 22 May 2016 11:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4VCc-00089w-7D for bug-gnu-emacs@gnu.org; Sun, 22 May 2016 11:22:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4VCc-00089s-3k for bug-gnu-emacs@gnu.org; Sun, 22 May 2016 11:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b4VCb-0005CF-W8 for bug-gnu-emacs@gnu.org; Sun, 22 May 2016 11:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 May 2016 15:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23598-submit@debbugs.gnu.org id=B23598.146393047619916 (code B ref 23598); Sun, 22 May 2016 15:22:01 +0000 Original-Received: (at 23598) by debbugs.gnu.org; 22 May 2016 15:21:16 +0000 Original-Received: from localhost ([127.0.0.1]:32943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4VBr-0005BA-UE for submit@debbugs.gnu.org; Sun, 22 May 2016 11:21:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4VBp-0005Aw-11 for 23598@debbugs.gnu.org; Sun, 22 May 2016 11:21:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4VBf-00086a-Mg for 23598@debbugs.gnu.org; Sun, 22 May 2016 11:21:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4VBf-00086W-Jc; Sun, 22 May 2016 11:21:03 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2219 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b4VBd-0007Lh-PQ; Sun, 22 May 2016 11:21:02 -0400 In-reply-to: <7a0dc6bb83120238947224388cd5f898@posteo.de> (freezer@posteo.de) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:118533 Archived-At: > Date: Sun, 22 May 2016 08:59:35 +0200 > From: freezer@posteo.de > > 1. When I turn on line numbers (with linum-mode), scrolling a large org file is very slow. This only happens when the org sections are folded and not fully > expanded. linum-mode needs to count lines each time you scroll through the file, and it needs to update the display for all the lines visible in the window. When many lines are hidden, updating a window requires traversing a lot of lines in the buffer. For example, the sample file you sent shows almost 3000 lines in a single window, which is 100 times more than an average window without hidden lines. So yes, this is slow. I suggest to switch to nlinum-mode from ELPA, which us much faster in these cases. > 2. With some themes, the line numbers are also truncated. Example (theme > monokai): http://i.imgur.com/gkY8FGn.png > > Example org file: > https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org The monokai theme seems to implicitly enlarge the face used for the line numbers and change its font (because Org headers use an enlarged variable-pitch font), but it doesn't update the 'linum' face with that information. By default, the face for the line numbers has its attributes merged with those of the face used to display the text line, and since the 'linum' face by default doesn't specify any size or font attributes, they are taken from the Org header face. So the calculation of character size linum-mode does is incorrect, because the 'linum' face's font is still defined to be the original size before it was enlarged. I think setting the 'linum' face's attributes to set specific font family and height attributes should fix this problem. It could be argued that the monokai theme should do that: it clearly caters to linum-mode, since it does set some attributes of the 'linum' face.