Org-mode mailing list
 help / color / mirror / Atom feed
* bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode
@ 2020-11-08 19:41 Juri Linkov
  2020-11-10 19:28 ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2020-11-08 19:41 UTC (permalink / raw)
  To: 44524

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode
  2020-11-08 19:41 bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode Juri Linkov
@ 2020-11-10 19:28 ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2020-11-10 19:28 UTC (permalink / raw)
  To: 44524

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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-10 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 19:41 bug#44524: 28.0.50; Wrong place saved in org file with save-place-mode Juri Linkov
2020-11-10 19:28 ` Juri Linkov

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git