From 8f338ca48c67558556a268a77ca9dcff19e581e5 Mon Sep 17 00:00:00 2001 From: John Maximilian <2e0byo@gmail.com> Date: Wed, 13 Apr 2022 12:23:41 +0100 Subject: [PATCH] fix: save point before making frame in case it moves. --- org-noter.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org-noter.el b/org-noter.el index 129d61c..0807ae7 100644 --- a/org-noter.el +++ b/org-noter.el @@ -365,6 +365,11 @@ The title used will be the default one." (or (buffer-base-buffer) (current-buffer)) (generate-new-buffer-name (concat "Notes of " display-name)) t)) + ;; NOTE(2e0byo): `make-frame' can modify point, possibly by calling a + ;; hook. Thus we save the point before making the frame in case it + ;; moves. + (starting-point (point)) + (session (make-org-noter--session :id (org-noter--get-new-id) @@ -392,8 +397,7 @@ The title used will be the default one." :closest-tipping-point (org-noter--property-or-default closest-tipping-point) :modified-tick -1)) - (target-location org-noter--start-location-override) - (starting-point (point))) + (target-location org-noter--start-location-override)) (add-hook 'delete-frame-functions 'org-noter--handle-delete-frame) (push session org-noter--sessions)