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 22:59:18 +0800 Message-ID: References: <03485ABD-CF71-4FF8-B887-ED7607341EBD@gnu.org> <83wp8e3ahr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403043c399012bbbd0551ecccfd" X-Trace: blaine.gmane.org 1497452377 25127 195.159.176.226 (14 Jun 2017 14:59:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2017 14:59:37 +0000 (UTC) Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 14 16:59:31 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 1dL9lZ-00062e-4M for ged-emacs-devel@m.gmane.org; Wed, 14 Jun 2017 16:59:29 +0200 Original-Received: from localhost ([::1]:49476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL9le-00042A-8N for ged-emacs-devel@m.gmane.org; Wed, 14 Jun 2017 10:59:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL9lV-00040o-7J for emacs-devel@gnu.org; Wed, 14 Jun 2017 10:59:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL9lU-0005Ax-AV for emacs-devel@gnu.org; Wed, 14 Jun 2017 10:59:25 -0400 Original-Received: from mail-ua0-x232.google.com ([2607:f8b0:400c:c08::232]:33869) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dL9lS-0005A9-O3; Wed, 14 Jun 2017 10:59:22 -0400 Original-Received: by mail-ua0-x232.google.com with SMTP id m31so2429374uam.1; Wed, 14 Jun 2017 07:59:22 -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=KETPKlZOzmU6aNZLs2K1oLjXM6nvGH2X7Qo1ZJii34U=; b=Vy8BNX38d0MpKNNDMvUefjn70hc2vkNNbGVxLa9RJ99Kw+1u/UC865RiOWRDrLVJiK j6rjlehosSHzIHgFBxHOV1MxHwIzqHTFLRA/oSFG1pUDCqpkkyXs+ibNzeF94vCwErHb fnsnrC/ELMrjmwGN3nzbFLo/DIz2DA8vxl6jhB+HcARZMCMMqa5a9vJvraXPfWT+lwSF 5fxRH8oa/hene83Nm/Us4QtWuxqsiwcjqG23llv8ktBFV2etgy5jssTmDvTF8rJ3wDES RmHT8TfMVD5xsIDwSsczlOOUpEx1Y0kfleh+MxeIwR1V9E05pPllZ2nUaqUNn5ObAjKd qLkA== 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=KETPKlZOzmU6aNZLs2K1oLjXM6nvGH2X7Qo1ZJii34U=; b=RAsttpYKq4FuMTJg6JAxDULEfkujwSg+KJSxmgv0q3UveAuJ/S8Ki0cWjZkwr7EP9o NTpekYAxx1CBWOzz5E7eUVM+LQL++t5q2mKmCRCroK00TYeJO5IjWwKx3N6eWLjp52vB r4mBkm/iX55dLHs3Hscow+GNjcrs6zIy8brW0UrHr0WQD6v391x/huhfj6/TMohMi5Ev +iGugUncFjASAvwMs5eiJiviZXLWMnKUTTABYrIiDzv4j+2NkhuxhLM7MIvRcQrZEGKf MF5VMq8/T6DrQcbJDfdE8w6Uld5HEzkxhqWC8Rag33sdXkqDNHVuC5bdU1jjjUvbgpux 7sUw== X-Gm-Message-State: AKS2vOxIfiDfN7phSLpFN1zvd5zFYWau0ZXcjWCnd8ulWGR6xZMMFzoU MDnQnrNCICvFaOBGN666GPNbkIjzokNo X-Received: by 10.176.79.32 with SMTP id n32mr339161uah.101.1497452361462; Wed, 14 Jun 2017 07:59:21 -0700 (PDT) Original-Received: by 10.103.9.7 with HTTP; Wed, 14 Jun 2017 07:59:18 -0700 (PDT) Original-Received: by 10.103.9.7 with HTTP; Wed, 14 Jun 2017 07:59:18 -0700 (PDT) In-Reply-To: <83wp8e3ahr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::232 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:215624 Archived-At: --f403043c399012bbbd0551ecccfd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 14 Jun 2017 16:33, "Eli Zaretskii" wrote: > From: Elias M=C3=A5rtenson > Date: Wed, 14 Jun 2017 19:16:42 +0800 > Cc: emacs-devel > > It's a feature, new in Emacs 26. If you don't like it, turn off > switch-to-buffer-preserve-window-point. > Perhaps we should have a let-bindable variable to momentsrily disable this. > > Thanks. I think a variable for this would be great. That would make the SLIME fix reasonably small. Actually, I think a let-binding would be only rarely useful, since in most similar cases point is restored after all your forms already returned, and Emacs is restoring the window's buffer to its previous value as part of its main loop. Instead, I think you can prevent point from being restored as in your use case by filtering the offending buffer from the window's prev-buffers list, by using window-prev-buffers and set-window-prev-buffers as part of the Lisp code which moves point in that buffer. Thanks. I'll look at this in a few hours when I get back to the computer. However, based on what you told me, it seems as though I need to change some buffer-wide or window-wide setting. Is this correct, or did I misunderstand? Ideally, the SLIME fix should not have any impact outside the function in question. Regards, Elias --f403043c399012bbbd0551ecccfd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 14 Jun 2017 16:33, "Eli Zaretskii" <eliz@gnu.org> wrote:
> From: Elias M=C3=A5rtenson <lokedhs@gmail.com>
> Date: Wed, 14 Jun 2017 19:16:42 +0800
> Cc: emacs-devel <emacs-devel= @gnu.org>
>
>=C2=A0 It's a feature, new in Emacs 26. If you don't like it, t= urn off
>=C2=A0 switch-to-buffer-preserve-window-point.
>=C2=A0 Perhaps we should have a let-bindable variable to momentsrily di= sable this.
>
> Thanks. I think a variable for this would be great. That would make th= e SLIME fix reasonably small.

Actually, I think a let-binding would be only rarely useful, since in=
most similar cases point is restored after all your forms already
returned, and Emacs is restoring the window's buffer to its previous value as part of its main loop.

Instead, I think you can prevent point from being restored as in your
use case by filtering the offending buffer from the window's
prev-buffers list, by using window-prev-buffers and
set-window-prev-buffers as part of the Lisp code which moves point in
that buffer.

= Thanks. I'll look at this in a few hours when I get back to the compute= r.=C2=A0

However, based on what you told me, it seems = as though I need to change some buffer-wide or window-wide setting. Is this= correct, or did I misunderstand?=C2=A0

Ideally, the SL= IME fix should not have any impact outside the function in question.=C2=A0<= /div>

Regards,=C2=A0
Elias=C2=A0
--f403043c399012bbbd0551ecccfd--