From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: something like linum.el ought to be added Date: Tue, 11 Sep 2007 09:08:52 +0200 Message-ID: <46E63F04.4010406@gmx.at> References: <86hcm4rw70.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1189496188 16266 80.91.229.12 (11 Sep 2007 07:36:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 07:36:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 11 17:36:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IV7lz-0007a4-4t for ged-emacs-devel@m.gmane.org; Tue, 11 Sep 2007 17:35:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IV0Hg-00029d-Oj for ged-emacs-devel@m.gmane.org; Tue, 11 Sep 2007 03:35:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IV0He-00028w-3d for emacs-devel@gnu.org; Tue, 11 Sep 2007 03:35:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IV0Hb-00027c-92 for emacs-devel@gnu.org; Tue, 11 Sep 2007 03:35:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IV0Hb-00027Z-6b for emacs-devel@gnu.org; Tue, 11 Sep 2007 03:35:39 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IV0Ha-0001d8-N4 for emacs-devel@gnu.org; Tue, 11 Sep 2007 03:35:39 -0400 Original-Received: (qmail invoked by alias); 11 Sep 2007 07:08:57 -0000 Original-Received: from N712P030.adsl.highway.telekom.at (EHLO [62.47.32.254]) [62.47.32.254] by mail.gmx.net (mp046) with SMTP; 11 Sep 2007 09:08:57 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19+pT8TPFV+Jc9wZyoHanK/jaaZ79WnUVCH9pKcln bUtPj6k30ALrf0 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78571 Archived-At: > It looks interesting. Is it efficient enough? It reassigns overlays > to all the visible lines after every command, and that might be > painfully slow. The only way to make this fast is implementing it in the redisplay code. > It might as well delete ALL the overlays it has made, rather than just > those for the visible lines. Preserving overlays on the other parts > of the buffer won't things speed up, and could waste a lot of space > and maybe also cause slowdown by having so many overlays. I think the overlay handling part is OK and cannot be improved much. It might profit from recentering overlays but I'm not sure where. > It would be much better if it worked from after-change-functions, and > reassigned overlays only for the lines that really need it. The only way `after-change-functions' could be used here is to invalidate entries of a line numbers cache. Such a cache should be useful for `line-number-mode' too. If you have enabled both `linum-mode' and `line-number-mode' you'd `count-lines' twice from bob for each redisplay.