diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2022-08-23 04:54:57 +0200 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2022-08-23 04:54:57 +0200 |
commit | b7e867b841f47dcff3aeaef9b5608a237386ce70 (patch) | |
tree | 57154cb336fcfdf9fbf80e4c6bb24b07a0432b66 /lisp/org/org-table.el | |
parent | e425b7d231d02e76ec3e3790418121fc07877e70 (diff) | |
download | emacs-b7e867b841f47dcff3aeaef9b5608a237386ce70.tar.gz |
Make point-at-eol and point-at-bol obsolete
* lisp/subr.el (point-at-eol, point-at-bol): Make XEmacs compat
aliases obsolete in favor of `pos-bol'/'line-beginning-position' or
'pos-eol'/'line-end-position'. Update callers.
Ref: https://lists.gnu.org/r/emacs-devel/2022-08/msg00853.html
Diffstat (limited to 'lisp/org/org-table.el')
-rw-r--r-- | lisp/org/org-table.el | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index c301bc6af1a..9b692d09736 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -486,7 +486,7 @@ This may be useful when columns have been shrunk." (looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>")) (move-beginning-of-line 2)) (line-beginning-position))) - (end (save-excursion (goto-char beg) (point-at-eol)))) + (end (save-excursion (goto-char beg) (line-end-position)))) (if (pos-visible-in-window-p beg) (when (overlayp org-table-header-overlay) (delete-overlay org-table-header-overlay)) @@ -825,7 +825,7 @@ SIZE is a string Columns x Rows like for example \"3x2\"." (line (concat (apply 'concat indent "|" (make-list columns " |")) "\n"))) (if (string-match "^[ \t]*$" (buffer-substring-no-properties - (point-at-bol) (point))) + (line-beginning-position) (point))) (beginning-of-line 1) (newline)) ;; (mapcar (lambda (x) (insert line)) (make-list rows t)) @@ -1087,7 +1087,7 @@ With numeric argument N, move N-1 fields backward first." (while (> n 1) (setq n (1- n)) (org-table-previous-field)) - (if (not (re-search-backward "|" (point-at-bol 0) t)) + (if (not (re-search-backward "|" (line-beginning-position 0) t)) (user-error "No more table fields before the current") (goto-char (match-end 0)) (and (looking-at " ") (forward-char 1))) @@ -1102,7 +1102,7 @@ With numeric argument N, move N-1 fields forward first." (while (> n 1) (setq n (1- n)) (org-table-next-field)) - (when (re-search-forward "|" (point-at-eol 1) t) + (when (re-search-forward "|" (line-end-position 1) t) (backward-char 1) (skip-chars-backward " ") (when (and (equal (char-before (point)) ?|) (equal (char-after (point)) ?\s)) @@ -1159,7 +1159,7 @@ When ALIGN is set, also realign the table." (goto-char (org-table-begin)) (while (and (re-search-forward org-table-dataline-regexp end t) (setq cnt (1+ cnt)) - (< (point-at-eol) pos)))) + (< (line-end-position) pos)))) cnt)) (defun org-table-current-column () @@ -1322,7 +1322,7 @@ However, when FORCE is non-nil, create new columns if necessary." (beginning-of-line 1) (when (> n 0) (while (and (> (setq n (1- n)) -1) - (or (search-forward "|" (point-at-eol) t) + (or (search-forward "|" (line-end-position) t) (and force (progn (end-of-line 1) (skip-chars-backward "^|") @@ -1663,7 +1663,7 @@ With prefix ABOVE, insert above the current line." (org-table-align)) (org-table-with-shrunk-columns (let ((line (org-table-clean-line - (buffer-substring (point-at-bol) (point-at-eol)))) + (buffer-substring (line-beginning-position) (line-end-position)))) (col (current-column))) (while (string-match "|\\( +\\)|" line) (setq line (replace-match @@ -1712,7 +1712,8 @@ In particular, this does handle wide and invisible characters." (dline (and (not (org-match-line org-table-hline-regexp)) (org-table-current-dline)))) (org-table-with-shrunk-columns - (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) + (kill-region (line-beginning-position) + (min (1+ (line-end-position)) (point-max))) (if (not (org-at-table-p)) (beginning-of-line 0)) (org-move-to-column col) (when (and dline @@ -2253,14 +2254,14 @@ For all numbers larger than LIMIT, shift them by DELTA." (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove)))) s n a) (when remove - (while (re-search-forward re2 (point-at-eol) t) + (while (re-search-forward re2 (line-end-position) t) (unless (save-match-data (org-in-regexp "remote([^)]+?)")) (if (equal (char-before (match-beginning 0)) ?.) (user-error "Change makes TBLFM term %s invalid, use undo to recover" (match-string 0)) (replace-match ""))))) - (while (re-search-forward re (point-at-eol) t) + (while (re-search-forward re (line-end-position) t) (unless (save-match-data (org-in-regexp "remote([^)]+?)")) (setq s (match-string 1) n (string-to-number s)) (cond @@ -3789,8 +3790,9 @@ FACE, when non-nil, for the highlight." (let ((id 0) (ih 0) hline eol str ov) (goto-char (org-table-begin)) (while (org-at-table-p) - (setq eol (point-at-eol)) - (setq ov (make-overlay (point-at-bol) (1+ (point-at-bol)))) + (setq eol (line-end-position)) + (setq ov (make-overlay (line-beginning-position) + (1+ (line-beginning-position)))) (push ov org-table-coordinate-overlays) (setq hline (looking-at org-table-hline-regexp)) (setq str (if hline (format "I*%-2d" (setq ih (1+ ih))) @@ -4923,7 +4925,7 @@ When LOCAL is non-nil, show references for the table at point." ((not local) nil) (t (user-error "No reference at point"))) match (and what (or match (match-string 0)))) - (when (and match (not (equal (match-beginning 0) (point-at-bol)))) + (when (and match (not (equal (match-beginning 0) (line-beginning-position)))) (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0) 'secondary-selection)) (add-hook 'before-change-functions |