[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/clojure-ts-mode 07d9cf75f8 126/210: Make `beginning-of-def
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/clojure-ts-mode 07d9cf75f8 126/210: Make `beginning-of-defun` aware of clojure comment form |
Date: |
Thu, 31 Oct 2024 18:59:49 -0400 (EDT) |
branch: elpa/clojure-ts-mode
commit 07d9cf75f828e2f07862b4fce6b50af3ab604dab
Author: dan sutton <danielsutton01@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Make `beginning-of-defun` aware of clojure comment form
Remove seq-find usage
Move initialization of beginning-of-defun-function to correct spot
Use new function name in tests
Docstring for checkdoc
---
clojure-mode-sexp-test.el | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/clojure-mode-sexp-test.el b/clojure-mode-sexp-test.el
index f8c555b84a..1faf1039b4 100644
--- a/clojure-mode-sexp-test.el
+++ b/clojure-mode-sexp-test.el
@@ -22,6 +22,51 @@
(require 'clojure-mode)
(require 'ert)
+(defmacro clojure-buffer-with-text (text &rest body)
+ "Run body in a temporary clojure buffer with TEXT.
+TEXT is a string with a | indicating where point is. The | will be erased
+and point left there."
+ (declare (indent 2))
+ `(progn
+ (with-temp-buffer
+ (erase-buffer)
+ (clojure-mode)
+ (insert ,text)
+ (goto-char (point-min))
+ (re-search-forward "|")
+ (delete-char -1)
+ ,@body)))
+
+(ert-deftest test-clojure-top-level-form-p ()
+ (clojure-buffer-with-text
+ "(comment
+ (wrong)
+ (rig|ht)
+ (wrong))"
+ ;; make this use the native beginning of defun since this is used to
+ ;; determine whether to use the comment aware version or not.
+ (should (let ((beginning-of-defun-function nil))
+ (clojure-top-level-form-p "comment")))))
+
+(ert-deftest test-clojure-beginning-of-defun-function ()
+ (clojure-buffer-with-text
+ "(comment
+ (wrong)
+ (wrong)
+ (rig|ht)
+ (wrong))"
+ (beginning-of-defun)
+ (should (looking-at-p "(comment")))
+ (clojure-buffer-with-text
+ "(comment
+ (wrong)
+ (wrong)
+ (rig|ht)
+ (wrong))"
+ (let ((clojure-toplevel-inside-comment-form t))
+ (beginning-of-defun))
+ (should (looking-at-p "(right)"))))
+
(ert-deftest test-sexp-with-commas ()
(with-temp-buffer
(insert "[], {}, :a, 2")
- [nongnu] elpa/clojure-ts-mode 7793a4dad0 140/210: Merge pull request #507 from carlosgeos/fix-506, (continued)
- [nongnu] elpa/clojure-ts-mode 7793a4dad0 140/210: Merge pull request #507 from carlosgeos/fix-506, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 2a8e78618b 127/210: Fix bug in end-of-defun, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 5e5dbef03e 117/210: Bump the copyright years, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 6aa5c4f1a4 122/210: Fix font-locking of namespaced keywords, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode ec97912ae6 131/210: Indent "let", "when" and "while" as function form if not at start (#497), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 037baeb77a 130/210: Fix font-lock of type hints, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 855bc2c80d 132/210: Clean up the indentation config logic, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode d473dc10b2 124/210: [clojure-emacs/cider#2281] Cache the results of clojure-project-dir, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode e203f91ec5 149/210: Remove calls to provide and require for test-helper., ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 7ad641e20c 128/210: [Fix #483] Support alignment for reader conditionals (#486), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 07d9cf75f8 126/210: Make `beginning-of-defun` aware of clojure comment form,
ELPA Syncer <=
- [nongnu] elpa/clojure-ts-mode 9c82c7834b 146/210: [#422] Convert tests to buttercup., ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 4dcf6b7124 147/210: [Fix #511] Fix incorrect indentation of namespaced map (#533), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode c0c74f61e0 119/210: [Fix #471] Add support for tagged maps (#472), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode b2d6d39476 144/210: Add refactoring command `clojure-rename-ns-alias` (#529), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode ef300cc872 112/210: [Fix #429] Last occurrence sometimes not replaced for `move-to-let` (#430), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 58d2421d16 136/210: [Fix comment in #445] Proper font lock for (s/def ::keyword) forms, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 002a82decb 135/210: [Fix #506] Makes display version command return the actual version, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 5c594aeb18 142/210: [Fix #518] Ignore ns forms inside strings in clojure-find-ns (#519), ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 32694c2d01 121/210: Numerous font-locking fixes and improvements, ELPA Syncer, 2024/10/31
- [nongnu] elpa/clojure-ts-mode 8cb977506a 118/210: Drop support for cljx, ELPA Syncer, 2024/10/31