[Top][All Lists]

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

Re: goto-char doesn't stick

From: Elias Mårtenson
Subject: Re: goto-char doesn't stick
Date: Wed, 14 Jun 2017 18:30:53 +0800

On 14 June 2017 at 18:26, Noam Postavsky <address@hidden> wrote:
On Wed, Jun 14, 2017 at 5:45 AM, Elias Mårtenson <address@hidden> wrote:
>     (progn
>       (set-buffer "z")
>       (goto-char LOCATION))
> When I do this, point doesn't move. Or rather, it does move, but after the
> conclusion of the ‘progn’ form, the cursor returns to its original location.

Is the buffer "z" visible? You probably need to set-window-point too.

The same behaviour is seen regardless of whether the buffer is visible or not.

It's easy to reproduce:

Just create a buffer "z", fill it with some text and place point in a random position. Then open ‘ielm’ and type:

    (progn (set-buffer "z") (goto-char (point-min)))

Then switch to buffer "z" and observe that point is still in its original position.

reply via email to

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