Skip to content

Commit

Permalink
Replace beginning-of-defun fn
Browse files Browse the repository at this point in the history
  • Loading branch information
p4v4n authored and bbatsov committed Sep 9, 2023
1 parent 60a14b0 commit 5718f13
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

### Changes

- Improve support for multiple forms in the same line by replacing `beginning-of-defun` fn.
- [#3390](https://github.com/clojure-emacs/cider/issues/3390): Enhance `cider-connect` to show all nREPLs available ports, instead of only Leiningen ones.
- [#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.
- Introduce `cider-stacktrace-navigate-to-other-window` defcustom.
Expand Down
2 changes: 1 addition & 1 deletion cider-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ form, with symbol at point replaced by __prefix__."
(let* ((pref-end (point))
(pref-start (cider-completion-symbol-start-pos))
(context (cider-defun-at-point))
(_ (beginning-of-defun))
(_ (beginning-of-defun-raw))
(expr-start (point)))
(concat (when pref-start (substring context 0 (- pref-start expr-start)))
"__prefix__"
Expand Down
2 changes: 1 addition & 1 deletion cider-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ The boolean value of FORCE will be sent in the reply."
(progn ;; Get to the proper line & column in the file
(forward-line (1- (- line (line-number-at-pos))))
(move-to-column column))
(beginning-of-defun))
(beginning-of-defun-raw))
;; Is HERE inside the sexp being debugged?
(when (or (< here (point))
(save-excursion
Expand Down
2 changes: 1 addition & 1 deletion cider-eval.el
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ buffer. It constructs an expression to eval in the following manner:
- It balances this bit of code by closing all open expressions;
- It evaluates the resulting code using `cider-interactive-eval'."
(interactive "P")
(let* ((beg-of-defun (save-excursion (beginning-of-defun) (point)))
(let* ((beg-of-defun (save-excursion (beginning-of-defun-raw) (point)))
(code (buffer-substring-no-properties beg-of-defun (point)))
(code (cider--insert-closing-delimiters code)))
(cider-interactive-eval code
Expand Down
2 changes: 1 addition & 1 deletion cider-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ before point."
;; If the inside of a `ns' form changed, reparse it from the start.
(when (and (not (bobp))
(get-text-property (1- (point)) 'cider-block-dynamic-font-lock))
(ignore-errors (beginning-of-defun)))
(ignore-errors (beginning-of-defun-raw)))
(save-excursion
;; Move up until we reach a sexp that encloses the entire region (or
;; a top-level sexp), and set that as the new BEG.
Expand Down
2 changes: 1 addition & 1 deletion cider-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ If given a negative value of ARG, move to the beginning of defun."
(if (and (not (cider-repl--at-prompt-start-p))
(cider-repl--in-input-area-p))
(goto-char cider-repl-input-start-mark)
(beginning-of-defun)))
(beginning-of-defun-raw)))

(defun cider-repl-end-of-defun ()
"Move to end of defun."
Expand Down
4 changes: 2 additions & 2 deletions cider-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ Setting this to nil removes the fontification restriction."

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

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

(defun cider--tooling-file-p (file-name)
Expand Down

0 comments on commit 5718f13

Please sign in to comment.