org-agenda: Fix tags alignment

* lisp/org-agenda.el (org-agenda-align-tags): Fix regexp.  Improve
  docstring.

The regression was introduced in "Use `org-tag-line-re'".

Reported-by: Xu Chunyang <mail@xuchunyang.me>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00587.html>
This commit is contained in:
Nicolas Goaziou 2018-04-29 09:57:33 +02:00
parent cc9ae41738
commit 031b75f500
1 changed files with 5 additions and 2 deletions

View File

@ -8995,15 +8995,18 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
(beginning-of-line 0)))))
(defun org-agenda-align-tags (&optional line)
"Align all tags in agenda items to `org-agenda-tags-column'."
"Align all tags in agenda items to `org-agenda-tags-column'.
When optional argument LINE is non-nil, align tags only on the
current line."
(let ((inhibit-read-only t)
(org-agenda-tags-column (if (eq 'auto org-agenda-tags-column)
(- (window-text-width))
org-agenda-tags-column))
(end (if line (line-end-position) (point-max)))
l c)
(save-excursion
(goto-char (if line (line-beginning-position) (point-min)))
(while (re-search-forward org-tag-line-re (and line (line-end-position)) t)
(while (re-search-forward org-tag-group-re end t)
(add-text-properties
(match-beginning 1) (match-end 1)
(list 'face (delq nil (let ((prop (get-text-property