Browse Source

Improve `org-fix-tags-on-the-fly'

* lisp/org.el (org-fix-tags-on-the-fly): Improve docstring.  Skip more
  cases.
Nicolas Goaziou 7 years ago
parent
commit
7aadf4fe8c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org.el

+ 4 - 4
lisp/org.el

@@ -19360,10 +19360,10 @@ The detailed reaction depends on the user option `org-catch-invisible-edits'."
 
 (defun org-fix-tags-on-the-fly ()
   "Align tags in headline at point.
-Unlike to `org-align-tags', this function does nothing if point
-is not currently on a headline."
-  (when (and (eq (char-after (line-beginning-position)) ?*) ;short-circuit
-	     (org-at-heading-p))
+Unlike `org-align-tags', this function does nothing if point is
+either not currently on a tagged headline or on a tag."
+  (when (and (org-match-line org-tag-line-re)
+	     (< (point) (match-beginning 1)))
     (org-align-tags)))
 
 (defun org-delete-backward-char (N)