branch: externals/hyperbole commit 9ebcba0229fc6e4301e3d8c862569610f9fbbc2b Author: Robert Weiner <r...@gnu.org> Commit: Robert Weiner <r...@gnu.org>
Ensure outline root 0 cell file attribute is updated when reading in --- ChangeLog | 5 +++++ kotl/kview.el | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ef802019e..6e2d47cd2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-01-20 Bob Weiner <r...@gnu.org> + +* kotl/kview.el (kview:create): Ensure top-level 0 cell file attribute is always updated + to match current file location. + 2022-01-19 Bob Weiner <r...@gnu.org> * kotl/kotl-mode.el (kotl-mode:set-cell-attribute, kotl-mode:remove-cell-attribute): diff --git a/kotl/kview.el b/kotl/kview.el index 86ffcda6ea..ed0741a9f3 100644 --- a/kotl/kview.el +++ b/kotl/kview.el @@ -619,8 +619,11 @@ BLANK-LINES, LEVELS-TO-SHOW, and LINES-TO-SHOW may also be given, otherwise defa ;; Don't recreate view if it exists. (unless (and (boundp 'kview) (kview:is-p kview) (eq (kview:buffer kview) buf)) (make-local-variable 'kview) - (unless top-cell-attributes - (setq top-cell-attributes (list 'file buffer-file-name 'id-counter id-counter))) + ;; File location may have changed since saved, so always inject the + ;; current file name here and update cell count id-counter. + (setq top-cell-attributes + (plist-put (plist-put top-cell-attributes 'id-counter id-counter) + 'file buffer-file-name)) (setq kview (list 'kview 'plist (list 'view-buffer (current-buffer)