From 66260f723b64e20598766f14982f13c98fe40ee8 Mon Sep 17 00:00:00 2001 Message-Id: <66260f723b64e20598766f14982f13c98fe40ee8.1660372414.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 13 Aug 2022 14:28:55 +0800 Subject: [PATCH] org-align-tags: Fix tag alignment in inlinetasks * lisp/org.el (org-align-tags): Re-use 'line-prefix text property when `org-indent-mode' is enabled. The old version partially copy-pasted the org-indent code and missed the new changes in inlinetask alignment. The new approach should be robust against future org-indent changes. Fixes https://orgmode.org/list/25334.19025.107017.390781@gargle.gargle.HOWL --- lisp/org.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4eef56f45..2f528aaa4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11519,8 +11519,12 @@ (defun org-align-tags (&optional all) (let ((get-indent-column (lambda () (let ((offset (if (bound-and-true-p org-indent-mode) - (* (1- org-indent-indentation-per-level) - (1- (org-current-level))) + (save-excursion + (org-back-to-heading-or-point-min) + (length + (get-text-property + (line-end-position) + 'line-prefix))) 0))) (+ org-tags-column (if (> org-tags-column 0) (- offset) offset)))))) -- 2.35.1