From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Newsgroups: gmane.emacs.help Subject: Re: recenter and visual-line-mode Date: Wed, 8 Apr 2015 15:59:16 -0400 Message-ID: References: <83mw2jglwn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1134b3ceabfd4405133bf9aa X-Trace: ger.gmane.org 1428523212 7142 80.91.229.3 (8 Apr 2015 20:00:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 20:00:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 08 22:00:12 2015 Return-path: Envelope-to: geh-help-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 1Yfw8x-0007Fk-Je for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 22:00:11 +0200 Original-Received: from localhost ([::1]:54652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfw8x-0000Ke-07 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 16:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfw8l-0000KQ-BG for help-gnu-emacs@gnu.org; Wed, 08 Apr 2015 16:00:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfw8k-0005He-Bo for help-gnu-emacs@gnu.org; Wed, 08 Apr 2015 15:59:59 -0400 Original-Received: from mail-ie0-x229.google.com ([2607:f8b0:4001:c03::229]:33038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfw8i-0005GA-TX; Wed, 08 Apr 2015 15:59:56 -0400 Original-Received: by iebmp1 with SMTP id mp1so84031946ieb.0; Wed, 08 Apr 2015 12:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Luy8Rf7fN7x/JZepeLu8Xyo2bcabh01aws9mb6hogTA=; b=GQx9uz3Zu7lT15L8nq0sq5kse5wPuftPEFgSgmuJ6SsNBIT6QHpKKhwITR20/j6u0T HA0f+5FQJTW/SJI2xVctsl2XGUazVOp/FGNzsZb/WHxx4Ipsm+RESGci7nyPRsZYKf2Q D+SwqWjJJcG9CZZcBNze0bqbw/k3yh94n98twfdxBhz3Z5kgndJ5miygNsn32Kyoxb8P a8U7kRe8sHR33D4YHA+8tq0gKQoulDbTCxv2nCbMDEzI+njNKiqWer2AD+uB5TSpx8JX RGMtys09dR2QEwSgF4LRYm2zlKHSH2hykqkqphEyHV1XZmr2RYwY7e7hCczgXXWMrK7c ns2g== X-Received: by 10.50.143.42 with SMTP id sb10mr14536478igb.49.1428523196328; Wed, 08 Apr 2015 12:59:56 -0700 (PDT) Original-Received: by 10.64.154.134 with HTTP; Wed, 8 Apr 2015 12:59:16 -0700 (PDT) In-Reply-To: <83mw2jglwn.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::229 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103588 Archived-At: --001a1134b3ceabfd4405133bf9aa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Here is the elisp code illustrating the issue. Run "emacs -Q" and make sure your window manager won't mess up with size of the frame (e.g. if you are using xmonad like I am, just make the frame floating). Open the attached file and do M-x eval-buffer. I get the following output A was on 1, after recenter it is on 1 B was on 1, after recenter it is on 1 C was on 1, after recenter it is on 1 D was on 1, after recenter it is on 1 E was on 1, after recenter it is on 0 F was on 1, after recenter it is on 0 G was on 1, after recenter it is on 0 H was on 1, after recenter it is on 0 This shows that running (recenter 0) at different points of the same screen line leads to different behavior and it seems that the difference comes from where the point would be without visual-line-mode. I think in all cases the point should be at the top of the line, but that is not the case for ABCD. On Wed, Apr 8, 2015 at 2:43 AM, Eli Zaretskii wrote: >> From: Milan Stanojevi=C4=87 >> Date: Tue, 7 Apr 2015 16:14:59 -0400 >> >> With visual-line-mode on, running (recenter 0) doesn't always put the >> point on the top-most line in the window. >> >> I experimented a bit and it seems that (recenter 0) doesn't work if >> the point is on the portion of the word that was moved down because of >> word-wrapping. >> >> For example, I have word "foobar" where "bar" can't fit on the line. >> With visual-line-mode off (and truncate-lines nil), "foo" will be one >> visual line and then "bar" on the next. If I turn on visual-line-mode, >> the whole "foobar" would move to the next visual line. If I then run >> (recenter 0) while point is inside "foo", the lines will move such >> that point ends up on line 2, but if I do it while the point is inside >> "bar" then the point will end up on line 1. I think the correct >> behavior would be to move to line 1 always. >> >> Is this a bug? >> >> I'm using emacs 24.4.1 with Motif toolkit. > > I cannot reproduce this, not in "emacs -Q". Can you provide a > complete self-contained recipe for reproducing the problem, starting > from "emacs -Q"? > > --001a1134b3ceabfd4405133bf9aa Content-Type: text/x-emacs-lisp; charset=US-ASCII; name="test-recenter.el" Content-Disposition: attachment; filename="test-recenter.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i895scoj0 KGxldCAoKHNhdmVkLWZyYW1lLXdpZHRoIChmcmFtZS13aWR0aCkpCiAgICAgICh3b3JkICJBQkNE RUZHSCIpKQogICh3aXRoLXRlbXAtYnVmZmVyCiAgICAoc3dpdGNoLXRvLWJ1ZmZlciAoY3VycmVu dC1idWZmZXIpKQogICAgKGRlbGV0ZS1vdGhlci13aW5kb3dzKQogICAgKHNldC1mcmFtZS13aWR0 aCAoc2VsZWN0ZWQtZnJhbWUpIDE1KQogICAgKHZpc3VhbC1saW5lLW1vZGUgMSkKICAgIChpbnNl cnQgKGNvbmNhdCAiMDEyMzQ1Njc4OSAiIHdvcmQpKQogICAgKGRvbGlzdCAoY2ggKGFwcGVuZCAo dmNvbmNhdCB3b3JkKSBuaWwpKSAKICAgICAgKGdvdG8tY2hhciAocG9pbnQtbWluKSkKICAgICAg KHJlY2VudGVyIDApCiAgICAgIChzZWFyY2gtZm9yd2FyZCAoY2hhci10by1zdHJpbmcgY2gpKSAo YmFja3dhcmQtY2hhcikKICAgICAgKGxldCAob2xkLXJvdyBuZXctcm93KQogICAgICAgIChzZXRx IG9sZC1yb3cgKGNkciAocG9zbi1jb2wtcm93IChwb3NuLWF0LXBvaW50KSkpKQogICAgICAgIChy ZWNlbnRlciAwKQogICAgICAgIChzZXRxIG5ldy1yb3cgKGNkciAocG9zbi1jb2wtcm93IChwb3Nu LWF0LXBvaW50KSkpKQogICAgICAgIChtZXNzYWdlICIlYyB3YXMgb24gJWQsIGFmdGVyIHJlY2Vu dGVyIGl0IGlzIG9uICVkIgogICAgICAgICAgICAgICAgIGNoIG9sZC1yb3cgbmV3LXJvdykpKSkK ICAoc2V0LWZyYW1lLXdpZHRoIChzZWxlY3RlZC1mcmFtZSkgc2F2ZWQtZnJhbWUtd2lkdGgpKQo= --001a1134b3ceabfd4405133bf9aa--