|
@@ -6569,7 +6569,47 @@ Paragraph<point>"
|
|
|
(equal "* H1 :foo:\n* H2 :bar:"
|
|
|
(org-test-with-temp-text "* H1 :foo:\n* H2 :bar:"
|
|
|
(let ((org-tags-column 1)) (org-set-tags-command '(4)))
|
|
|
- (buffer-string)))))
|
|
|
+ (buffer-string))))
|
|
|
+ ;; Point does not move with empty headline.
|
|
|
+ (should
|
|
|
+ (equal ":foo:"
|
|
|
+ (org-test-with-temp-text "* <point>"
|
|
|
+ (cl-letf (((symbol-function 'completing-read)
|
|
|
+ (lambda (&rest args) ":foo:")))
|
|
|
+ (let ((org-use-fast-tag-selection nil)
|
|
|
+ (org-tags-column 1))
|
|
|
+ (org-set-tags-command)))
|
|
|
+ (buffer-substring (point) (line-end-position)))))
|
|
|
+ ;; Point does not move at start of line.
|
|
|
+ (should
|
|
|
+ (equal "* H1 :foo:"
|
|
|
+ (org-test-with-temp-text "* H1"
|
|
|
+ (cl-letf (((symbol-function 'completing-read)
|
|
|
+ (lambda (&rest args) ":foo:")))
|
|
|
+ (let ((org-use-fast-tag-selection nil)
|
|
|
+ (org-tags-column 1))
|
|
|
+ (org-set-tags-command)))
|
|
|
+ (buffer-substring (point) (line-end-position)))))
|
|
|
+ ;; Point does not move when within *'s.
|
|
|
+ (should
|
|
|
+ (equal "* H1 :foo:"
|
|
|
+ (org-test-with-temp-text "*<point>* H1"
|
|
|
+ (cl-letf (((symbol-function 'completing-read)
|
|
|
+ (lambda (&rest args) ":foo:")))
|
|
|
+ (let ((org-use-fast-tag-selection nil)
|
|
|
+ (org-tags-column 1))
|
|
|
+ (org-set-tags-command)))
|
|
|
+ (buffer-substring (point) (line-end-position)))))
|
|
|
+ ;; Point workaround does not get fooled when looking at a space.
|
|
|
+ (should
|
|
|
+ (equal " b :foo:"
|
|
|
+ (org-test-with-temp-text "* a<point> b"
|
|
|
+ (cl-letf (((symbol-function 'completing-read)
|
|
|
+ (lambda (&rest args) ":foo:")))
|
|
|
+ (let ((org-use-fast-tag-selection nil)
|
|
|
+ (org-tags-column 1))
|
|
|
+ (org-set-tags-command)))
|
|
|
+ (buffer-substring (point) (line-end-position))))))
|
|
|
|
|
|
(ert-deftest test-org/toggle-tag ()
|
|
|
"Test `org-toggle-tag' specifications."
|