~bzg/org-mode

aa3980dd7f41c52a38d08cff2a1b66881786a443 — Ihor Radchenko 13 days ago 513534f
test-org/return: Add test clauses for `org-return' at citations

* testing/lisp/test-org.el (test-org/return): Add new tests checking
new functionality of `org-return' at citations and citation
references.
1 files changed, 31 insertions(+), 1 deletions(-)

M testing/lisp/test-org.el
M testing/lisp/test-org.el => testing/lisp/test-org.el +31 -1
@@ 1646,7 1646,37 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46] =>  0:46"
	    (setq-local fill-column 10)
	    (auto-fill-mode 1)
	    (org-return)
	    (buffer-string)))))
	    (buffer-string))))
  ;; When `org-return-follows-link' is non-nil, run `org-open-at-point'
  ;; on citation.
  (should
   (org-test-with-temp-text "[c<point>ite: @key1; @key2]"
     (catch :called
       (cl-letf (((symbol-function 'org-open-at-point)
                  (lambda (&rest _) (interactive) (throw :called t))))
         (let ((org-return-follows-link t)) (org-return))
         nil))))
  (should-not
   (org-test-with-temp-text "[c<point>ite: @key1; @key2]"
     (catch :called
       (cl-letf (((symbol-function 'org-open-at-point)
                  (lambda (&rest _) (interactive) (throw :called t))))
         (let ((org-return-follows-link nil)) (org-return))
         nil))))
  (should
   (org-test-with-temp-text "[cite: @k<point>ey1; @key2]"
     (catch :called
       (cl-letf (((symbol-function 'org-open-at-point)
                  (lambda (&rest _) (interactive) (throw :called t))))
         (let ((org-return-follows-link t)) (org-return))
         nil))))
  (should-not
   (org-test-with-temp-text "[cite: @k<point>ey1; @key2]"
     (catch :called
       (cl-letf (((symbol-function 'org-open-at-point)
                  (lambda (&rest _) (interactive) (throw :called t))))
         (let ((org-return-follows-link nil)) (org-return))
         nil)))))

(ert-deftest test-org/with-electric-indent ()
  "Test RET and C-j specifications with `electric-indent-mode' on."