mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:00:49 +00:00
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:
parent
cc9ae41738
commit
031b75f500
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue