From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mC39LWXtql9cfQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 19:43:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ECnUKWXtql+fZgAAbx9fmQ (envelope-from ) for ; Tue, 10 Nov 2020 19:43:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6556C9403A6 for ; Tue, 10 Nov 2020 19:43:33 +0000 (UTC) Received: from localhost ([::1]:48274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcZYC-000876-Ca for larch@yhetil.org; Tue, 10 Nov 2020 14:43:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcZN6-00088a-Id; Tue, 10 Nov 2020 14:32:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcZN4-0000CY-GK; Tue, 10 Nov 2020 14:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcZN4-0005Eq-CR; Tue, 10 Nov 2020 14:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Tue, 10 Nov 2020 19:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44524 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: To: 44524@debbugs.gnu.org Received: via spool by 44524-submit@debbugs.gnu.org id=B44524.160503669918941 (code B ref 44524); Tue, 10 Nov 2020 19:32:02 +0000 Received: (at 44524) by debbugs.gnu.org; 10 Nov 2020 19:31:39 +0000 Received: from localhost ([127.0.0.1]:38901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcZMg-0004v9-NR for submit@debbugs.gnu.org; Tue, 10 Nov 2020 14:31:38 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcZMe-0004no-Cm; Tue, 10 Nov 2020 14:31:37 -0500 X-Originating-IP: 91.129.97.46 Received: from mail.gandi.net (m91-129-97-46.cust.tele2.ee [91.129.97.46]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id D30C11BF209; Tue, 10 Nov 2020 19:31:28 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87lffbycdx.fsf@mail.linkov.net> Date: Tue, 10 Nov 2020 21:28:54 +0200 In-Reply-To: <87lffbycdx.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 08 Nov 2020 21:41:30 +0200") Message-ID: <87361hko3t.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: CF7J36m4qYrb tags 44524 fixed close 44524 28.0.50 quit > Package: emacs,org-mode > > 0. emacs -Q > 1. enable save-place-mode > 2. visit an org file with a single line: > > #+DATE: 2020-11-08 > > The cursor always jumps to the fixed place inside the date, > and doesn't remember its previous position. Here is a fix > to not set buffer-file-name (that causes save-place-mode to save > wrong place for that file name) in a temporary buffer: > > diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el > index be74dfdbef..d1fa777aa6 100644 > --- a/lisp/org/org-element.el > +++ b/lisp/org/org-element.el > @@ -4144,7 +4144,8 @@ org-element-parse-secondary-string > (dolist (v local-variables) > (ignore-errors > (if (symbolp v) (makunbound v) > - (set (make-local-variable (car v)) (cdr v))))) > + (unless (memq (car v) '(buffer-file-name buffer-file-truename)) > + (set (make-local-variable (car v)) (cdr v)))))) > ;; Transferring local variables may put the temporary buffer > ;; into a read-only state. Make sure we can insert STRING. > (let ((inhibit-read-only t)) (insert string)) Pushed to Emacs master, and closed.