bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#1730: 23.0.60; line-move-visual doesn't forget


From: Lennart Borgman
Subject: bug#1730: 23.0.60; line-move-visual doesn't forget
Date: Tue, 30 Dec 2008 01:13:44 +0100

On Mon, Dec 29, 2008 at 11:55 PM, Lennart Borgman (gmail)
<address@hidden> wrote:
> It looks like line-move-visual keeps remember too much about which
> column it was in. To show that start from
>
>  emacs -Q
>
> and eval this code
>
> (defun ourcomments-move-beginning-of-line(arg)
>  "Move point to beginning of line or indentation.
> See `beginning-of-line' for ARG.
>
> If `line-move-visual' is on then the visual line beginning is
> first tried."
>  (interactive "p")
>  (let ((pos (point))
>        vis-pos)
>    (when line-move-visual
>      (line-move-visual -1 t)
>      (beginning-of-line)
>      (setq vis-pos (point))
>      (goto-char pos))
>    (call-interactively 'beginning-of-line arg)
>    (when (and vis-pos
>               (= vis-pos (point)))
>      (while (and (> pos (point))
>                  (not (eobp)))

Looking at the code I see that this can be taken care of by replacing
the line below with

   (let (last-command)
      (line-move-visual 1 t )))

So ... this is not a bug. Just unintended use.

>        (line-move-visual 1 t))
>      (line-move-visual -1 t))
>    (when (= pos (point))
>      (if (= 0 (current-column))
>          (skip-chars-forward " \t")
>        (backward-char)
>        (beginning-of-line)))))
>
> (global-set-key [home] 'ourcomments-move-beginning-of-line)
>
> The function is supposed to go to the beginning of the visual line
> first. This fails sometimes, see below.
>
> - Shrink the window width so that some lines wrap.
> - Go to a wrapped buffer line, to the first visual line of it.
> - Move forward some columns on that line.
> - Move down to next visual line (arrow down). You should still be on the
> same buffer line.
> - Press HOME.
>
> Point should now be on the beginning on the visual line where you
> pressed HOME. However it is on the line above instead, on the column you
> were before you pressed arrow down.
>
> Now do exactly the same except:
>
> - Before pressing HOME press arrow left followed by arrow right.
>
> Now after pressing HOME you should be on the beginning of the visual
> line as expected.
>
>
> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
>  of 2008-12-25
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt --cflags
> -Ic:/g/include -fno-crossjumping'
>
>
>
>
>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]