diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-12 23:34:14 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-12 23:34:14 +0100 |
commit | 25f29e1e4444cfa170daa4ed523da6c5c4536002 (patch) | |
tree | 045b854932fbeea67eb0749a220186b2ebb8f67d | |
parent | 232160cf7ae47b7f4b96cc9c0087f3f13c561134 (diff) | |
parent | e54f09af5005581a49da5d42d53a6c8ef19127de (diff) | |
download | org-mode-25f29e1e4444cfa170daa4ed523da6c5c4536002.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-macs.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el index d3e5932..4658d57 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -193,8 +193,16 @@ because otherwise all these markers will point to nowhere." (when local-variables (org-with-wide-buffer (goto-char (point-max)) - (unless (bolp) (insert "\n")) - (insert local-variables)))))) + ;; If last section is folded, make sure to also hide file + ;; local variables after inserting them back. + (let ((overlay + (cl-find-if (lambda (o) + (eq 'outline (overlay-get o 'invisible))) + (overlays-at (1- (point)))))) + (unless (bolp) (insert "\n")) + (insert local-variables) + (when overlay + (move-overlay overlay (overlay-start overlay) (point-max))))))))) (defmacro org-no-popups (&rest body) "Suppress popup windows and evaluate BODY." |