From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: linum.el? Date: Thu, 1 Nov 2007 02:39:47 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1193881206 24188 80.91.229.12 (1 Nov 2007 01:40:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2007 01:40:06 +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 Thu Nov 01 02:40:08 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 1InP2U-0008KR-73 for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2007 02:40:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InP2K-0002n7-5Q for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 21:39:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InP2F-0002ks-K9 for emacs-devel@gnu.org; Wed, 31 Oct 2007 21:39:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InP2E-0002ji-Np for emacs-devel@gnu.org; Wed, 31 Oct 2007 21:39:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InP2E-0002jL-Jp for emacs-devel@gnu.org; Wed, 31 Oct 2007 21:39:50 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InP2D-0002PL-F2 for emacs-devel@gnu.org; Wed, 31 Oct 2007 21:39:49 -0400 Original-Received: by wa-out-1112.google.com with SMTP id k34so390318wah for ; Wed, 31 Oct 2007 18:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=gBVzZytmr0SfM83Co8mH/5ECTHPfASbp5NmxTj7fh8E=; b=NchF98NLUEUDAt58xkkx52PMNobR7qoeZz/8o+tlH+ZBdhCWzz+pkJyAr3GuK/xLbGGWZcPXQ2vbwHn4iBQiTl6DOpjsodDQFvWfhaBilq95PfdxuNdZxhwVrrR8QUjlqxAXd79UXYDc2gbGN+nXe2ovm+rj7w2Oaf+D47izvSU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UlvobeBL7VHaDCdPYzSHIRZUD7HPrKTzjVG7kf8mixTOuOPnxqvQNZR9luMz2qx11ysy1g1mPDoz7Qnxv0IjpR7KYwXSNktyDPtVaYkkGEZ4YQIU+FNjRn/eO1S7OQt1OOJ4OkMkEEgcQkiADv91iHQAO3RM9tPqgDnhuwp/1zU= Original-Received: by 10.114.167.2 with SMTP id p2mr42536wae.1193881187963; Wed, 31 Oct 2007 18:39:47 -0700 (PDT) Original-Received: by 10.114.168.11 with HTTP; Wed, 31 Oct 2007 18:39:47 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:82273 Archived-At: On 11/1/07, Richard Stallman wrote: > I don't remember after all this time which drawbacks > remain to be fixed. Can you remind us? Markus can explain it better, but as far as I remember, linum.el is too slow when allout-mode or outline-mode are active. > Can you post this code again? Attached after the signature. > Which drawbacks in linum would this enable to be fixed, Markus: "Yes, and I also found it's not enough to update line numbers in window-size-change-functions, configuration-change-hook, and after-change-functions; one should also do it in hs-...-hook, allout-..., outline-..., and many others." You: "I think that means we need to add a suitable hook which redisplay can call to inform Lisp code that visibility changes may have altered the position of the bottom of the window. The hook could be called by redisplay_window, if current_matrix_up_to_date_p is zero. Would someone like to try implementing this?" > and which other drawbacks would remain? The only one I've seen is that, in very infrequent cases, linum.el does not update some line numbers after adding or deleting lines. That may be related to the fact that I use a custom format function. Other than that, linum.el works very well and it's more than fast enough. Juanma 2007-09-16 Markus Triska * xdisp.c (redisplay_window): Invoke new hook, window-bottom-change-functions, when visibility changes may have altered the position of the bottom of the window. (syms_of_xdisp) : New hook. diff --git a/src/xdisp.c b/src/xdisp.c index 618a538..80b973c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -232,6 +232,7 @@ extern Lisp_Object Qhelp_echo; Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; +Lisp_Object Qwindow_bottom_change_functions, Vwindow_bottom_change_functions; Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions; Lisp_Object Qinhibit_point_motion_hooks; Lisp_Object QCeval, QCfile, QCdata, QCpropertize; @@ -12880,6 +12881,10 @@ redisplay_window (window, just_this_one_p) && XFASTINT (w->last_modified) >= MODIFF && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF); + if (!current_matrix_up_to_date_p + && !NILP (Vwindow_bottom_change_functions)) + safe_run_hooks (Qwindow_bottom_change_functions); + buffer_unchanged_p = (!NILP (w->window_end_valid) && !current_buffer->clip_changed @@ -23866,6 +23871,9 @@ syms_of_xdisp () staticpro (&Qwindow_scroll_functions); Qwindow_scroll_functions = intern ("window-scroll-functions"); + staticpro (&Qwindow_bottom_change_functions); + Qwindow_bottom_change_functions = intern ("window-bottom-change-functions"); + staticpro (&Qredisplay_end_trigger_functions); Qredisplay_end_trigger_functions = intern ("redisplay-end-trigger-functions"); @@ -24173,6 +24181,10 @@ and its new display-start position. Note that the value of `window-end' is not valid when these functions are called. */); Vwindow_scroll_functions = Qnil; + DEFVAR_LISP ("window-bottom-change-functions", &Vwindow_bottom_change_functions, + doc: /* Functions to call when the bottom of the window changes. */); + Vwindow_bottom_change_functions = Qnil; + DEFVAR_LISP ("redisplay-end-trigger-functions", &Vredisplay_end_trigger_functions, doc: /* Functions called when redisplay of a window reaches the end trigger. Each function is called with two arguments, the window and the end trigger value.