summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2019-01-04 08:59:10 -0500
committerKaushal Modi <kaushal.modi@gmail.com>2019-01-04 08:59:10 -0500
commitb334a59902bc74fa4cf5ece1ac3ddf3ea3e0671e (patch)
treee9f045f6c352eea361ea7400a72cf4b42c11e977
parent7db8ebc1df2f1c85060724ccf4e24fa9d0d21bc3 (diff)
parent539091799b370a1c452fe4952e8074d7dfe8656f (diff)
downloadorg-mode-b334a59902bc74fa4cf5ece1ac3ddf3ea3e0671e.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el6
-rw-r--r--testing/lisp/test-org.el16
2 files changed, 19 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 631407e..2273a69 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14235,8 +14235,10 @@ visible part of the buffer."
(org--align-tags-here (funcall get-indent-column))
(save-excursion
(if all
- (while (re-search-forward org-tag-line-re nil t)
- (org--align-tags-here (funcall get-indent-column)))
+ (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)))))))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 6e1abc8..a77c0f7 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -6121,7 +6121,21 @@ Paragraph<point>"
(let ((org-tags-column 78)
(indent-tabs-mode nil))
(org-fix-tags-on-the-fly))
- (current-column)))))
+ (current-column))))
+ ;; Aligning all tags in visible buffer.
+ (should
+ ;; 12345678901234567890
+ (equal (concat "* Level 1 :abc:\n"
+ "** Level 2 :def:")
+ (org-test-with-temp-text (concat "* Level 1 :abc:\n"
+ "** Level 2 :def:")
+ (let ((org-tags-column -20)
+ (indent-tabs-mode nil))
+ ;; (org-align-tags :all) must work even when the point
+ ;; is at the end of the buffer.
+ (goto-char (point-max))
+ (org-align-tags :all))
+ (buffer-string)))))
(ert-deftest test-org/get-tags ()
"Test `org-get-tags' specifications."