From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cBFwLM9LqF+QEAAA0tVLHw (envelope-from ) for ; Sun, 08 Nov 2020 19:49:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wPwuKM9LqF+4cwAAB5/wlQ (envelope-from ) for ; Sun, 08 Nov 2020 19:49:35 +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 1495894043A for ; Sun, 8 Nov 2020 19:49:34 +0000 (UTC) Received: from localhost ([::1]:54710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbqgv-0004aj-U1 for larch@yhetil.org; Sun, 08 Nov 2020 14:49:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbqgQ-0004Zj-Kg; Sun, 08 Nov 2020 14:49:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbqgQ-0002IX-BQ; Sun, 08 Nov 2020 14:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbqgQ-0001nD-9P; Sun, 08 Nov 2020 14:49: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: Sun, 08 Nov 2020 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44524 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: To: 44524@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16048648976823 (code B ref -1); Sun, 08 Nov 2020 19:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Nov 2020 19:48:17 +0000 Received: from localhost ([127.0.0.1]:33090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbqfh-0001lz-5N for submit@debbugs.gnu.org; Sun, 08 Nov 2020 14:48:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:42518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbqff-0001lq-Qo for submit@debbugs.gnu.org; Sun, 08 Nov 2020 14:48:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbqff-00048h-IZ for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2020 14:48:15 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:45293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbqfd-0002Ez-Ff for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2020 14:48:15 -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 B73A71BF203 for ; Sun, 8 Nov 2020 19:48:10 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET Date: Sun, 08 Nov 2020 21:41:30 +0200 Message-ID: <87lffbycdx.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: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/08 14:48:11 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.7 (--) 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: 2pFGbIXhJ9Eb --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-element-parse-secondary-string.patch 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)) --=-=-=--