From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: goto-char doesn't stick Date: Wed, 14 Jun 2017 18:30:53 +0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f4030437a06cfc65000551e90b68" X-Trace: blaine.gmane.org 1497436300 16048 195.159.176.226 (14 Jun 2017 10:31:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2017 10:31:40 +0000 (UTC) Cc: emacs-devel To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 14 12:31:36 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dL5aJ-0003uN-Uz for ged-emacs-devel@m.gmane.org; Wed, 14 Jun 2017 12:31:36 +0200 Original-Received: from localhost ([::1]:47674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL5aP-0000fc-9s for ged-emacs-devel@m.gmane.org; Wed, 14 Jun 2017 06:31:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL5Zf-0000ei-IR for emacs-devel@gnu.org; Wed, 14 Jun 2017 06:30:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL5Ze-0004o6-Qb for emacs-devel@gnu.org; Wed, 14 Jun 2017 06:30:55 -0400 Original-Received: from mail-ua0-x235.google.com ([2607:f8b0:400c:c08::235]:32841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dL5Ze-0004nx-LP for emacs-devel@gnu.org; Wed, 14 Jun 2017 06:30:54 -0400 Original-Received: by mail-ua0-x235.google.com with SMTP id 68so74365727uas.0 for ; Wed, 14 Jun 2017 03:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vPeEkE638oKKrv7wf4PS+TqYIsje1Lh/GUL+azXkxWc=; b=RdckjDatsk1ZC76NpxjBYTg1URWcLPb6laG0SpiBKjzzDTf2TLvmzQURiwOcyHOdYj jvIn09IO4+oxS2BVHZe6ocSz5235Anlk49KiWN8MvycxeTiKjLPGtsG/8li+ixgRnGdo 1TZyb79A0K1VhTKj3Ys5Hl2jYe8pJlCsQtcg4mFNfW2hTJV6zjryjPwegf+h6xIP37kH tyUukuBDT0DtPQuRc7oOizBOTBZ0uHPqujJf5IenAFV0EkqYbPbeuuG+GpKnhTwYgzJ8 VWh89Y2XZGYEVjzf99G3kOw6IIu+Yzf4tGMDoYJgZRO36ZcToedGDMyyH5M4/ICGtHsD UyHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vPeEkE638oKKrv7wf4PS+TqYIsje1Lh/GUL+azXkxWc=; b=DnZAwmDczGjQsDHaH9b6kvzySgajUAYzM8ZRUzEZpiLQb72OtN1Zion9JdV7ts9JD5 QglJHSa4U7YNztfp752pUUY9j+2i2sZdWsHBMNBZjhwuwx2rjmPWgRdVsW8/U0cakgvW lZQBUUlPO464HLJcHC4XdIfXQUpYs3xa1FWkXsfUxNF8vFjzqEPad9aybUcFQBfS0xbU VD9q0XCw6UIeO/fytlneAcxcA0/5IdvwIU/6Xx7itIOnT1LigMPVH89V3VHEFLpJllfw sNeTbCSOTCzMt7S6NQJnICuuQqgVSd32HSxPZUnRBLb1dx/3awRciIQEskFIVaTUPbdq 1SUA== X-Gm-Message-State: AKS2vOxO2OoVQTSZLK2XTZxKQrybPOsX5Xfmk3VyfeZUPPNU5fFf5NyG LOd153/HRz7v6mE2/59mt7kCFvDUew== X-Received: by 10.176.24.231 with SMTP id d39mr5895852uah.22.1497436253871; Wed, 14 Jun 2017 03:30:53 -0700 (PDT) Original-Received: by 10.103.9.7 with HTTP; Wed, 14 Jun 2017 03:30:53 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215614 Archived-At: --f4030437a06cfc65000551e90b68 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 14 June 2017 at 18:26, Noam Postavsky wrote: > On Wed, Jun 14, 2017 at 5:45 AM, Elias M=C3=A5rtenson > 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 =E2=80=98progn=E2=80=99 form, the cursor returns to i= ts 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 =E2=80=98ielm=E2=80=99 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. --f4030437a06cfc65000551e90b68 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 1= 4 June 2017 at 18:26, Noam Postavsky <npostavs@users.sourcefo= rge.net> wrote:
On Wed, Jun 14, 2017 at 5:45 AM, Elias M=C3=A5rtenson <lokedhs@gmail.com> wrote:
>
>=C2=A0 =C2=A0 =C2=A0(progn
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(set-buffer "z")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char LOCATION))
>
> When I do this, point doesn't move. Or rather, it does move, but a= fter the
> conclusion of the =E2=80=98progn=E2=80=99 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 repr= oduce:

Just create a buffer "z", fill it with some text and place point= in a random position. Then open =E2=80=98ielm=E2=80=99 and type:

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

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