branch: externals/org-transclusion
commit 6e5e6eb589dd5204a2297289b2d21ccbcd1bcce9
Author: Noboru Ota <[email protected]>
Commit: Noboru Ota <[email protected]>

    fix: incorrect indent when no-first-heading and only-contents
    
    Moved the following piece:
    
    ;; Fix indentation when `org-adapt-indentation' is non-nil
    (org-indent-region beg end-mkr)
---
 org-transclusion.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index cb7aae7577..39f2650a6f 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1181,6 +1181,8 @@ Return nil if not found."
         ;; `org-transclusion-keyword-remove' checks element at point is a
         ;; keyword or not
         (org-transclusion-keyword-remove)
+        ;; Fix indentation when `org-adapt-indentation' is non-nil
+        (org-indent-region beg end-mkr)
         (setq end (marker-position end-mkr))))
     ;; Assume beg and end are non-nil?
     (when (and beg end)
@@ -1267,7 +1269,6 @@ This function is the default for org-transclusion-type 
(TYPE)
     (with-temp-buffer
       ;; 
https://github.com/nobiot/org-transclusion/pull/282#issuecomment-3676553675
       ;; Advice by meedstrom:
-
       ;; First insert content, then enable Org-mode afterwards, so that
       ;; `org-set-regexps-and-options' can process "#+STARTUP: odd" and other 
things.
       ;; These let-bindings are safe methods of speeding it up.
@@ -1279,9 +1280,7 @@ This function is the default for org-transclusion-type 
(TYPE)
         ;; Adjust headline levels
         (org-transclusion-content-format-org-headlines
          type content keyword-values)
-
         ;; TODO The following two formatting operations should be in a 
function.
-
         ;; Fix table alignment
         (let ((point (point-min)))
           (while point
@@ -1290,9 +1289,6 @@ This function is the default for org-transclusion-type 
(TYPE)
               (org-table-align)
               (goto-char (org-table-end)))
             (setq point (search-forward "|" (point-max) t))))
-
-        ;; Fix indentation when `org-adapt-indentation' is non-nil
-        (org-indent-region (point-min) (point-max))
         ;; Return the temp-buffer's string
         (buffer-string)))))
 

Reply via email to