Skip to content

Commit 5718f13

Browse files
p4v4nbbatsov
authored andcommitted
Replace beginning-of-defun fn
1 parent 60a14b0 commit 5718f13

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
### Changes
4141

42+
- Improve support for multiple forms in the same line by replacing `beginning-of-defun` fn.
4243
- [#3390](https://github.com/clojure-emacs/cider/issues/3390): Enhance `cider-connect` to show all nREPLs available ports, instead of only Leiningen ones.
4344
- [#3408](https://github.com/clojure-emacs/cider/issues/3408): `cider-connect`: check `.nrepl-port`-like files for liveness, hiding them if they don't reflect an active port.
4445
- Introduce `cider-stacktrace-navigate-to-other-window` defcustom.

cider-completion.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ form, with symbol at point replaced by __prefix__."
140140
(let* ((pref-end (point))
141141
(pref-start (cider-completion-symbol-start-pos))
142142
(context (cider-defun-at-point))
143-
(_ (beginning-of-defun))
143+
(_ (beginning-of-defun-raw))
144144
(expr-start (point)))
145145
(concat (when pref-start (substring context 0 (- pref-start expr-start)))
146146
"__prefix__"

cider-debug.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ The boolean value of FORCE will be sent in the reply."
762762
(progn ;; Get to the proper line & column in the file
763763
(forward-line (1- (- line (line-number-at-pos))))
764764
(move-to-column column))
765-
(beginning-of-defun))
765+
(beginning-of-defun-raw))
766766
;; Is HERE inside the sexp being debugged?
767767
(when (or (< here (point))
768768
(save-excursion

cider-eval.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ buffer. It constructs an expression to eval in the following manner:
13621362
- It balances this bit of code by closing all open expressions;
13631363
- It evaluates the resulting code using `cider-interactive-eval'."
13641364
(interactive "P")
1365-
(let* ((beg-of-defun (save-excursion (beginning-of-defun) (point)))
1365+
(let* ((beg-of-defun (save-excursion (beginning-of-defun-raw) (point)))
13661366
(code (buffer-substring-no-properties beg-of-defun (point)))
13671367
(code (cider--insert-closing-delimiters code)))
13681368
(cider-interactive-eval code

cider-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ before point."
952952
;; If the inside of a `ns' form changed, reparse it from the start.
953953
(when (and (not (bobp))
954954
(get-text-property (1- (point)) 'cider-block-dynamic-font-lock))
955-
(ignore-errors (beginning-of-defun)))
955+
(ignore-errors (beginning-of-defun-raw)))
956956
(save-excursion
957957
;; Move up until we reach a sexp that encloses the entire region (or
958958
;; a top-level sexp), and set that as the new BEG.

cider-repl.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ If given a negative value of ARG, move to the beginning of defun."
540540
(if (and (not (cider-repl--at-prompt-start-p))
541541
(cider-repl--in-input-area-p))
542542
(goto-char cider-repl-input-start-mark)
543-
(beginning-of-defun)))
543+
(beginning-of-defun-raw)))
544544

545545
(defun cider-repl-end-of-defun ()
546546
"Move to end of defun."

cider-util.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ Setting this to nil removes the fontification restriction."
7171

7272
(defun cider-in-string-p ()
7373
"Return non-nil if point is in a string."
74-
(let ((beg (save-excursion (beginning-of-defun) (point))))
74+
(let ((beg (save-excursion (beginning-of-defun-raw) (point))))
7575
(nth 3 (parse-partial-sexp beg (point)))))
7676

7777
(defun cider-in-comment-p ()
7878
"Return non-nil if point is in a comment."
79-
(let ((beg (save-excursion (beginning-of-defun) (point))))
79+
(let ((beg (save-excursion (beginning-of-defun-raw) (point))))
8080
(nth 4 (parse-partial-sexp beg (point)))))
8181

8282
(defun cider--tooling-file-p (file-name)

0 commit comments

Comments
 (0)