Skip to content

Commit e18a1bf

Browse files
p4v4nbbatsov
authored andcommitted
Replace beginning-of-defun fn
1 parent 81b67ec commit e18a1bf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: clojure-mode.el

+12-12
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ replacement for `cljr-expand-let`."
549549
;; If we are now precisely at the beginning of a defun, make sure
550550
;; beginning-of-defun finds that one rather than the previous one.
551551
(or (eobp) (forward-char 1))
552-
(beginning-of-defun)
552+
(beginning-of-defun-raw)
553553
;; Make sure we are really inside the defun found, not after it.
554554
(when (and (looking-at "\\s(")
555555
(progn (end-of-defun)
@@ -1188,7 +1188,7 @@ Note that this means that there is no guarantee of proper font
11881188
locking in def* forms that are not at top level."
11891189
(goto-char point)
11901190
(ignore-errors
1191-
(beginning-of-defun))
1191+
(beginning-of-defun-raw))
11921192

11931193
(let ((beg-def (point)))
11941194
(when (and (not (= point beg-def))
@@ -2217,7 +2217,7 @@ renaming a namespace."
22172217
Returns a list pair, e.g. (\"defn\" \"abc\") or (\"deftest\" \"some-test\")."
22182218
(save-excursion
22192219
(unless (looking-at clojure-def-type-and-name-regex)
2220-
(beginning-of-defun))
2220+
(beginning-of-defun-raw))
22212221
(when (search-forward-regexp clojure-def-type-and-name-regex nil t)
22222222
(list (match-string-no-properties 1)
22232223
(match-string-no-properties 2)))))
@@ -2274,7 +2274,7 @@ This will skip over sexps that don't represent objects, so that ^hints and
22742274
"Return truthy if the first form matches FIRST-FORM."
22752275
(condition-case nil
22762276
(save-excursion
2277-
(beginning-of-defun)
2277+
(beginning-of-defun-raw)
22782278
(forward-char 1)
22792279
(clojure-forward-logical-sexp 1)
22802280
(clojure-backward-logical-sexp 1)
@@ -2332,20 +2332,20 @@ many times."
23322332
(save-match-data
23332333
(let ((original-position (point))
23342334
clojure-comment-end)
2335-
(beginning-of-defun)
2335+
(beginning-of-defun-raw)
23362336
(end-of-defun)
23372337
(setq clojure-comment-end (point))
2338-
(beginning-of-defun)
2338+
(beginning-of-defun-raw)
23392339
(forward-char 1) ;; skip paren so we start at comment
23402340
(clojure-forward-logical-sexp) ;; skip past the comment form itself
23412341
(if-let ((sexp-start (clojure-find-first (lambda (beg-pos)
23422342
(< beg-pos original-position))
23432343
(clojure-sexp-starts-until-position
23442344
clojure-comment-end))))
23452345
(progn (goto-char sexp-start) t)
2346-
(beginning-of-defun n))))
2347-
(scan-error (beginning-of-defun n)))
2348-
(beginning-of-defun n))))
2346+
(beginning-of-defun-raw n))))
2347+
(scan-error (beginning-of-defun-raw n)))
2348+
(beginning-of-defun-raw n))))
23492349

23502350
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23512351
;;
@@ -2467,7 +2467,7 @@ With universal argument \\[universal-argument], fully unwind thread."
24672467
(n) (1)))
24682468
(save-excursion
24692469
(let ((limit (save-excursion
2470-
(beginning-of-defun)
2470+
(beginning-of-defun-raw)
24712471
(point))))
24722472
(ignore-errors
24732473
(when (looking-at "(")
@@ -2997,7 +2997,7 @@ END marks the end of the fn expression"
29972997
(goto-char beg))
29982998
(if (or (looking-at-p "#(")
29992999
(ignore-errors (forward-char 1))
3000-
(re-search-backward "#(" (save-excursion (beginning-of-defun) (point)) 'noerror))
3000+
(re-search-backward "#(" (save-excursion (beginning-of-defun-raw) (backward-char) (point)) 'noerror))
30013001
(let* ((end (save-excursion (clojure-forward-logical-sexp) (point-marker)))
30023002
(argspec (clojure--gather-fn-literal-args))
30033003
(arity (car argspec))
@@ -3221,7 +3221,7 @@ With universal argument \\[universal-argument], act on the \"top-level\" form."
32213221
"Toggle the #_ ignore reader form for the \"top-level\" form at point."
32223222
(interactive)
32233223
(save-excursion
3224-
(beginning-of-defun)
3224+
(beginning-of-defun-raw)
32253225
(clojure--toggle-ignore-next-sexp)))
32263226

32273227

0 commit comments

Comments
 (0)