refactor: replace point-at-{b,e}ol

These were deprecated in 29.1. We'll switch to pol-bol and pos-eol
if/when we drop 28.x support.
This commit is contained in:
Henrik Lissner
2025-01-05 00:53:32 -05:00
parent 7de9723334
commit 3f1a471127
7 changed files with 12 additions and 11 deletions

View File

@ -2349,9 +2349,10 @@ The alist's CAR are lists of formatted switches plus their arguments, e.g.
(let ((lead (current-indentation)) (let ((lead (current-indentation))
(buffer (current-buffer))) (buffer (current-buffer)))
(while (not (eobp)) (while (not (eobp))
(let ((heading (string-trim (buffer-substring (point-at-bol) (point-at-eol)))) (let ((heading (string-trim
(beg (point-at-bol 2)) (buffer-substring (line-beginning-position)
end) (line-end-position))))
(beg (line-beginning-position 2)))
(forward-line 1) (forward-line 1)
(while (and (not (eobp)) (while (and (not (eobp))
(/= (current-indentation) lead) (/= (current-indentation) lead)

View File

@ -270,7 +270,7 @@ line to beginning of line. Same as `evil-delete-back-to-indentation'."
(funcall (if (fboundp 'evil-delete) (funcall (if (fboundp 'evil-delete)
#'evil-delete #'evil-delete
#'delete-region) #'delete-region)
(point-at-bol) (point)) (line-beginning-position) (point))
(unless empty-line-p (unless empty-line-p
(indent-according-to-mode)))) (indent-according-to-mode))))

View File

@ -49,7 +49,7 @@ fails. If before is nil, it will return the first line where predicate fails, ot
the last line where predicate holds." the last line where predicate holds."
(save-excursion (save-excursion
(goto-char start) (goto-char start)
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(let ((bnd (if (> 0 direction) (let ((bnd (if (> 0 direction)
(point-min) (point-min)
(point-max))) (point-max)))
@ -57,9 +57,9 @@ the last line where predicate holds."
(when skip (forward-line direction)) (when skip (forward-line direction))
(cl-loop while (and (/= (point) bnd) (funcall predicate base-indent)) (cl-loop while (and (/= (point) bnd) (funcall predicate base-indent))
do (progn do (progn
(when before (setq pt (point-at-bol))) (when before (setq pt (line-beginning-position)))
(forward-line direction) (forward-line direction)
(unless before (setq pt (point-at-bol))))) (unless before (setq pt (line-beginning-position)))))
pt))) pt)))
(defun +fold-hideshow-indent-range (&optional point) (defun +fold-hideshow-indent-range (&optional point)

View File

@ -225,7 +225,7 @@ is tomorrow. With two prefixes, select the deadline."
(when (re-search-forward sec nil t) (when (re-search-forward sec nil t)
(let (org-M-RET-may-split-line (let (org-M-RET-may-split-line
(lev (org-outline-level)) (lev (org-outline-level))
(folded-p (invisible-p (point-at-eol))) (folded-p (invisible-p (line-end-position)))
(from (plist-get msg :from))) (from (plist-get msg :from)))
(when (consp (car from)) ; Occurs when using mu4e 1.8+. (when (consp (car from)) ; Occurs when using mu4e 1.8+.
(setq from (car from))) (setq from (car from)))

View File

@ -113,7 +113,7 @@ the children of class at point."
(pcase-let ((`(,depth . ,node) (pop tree))) (pcase-let ((`(,depth . ,node) (pop tree)))
(cl-destructuring-bind (&key uri range) (plist-get node :location) (cl-destructuring-bind (&key uri range) (plist-get node :location)
(insert (make-string depth ?\ ) (plist-get node :name) "\n") (insert (make-string depth ?\ ) (plist-get node :name) "\n")
(make-text-button (+ (point-at-bol 0) depth) (point-at-eol 0) (make-text-button (+ (line-beginning-position 0) depth) (line-end-position 0)
'action (lambda (_arg) 'action (lambda (_arg)
(interactive) (interactive)
(find-file (eglot--uri-to-path uri)) (find-file (eglot--uri-to-path uri))

View File

@ -61,7 +61,7 @@ re-align the table if necessary. (Necessary because org-mode has a
(save-match-data (save-match-data
(when (and (org-at-table-p) (when (and (org-at-table-p)
(not (org-region-active-p)) (not (org-region-active-p))
(string-match-p "|" (buffer-substring (point-at-bol) (point))) (string-match-p "|" (buffer-substring (line-beginning-position) (point)))
(looking-at-p ".*?|")) (looking-at-p ".*?|"))
(let ((pos (point)) (let ((pos (point))
(noalign (looking-at-p "[^|\n\r]* |")) (noalign (looking-at-p "[^|\n\r]* |"))

View File

@ -151,7 +151,7 @@ Once the eshell process is killed, the previous frame layout is restored."
(cond ((modulep! :completion ivy) (cond ((modulep! :completion ivy)
(require 'em-hist) (require 'em-hist)
(let* ((ivy-completion-beg (eshell-bol)) (let* ((ivy-completion-beg (eshell-bol))
(ivy-completion-end (point-at-eol)) (ivy-completion-end (line-end-position))
(input (buffer-substring-no-properties (input (buffer-substring-no-properties
ivy-completion-beg ivy-completion-beg
ivy-completion-end))) ivy-completion-end)))