Ver Fonte

org.el (org-fixup-indentation): Fix logbook drawers indentation

* lisp/org.el (org-fixup-indentation): Fix logbook drawers
indentation.

Reported-by: Matt Lundin <mdl@imapmail.org>
https://orgmode.org/list/87r1t8sdhd.fsf@fastmail.fm/
Bastien há 4 anos atrás
pai
commit
11ef7454ab
1 ficheiros alterados com 5 adições e 3 exclusões
  1. 5 3
      lisp/org.el

+ 5 - 3
lisp/org.el

@@ -7381,9 +7381,11 @@ Assume point is at a heading or an inlinetask beginning."
      (forward-line)
      (org-indent-region (match-beginning 0) (match-end 0)))
    (when (looking-at org-logbook-drawer-re)
-     (goto-char (match-end 0))
-     (forward-line)
-     (org-indent-region (match-beginning 0) (match-end 0)))
+     (let ((end-marker  (move-marker (make-marker) (match-end 0)))
+	   (ci (current-indentation)))
+       (while (and (not (> (point) end-marker)) (>= ci diff))
+	 (indent-line-to (+ ci diff))
+	 (forward-line))))
    (catch 'no-shift
      (when (or (zerop diff) (not (eq org-adapt-indentation t)))
        (throw 'no-shift nil))