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 19:29:48 -0400 Message-ID: References: <83mw2jglwn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1428535858 11360 80.91.229.3 (8 Apr 2015 23:30:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 23:30:58 +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 Thu Apr 09 01:30:56 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 1YfzQs-0005ls-Ii for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Apr 2015 01:30:54 +0200 Original-Received: from localhost ([::1]:55386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfzQr-00029a-MV for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 19:30:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfzQY-00029T-7k for help-gnu-emacs@gnu.org; Wed, 08 Apr 2015 19:30:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfzQW-0002oe-Oe for help-gnu-emacs@gnu.org; Wed, 08 Apr 2015 19:30:34 -0400 Original-Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:36609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfzQU-0002m2-Ce; Wed, 08 Apr 2015 19:30:30 -0400 Original-Received: by iebrs15 with SMTP id rs15so87873065ieb.3; Wed, 08 Apr 2015 16:30:29 -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:content-transfer-encoding; bh=+2hQHoWug4L+HayALvWXVMqP+goQSkZAigxdOFVnkNc=; b=B+68438TZapfLGZHg5ZB6YvV9AvvmDG9nWIdYIxMh6ZvdFATfIPgwSYQEWI0+O0iLz z1EWHzvlaA3iEU1+S/Bql7mcIhzZ0m6L+GJGT8StOFq/7g6QFmxU5Zuj2QXMIlnbzZbJ CvVau3B4+jX/E7qT9YMuBIbWw41zEjIA0O3jg5TVHk9n96pGVtkHt78qBU5Gq+UgpeHP poDurHHlLGWgkIU16dDz4K9z3SZngMXB0KTLmkx1AHEvRRP4B+DPJ40NRmsLrfq7poGg YAl6EQnhRjeBg6qoudwDKQ+CWszjAsW0mQWgsf7J4XUjKoJL2EYRXy2epFL3XHOoQ9WD TPHw== X-Received: by 10.107.27.143 with SMTP id b137mr42623338iob.76.1428535829179; Wed, 08 Apr 2015 16:30:29 -0700 (PDT) Original-Received: by 10.64.154.134 with HTTP; Wed, 8 Apr 2015 16:29:48 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22f 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:103593 Archived-At: Btw, I get slightly different output if I ran emacs in terminal, i.e. emacs -Q -nw 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 0 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 which I think confirms my suspicion because in terminal mode the last character on the long line is backslash, so D is moved down, whereas in graphical mode instead of backslash the fringe is used as an indicator that logical line is too long. On Wed, Apr 8, 2015 at 3:59 PM, Milan Stanojevi=C4=87 w= rote: > 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"? >> >>