emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 44524@debbugs.gnu.org
Subject: bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode
Date: Sun, 08 Nov 2020 21:41:30 +0200	[thread overview]
Message-ID: <87lffbycdx.fsf@mail.linkov.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

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:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-element-parse-secondary-string.patch --]
[-- Type: text/x-diff, Size: 671 bytes --]

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)
 	      (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))

             reply	other threads:[~2020-11-08 19:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-08 19:41 Juri Linkov [this message]
2020-11-10 19:28 ` bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lffbycdx.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=44524@debbugs.gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).