소스 검색

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>
Nicolas Goaziou 6 년 전
부모
커밋
031b75f500
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      lisp/org-agenda.el

+ 5 - 2
lisp/org-agenda.el

@@ -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