From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: goto-char doesn't stick Date: Thu, 15 Jun 2017 07:37:01 -0400 Message-ID: References: <03485ABD-CF71-4FF8-B887-ED7607341EBD@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1497526679 31782 195.159.176.226 (15 Jun 2017 11:37:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 11:37:59 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 15 13:37:50 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 1dLT5w-0007Nn-6B for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 13:37:48 +0200 Original-Received: from localhost ([::1]:53332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLT5v-0007Kq-6D for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 07:37:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLT5F-0007Kl-WA for emacs-devel@gnu.org; Thu, 15 Jun 2017 07:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLT5F-00055r-18 for emacs-devel@gnu.org; Thu, 15 Jun 2017 07:37:05 -0400 Original-Received: from mail-ot0-x229.google.com ([2607:f8b0:4003:c0f::229]:34659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLT5E-00055V-SM for emacs-devel@gnu.org; Thu, 15 Jun 2017 07:37:04 -0400 Original-Received: by mail-ot0-x229.google.com with SMTP id r67so7810418ota.1 for ; Thu, 15 Jun 2017 04:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bPRfx33l2l3XbSzgJDdq6gjmc2EmkUbI5XCRequmMos=; b=HpDbRXNtisi54u4WU6hBadhhXGMfm4cuKjWSWOSbsQVwCqMvG7DE+oiC1uWGeisj2I AKaYJDB/7nBbHt3wOUjZCSQ08CrIwmqK6cWzg2MtnHHPpUUKa7d5mGvyTcNHUvNCBQ+V GxswBmYPFT95mLVmUjSip9/doXXxNMHW7+yuiGVD+WkM2UYM5Dk3B2bESUBLrVXp0lBa UVxIh5Ii6jCrpXu+q+ft6RpdhS8lnGCn9YIDsgF8fWancQQ4Lehl6Q88fyOOOTnUm61+ s0k3zhVM+2vOpGAOBZb0NPv+Jwf+ytpLXlVMzkD21IehS5+2zAFhfy0WCTYScn0g8SRr T8FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=bPRfx33l2l3XbSzgJDdq6gjmc2EmkUbI5XCRequmMos=; b=GKYBDZ/VYCK6bt3Vtg5yOg/jgrdAxZ+2wnxOHrRPyhnIXlcdg51dNsOn+WUPEcqpyN 4zWZfixTLbm/wY69P6qpW1nv/Gt0DqNDS8ueW6ItOd0Hi5nTZCbG14FXZb5toURW7cIV Cfpx1s2HBQxS4rP4EVqIBqeJ7KOD4AuVagh+oMY61DpNtlM0gxF0U8eucxV1bAIv9i5D 4Q6/0XSicBtqNXpTOXnRmuf2de9xXVz9bh1VcKLfHHTCW5I5ekx1l2qSnPcDSPwbG9Ns di6brEjtjo/yKqeyqPKWIjA73ggmyRDe7BKPCpyvo5lyIFITE6D5c511+FdbI/GQZwQB uR3Q== X-Gm-Message-State: AKS2vOyryzXmOUzFGfoAcuTZHtXNdLyRWUaaXUBi/5j1SfAyk+OWtfU5 4Bd5RmOu7fdIQCWiKRmfx8cmCWkeNg== X-Received: by 10.157.16.102 with SMTP id o35mr3217914oto.192.1497526622554; Thu, 15 Jun 2017 04:37:02 -0700 (PDT) Original-Received: by 10.74.113.80 with HTTP; Thu, 15 Jun 2017 04:37:01 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 5Pgw04L33GuuoqezAqhie8cp9As X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::229 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:215635 Archived-At: On Thu, Jun 15, 2017 at 2:59 AM, Stefan Monnier wrote: >>> (progn >>> (set-buffer "z") >>> (goto-char LOCATION)) > [...] >> It's a feature, new in Emacs 26. If you don't like it, turn off >> switch-to-buffer-preserve-window-point. > > Really? Why would set-buffer+goto-char be affected by a variable named > switch-to-buffer-* ? The switch-to-buffer-preserve-window-point affects point when you switch to buffer "z" later. > To me it sounds like Noam is right: Elias just needs to set-window-point > instead of goto-char (or additionally to, if he needs goto-char for some > other reason). No, I verified that it happens when "z" is not displayed in any window. Maybe we should provide set-preserved-window-point? Or set-user-visible-point which would set all of point, window-point, and preserved window-point (although I'm not sure how to deal with the multi-window case cleanly)?