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/progmodes/js.el | |
parent | e425b7d231d02e76ec3e3790418121fc07877e70 (diff) | |
download | emacs-b7e867b841f47dcff3aeaef9b5608a237386ce70.tar.gz emacs-b7e867b841f47dcff3aeaef9b5608a237386ce70.tar.bz2 emacs-b7e867b841f47dcff3aeaef9b5608a237386ce70.zip |
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/progmodes/js.el')
-rw-r--r-- | lisp/progmodes/js.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index efad3b52aa9..b920ef6c2cc 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -812,7 +812,7 @@ point at BOB." (setq str-terminator ?/)) (re-search-forward (concat "\\([^\\]\\|^\\)" (string str-terminator)) - (point-at-eol) t)) + (line-end-position) t)) ((nth 7 parse) (forward-line)) ((or (nth 4 parse) @@ -1683,7 +1683,7 @@ point of view of font-lock. It applies highlighting directly with (insert "=") (goto-char (match-beginning 2))) (setq js--tmp-location nil) - (goto-char (point-at-eol))) + (goto-char (line-end-position))) (when js--tmp-location (save-excursion (goto-char js--tmp-location) @@ -2506,14 +2506,14 @@ the same column as the current line." (looking-at "[ \t\n]*}")) (save-excursion (backward-list) (forward-symbol -1) (looking-at "\\_<do\\_>")) - (js--re-search-backward "\\_<do\\_>" (point-at-bol) t) + (js--re-search-backward "\\_<do\\_>" (line-beginning-position) t) (or (looking-at "\\_<do\\_>") (let ((saved-indent (current-indentation))) (while (and (js--re-search-backward "^\\s-*\\_<" nil t) (/= (current-indentation) saved-indent))) (and (looking-at "\\s-*\\_<do\\_>") (not (js--re-search-forward - "\\_<while\\_>" (point-at-eol) t)) + "\\_<while\\_>" (line-end-position) t)) (= (current-indentation) saved-indent))))))))) @@ -2525,7 +2525,7 @@ nil." (save-excursion (back-to-indentation) (when (save-excursion - (and (not (eq (point-at-bol) (point-min))) + (and (not (eq (line-beginning-position) (point-min))) (not (looking-at "[{]")) (js--re-search-backward "[[:graph:]]" nil t) (progn @@ -2546,8 +2546,8 @@ nil." (c-get-syntactic-indentation (list (cons symbol anchor))))) (defun js--same-line (pos) - (and (>= pos (point-at-bol)) - (<= pos (point-at-eol)))) + (and (>= pos (line-beginning-position)) + (<= pos (line-end-position)))) (defun js--multi-line-declaration-indentation () "Helper function for `js--proper-indentation'. @@ -2921,7 +2921,7 @@ return nil." "Indent the current line as JavaScript." (interactive) (let* ((parse-status - (save-excursion (syntax-ppss (point-at-bol)))) + (save-excursion (syntax-ppss (line-beginning-position)))) (offset (- (point) (save-excursion (back-to-indentation) (point))))) (unless (nth 3 parse-status) (indent-line-to (js--proper-indentation parse-status)) |