Function: org-align-tags

org-align-tags is a byte-compiled function defined in org.el.gz.

Signature

(org-align-tags &optional ALL)

Documentation

Align tags in current entry.

When optional argument ALL is non-nil, align all tags in the visible part of the buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-align-tags (&optional all)
  "Align tags in current entry.
When optional argument ALL is non-nil, align all tags in the
visible part of the buffer."
  (let ((get-indent-column
	 (lambda ()
	   (let ((offset (if (bound-and-true-p org-indent-mode)
                             (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))))))
    (if (and (not all) (org-at-heading-p))
	(org--align-tags-here (funcall get-indent-column))
      (save-excursion
	(if all
	    (progn
	      (goto-char (point-min))
	      (while (re-search-forward org-tag-line-re nil t)
		(org--align-tags-here (funcall get-indent-column))))
	  (org-back-to-heading t)
	  (org--align-tags-here (funcall get-indent-column)))))))