Skip to content

Fix CI for Emacs-30 #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## main (unreleased)

- Add a dedicated mode for editing Joker code. (`clojure-ts-joker-mode`)
- Add a dedicated mode for editing Joker code. (`clojure-ts-joker-mode`).
- [#113](https://github.com/clojure-emacs/clojure-ts-mode/pull/113): Fix non-working refactoring commands for Emacs-30.

## 0.5.1 (2025-06-17)

Expand Down
18 changes: 9 additions & 9 deletions clojure-ts-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,8 @@ See `clojure-ts--standard-definition-node-name' for the implementation used.")

(defun clojure-ts--outline-level ()
"Return the current level of the outline heading at point."
(let* ((node (treesit-outline--at-point))
(node-text (treesit-node-text node)))
(when-let* ((node (treesit-thing-at (point) #'clojure-ts--outline-predicate))
(node-text (treesit-node-text node)))
(string-match ";;\\(;+\\) " node-text)
(- (match-end 1) (match-beginning 1))))

Expand Down Expand Up @@ -1873,7 +1873,7 @@ between BEG and END."
;; We have to disable it here to avoid endless recursion.
(clojure-ts-align-forms-automatically nil))
(save-excursion
(indent-region beg end)
(indent-region beg (marker-position end))
(dolist (sexp sexps-to-align)
;; After reindenting a node, all other nodes in the `sexps-to-align'
;; list become outdated, so we need to fetch updated nodes for every
Expand All @@ -1893,7 +1893,7 @@ between BEG and END."
;; After every iteration we have to re-indent the s-expression,
;; otherwise some can be indented inconsistently.
(indent-region (marker-position (plist-get sexp :beg-marker))
(plist-get sexp :end-marker))))
(marker-position (plist-get sexp :end-marker)))))
;; If `clojure-ts-align-separator' is used, `align-region' leaves trailing
;; whitespaces on empty lines.
(delete-trailing-whitespace beg (marker-position end)))))
Expand Down Expand Up @@ -2114,7 +2114,7 @@ With universal argument \\[universal-argument], fully unwinds thread."
(clojure-ts--pop-out-of-threading)
(clojure-ts--fix-sexp-whitespace)
(setq n 0))))
(indent-region beg end)
(indent-region (marker-position beg) (marker-position end))
(delete-trailing-whitespace beg end)))
(user-error "No threading form to unwind at point")))

Expand Down Expand Up @@ -2191,7 +2191,7 @@ cannot be found."
(clojure-ts--thread-first))
((string-match-p (rx bol (* "some") "->>" eol) sym)
(clojure-ts--thread-last)))
(indent-region beg end)
(indent-region (marker-position beg) (marker-position end))
(delete-trailing-whitespace beg end)
t)
(when called-by-user-p
Expand Down Expand Up @@ -2383,7 +2383,7 @@ type, etc. See `treesit-thing-settings' for more details."
(string= parent-def-sym "extend-protocol"))
(clojure-ts--add-arity-reify-internal fn-node))
(t (clojure-ts--add-arity-internal fn-node)))
(indent-region beg-marker end-marker))
(indent-region (marker-position beg-marker) (marker-position end-marker)))
(user-error "No suitable form to add an arity at point")))

(defun clojure-ts-cycle-keyword-string ()
Expand Down Expand Up @@ -2496,7 +2496,7 @@ before DELIM-OPEN."
(when (member cond-sym '("if" "if-not"))
(forward-sexp 2)
(transpose-sexps 1))
(indent-region beg end-marker)))
(indent-region beg (marker-position end-marker))))
(user-error "No conditional expression found")))

(defun clojure-ts-cycle-not ()
Expand All @@ -2512,7 +2512,7 @@ before DELIM-OPEN."
(clojure-ts--raise-sexp)
(insert-pair 1 ?\( ?\))
(insert "not "))
(indent-region beg end-marker)
(indent-region beg (marker-position end-marker))
;; `save-excursion' doesn't work well when point is at the opening
;; paren.
(goto-char pos))
Expand Down