;; The default `indent-region-line-by-line' doesn't hold a running
;; parse state, which forces each indent call to reparse from the
;; beginning. That has O(n^2) complexity.
- (let* ((parse-state (lisp-indent-initial-state))
- (pr (unless (minibufferp)
- (make-progress-reporter "Indenting region..." (point) end))))
+ (let* ((parse-state (lisp-indent-initial-state)))
(let ((ppss (lisp-indent-state-ppss parse-state)))
(unless (or (and (bolp) (eolp)) (nth 3 ppss))
(lisp-indent-line (calculate-lisp-indent ppss))))
(while (progn (setq indent (lisp-indent-calc-next parse-state))
(< (point) end))
(unless (or (and (bolp) (eolp)) (not indent))
- (lisp-indent-line indent))
- (and pr (progress-reporter-update pr (point)))))
- (and pr (progress-reporter-done pr))
+ (lisp-indent-line indent))))
(move-marker end nil))))
(defun lisp-indent-line (&optional indent)
(save-excursion
(setq end (copy-marker end))
(goto-char start)
- (let ((pr (unless (minibufferp)
- (make-progress-reporter "Indenting region..." (point) end))))
- (while (< (point) end)
- (or (and (bolp) (eolp))
- (indent-according-to-mode t))
- (forward-line 1)
- (and pr (progress-reporter-update pr (point))))
- (and pr (progress-reporter-done pr))
- (move-marker end nil))))
+ (while (< (point) end)
+ (or (and (bolp) (eolp))
+ (indent-according-to-mode t))
+ (forward-line 1))
+ (move-marker end nil)))
(define-obsolete-function-alias 'indent-relative-maybe
'indent-relative-first-indent-point "26.1")
(lines-left-to-move 0)
(end (copy-marker end t))
(idx 0)
- (starting-pos 0)
- (announce-progress (> (- end beg) 80000)))
+ (starting-pos 0))
(save-excursion
(goto-char beg)
;; First pass. Go through each line and compute the
(goto-char anchor)
(+ offset (current-column)))))
(indent-line-to col))))
- (forward-line 1))
- (when announce-progress
- (message "Indenting region...%s%%"
- (/ (* (- (point) beg) 100) (- end beg)))))
+ (forward-line 1)))
;; Delete markers.
(dotimes (idx treesit--indent-region-batch-size)
(let ((marker (aref meta-vec (* idx meta-len))))