branch: externals/org-modern
commit 973c285b30f1d623e8c047f27139625b90202da6
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Better fix for tag alignment
---
 README.org    |  1 -
 org-modern.el | 11 ++++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index bca63d6305..eb620b0299 100644
--- a/README.org
+++ b/README.org
@@ -88,7 +88,6 @@ screenshot above.
  org-pretty-entities t
 
  ;; Agenda styling
- org-agenda-tags-column 0
  org-agenda-block-separator ?─
  org-agenda-time-grid
  '((daily today require-timed)
diff --git a/org-modern.el b/org-modern.el
index cacbbf3da3..3bc45ae195 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -909,11 +909,12 @@ whole buffer; otherwise, for the line at point."
           (goto-char (point-min))
           (let ((re (concat "\\( \\)\\(:\\(?:" org-tag-re "::?\\)+\\)[ 
\t]*$")))
             (while (re-search-forward re nil 'noerror)
-              ;; Hack to handle `org-agenda-align-tags-to-column'
-              (when (and (eq 'auto (bound-and-true-p 
org-agenda-align-tags-to-column))
-                         (eq ?\s (char-before (match-beginning 0))))
-                (put-text-property (1- (match-beginning 0)) (match-beginning 
0) 'invisible t))
-              (org-modern--tag))))
+              (let ((beg (- (match-beginning 0) 3)))
+                (org-modern--tag)
+                ;; Handle `org-agenda-tags-column' set to `auto'
+                (when (and (eq 'auto (bound-and-true-p org-agenda-tags-column))
+                           (save-excursion (goto-char beg) (looking-at-p "   
")))
+                  (delete-region beg (+ beg 3)))))))
         (when org-modern-priority
           (goto-char (point-min))
           (while (re-search-forward "\\(\\[#.\\]\\)" nil 'noerror)

Reply via email to