From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: line-move-partial too costly ? Date: Tue, 19 Sep 2006 10:19:47 +0200 Organization: Epita/LRDE Message-ID: <87lkog8dzw.fsf@lrde.org> References: <87k647501r.fsf@lrde.org> <877j06ocvo.fsf@lrde.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1700175757==" X-Trace: sea.gmane.org 1158653982 7798 80.91.229.2 (19 Sep 2006 08:19:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 08:19:42 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 19 10:19:36 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GPapL-0006N2-6m for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 10:19:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPapK-0000kF-Fv for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 04:19:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GPaoe-0000eP-AV for emacs-devel@gnu.org; Tue, 19 Sep 2006 04:18:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GPaod-0000a1-3D for emacs-devel@gnu.org; Tue, 19 Sep 2006 04:18:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPaoc-0000ZK-TX for emacs-devel@gnu.org; Tue, 19 Sep 2006 04:18:50 -0400 Original-Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GPara-00072A-Ho; Tue, 19 Sep 2006 04:21:54 -0400 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by mx20.gnu.org with esmtp (Exim 4.52) id 1GPaoW-00047r-Ic; Tue, 19 Sep 2006 04:18:44 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1GPaoR-0000sv-Kv; Tue, 19 Sep 2006 10:18:39 +0200 Original-To: storm@cua.dk (Kim F. Storm) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEU/JREXDATg1LV8UCao i1fQpmoP3Nd6AAACa0lEQVQ4jWWUQW7jMAxFqZEPICJzAjXeM6W8dyNqX9ji/a8yn04xnWIEJLD9 LJH85DcJFyJV3erqPty8ExHfBikXSdn0WVezC0hOAQiA2nCsAHOqEnPe4k+puU8zw/t+xquqjRKA 4lHsmQBT8C5pDtBwfwH8VdcHI5+FHtjRxrQRwZsf3hNjZRKAPEzHEdH9mFNSYb5dQK3r8KM6ftNy KikAirDZFWdVkDqbxjGFbAcwbQCxxc8mPRHUGOcCIMgMACV23RfJTch3gC6ofT3qCdG0NyUUPfYF yQrKCIAnuYsgX2qPzW2i9sNrfSOSPPZQiygtCNlCjlpXJV38lIKshF/AZzsAMoArdCKNHfXukPuJ ImbLh+9J2gXwap0QpZ7NjZ7ekdkFcDiqPiLGcHmuvaG/AHgy62s52Lae1ABoA7D6d2kDoAvgbnyD ZutEd6lTHOXfYPHVJDH1K8a1+oyrjoZpAGn1x5pfwPr2E9yjxSpk50/gEyKgD/+BD/KzN3tQ13b8 Cx5loF0AgnZf5IUny9hRHQOYBllHDM+6s3oviZBu77mFjDm621Np3hkjR90wE1BkTYvhdDgDgCmR xWChFfcYAOqMm5NZkVWMur8AL5+oeMQOob2FmY76FiM+PrDDZypwGdqokSlAaQOmGH6mW8KpsOwl 0YOLedjSITr6scNRF8D4PesH33QmLrx8AzjpV/3kkg025w2gfAFYKCLluJAc4Ap+h18oo4S8wzaY klDsBUTiY8EZFkg5Iass75FubC9wd8qa0u9+gRxAsAKEaRAo6iB+vwCMGmdBjvgidQGA1ntMX4CS ZYGV/wADyL80LIX/UAAAAABJRU5ErkJggg== User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) 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:60003 Archived-At: --===============1700175757== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable storm@cua.dk (Kim F. Storm) writes: > michael@cadilhac.name (Micha=EBl Cadilhac) writes: > >> storm@cua.dk (Kim F. Storm) writes: >> >>> michael@cadilhac.name (Micha=EBl Cadilhac) writes: >>> >>>> Since the creation of line-move-partial, going to the next few lines >>>> has become a P*TA. >>> >>>> Is there any solution ? >>> >>> I installed a small optimization -- pls try again. >>> >> AFAICT, it doesn't fix my problem. > > I have installed an more elaborate change to line-move-partial > (involving a new primitive `window-line-visibility'). (* Sorry for the delay *) It makes the job ! I'm no longer stuck at the first line when going to the next few lines. To me, it's OK, but I have a minor issue (I don't know if it needs attention). After scrolling a couple of screens with C-n, the cursor stops, like previously (it doesn't happen with auto-window-vscroll to nil), and the display is buggy for the time I'm stuck (which could be quite long [1]). The cursor stop happens on a screen change, and appears like that : http://www.lrde.org/~cadilh_m/freeze.png As you can see, the first half of the screen is correct whilst the other one hasn't been redrawn. Like if the redisplay was made before the scroll change, and not after. Voil=E0, FWIW :-) Footnotes:=20 [1] I tried to make a fix for this one. The principle was : if there's unread C-n when entering next-line, just buffer its arg. The (dirty) patch, that moreover doesn't work, looks like that : Index: simple.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/simple.el,v retrieving revision 1.820 diff -b -u -w -r1.820 simple.el @@ -3379,6 +3381,26 @@ :version "21.1" :group 'editing-basics) =20 +(defvar next-or-previous-line-count 0 + "Buffer for line moves. +If `next-line' or `previous-line' are used repeatedly, the amount +of line to scroll is stored to avoid freezing.") + +(defun update-next-or-previous-line-count (arg) + "Update `next-or-previous-line-count' by adding ARG to it if necessary." + (let ((unread (append unread-command-events + unread-post-input-method-events + unread-input-method-events + (if (> unread-command-char 0) + (list unread-command-char) + nil)))) + (when (progn (while (and unread (not (memq (key-binding (car unread)) + '(next-line previous-line)))) + (setq unread (cdr unread))) + unread) + (setq next-or-previous-line-count (+ next-or-previous-line-count arg= ))))) + + (defun next-line (&optional arg try-vscroll) "Move cursor vertically down ARG lines. Interactively, vscroll tall lines if `auto-window-vscroll' is enabled. @@ -3402,6 +3424,9 @@ and more reliable (no dependence on goal column, etc.)." (interactive "p\np") (or arg (setq arg 1)) + (when (not (update-next-or-previous-line-count arg)) + (setq arg (+ arg next-or-previous-line-count) + next-or-previous-line-count 0) (if (and next-line-add-newlines (=3D arg 1)) (if (save-excursion (end-of-line) (eobp)) ;; When adding a newline, don't expand an abbrev. @@ -3436,9 +3461,12 @@ (interactive "p\np") (or arg (setq arg 1)) (if (interactive-p) + (when (not (update-next-or-previous-line-count arg)) + (setq arg (+ arg next-or-previous-line-count) + next-or-previous-line-count 0) (condition-case nil (line-move (- arg) nil nil try-vscroll) ((beginning-of-buffer end-of-buffer) (ding))) (line-move (- arg) nil nil try-vscroll)) nil) =20 =2D-=20 /!\ My mail address changed, please update your files accordingly. | Micha=EBl `Micha' Cadilhac | Un certain Blaise Pascal = | | Epita/LRDE Promo 2007 | etc... etc... = | | http://michael.cadilhac.name | -- Pr=E9vert (Les paris stupides) = | `-- - JID: micha@amessage.be --' - -= -' --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFFD6gmUJhDmOfFA3URArsCAJ4i1GO797TD/e3byqVIyeko/c10tACaAxGa lH0OxLO/F5Ep1qQKPR861N0= =TURK -----END PGP SIGNATURE----- --=-=-=-- --===============1700175757== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1700175757==--