emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b7e867b841: Make point-at-eol and point-at-bol obsolete


From: Stefan Kangas
Subject: master b7e867b841: Make point-at-eol and point-at-bol obsolete
Date: Mon, 22 Aug 2022 23:04:34 -0400 (EDT)

branch: master
commit b7e867b841f47dcff3aeaef9b5608a237386ce70
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    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
---
 admin/gitmerge.el                        |   6 +-
 lisp/allout.el                           |   6 +-
 lisp/calc/calc-keypd.el                  |   2 +-
 lisp/calc/calc-yank.el                   |   6 +-
 lisp/cedet/cedet-global.el               |   2 +-
 lisp/cedet/data-debug.el                 |   6 +-
 lisp/cedet/ede/autoconf-edit.el          |   8 +--
 lisp/cedet/ede/pmake.el                  |   2 +-
 lisp/cedet/ede/proj-elisp.el             |   3 +-
 lisp/cedet/ede/project-am.el             |   2 +-
 lisp/cedet/ede/speedbar.el               |   2 +-
 lisp/cedet/pulse.el                      |   2 +-
 lisp/cedet/semantic/bovine/c.el          |  10 +--
 lisp/cedet/semantic/grammar.el           |   2 +-
 lisp/cedet/semantic/idle.el              |   8 +--
 lisp/cedet/semantic/lex-spp.el           |   2 +-
 lisp/cedet/semantic/lex.el               |   2 +-
 lisp/cedet/semantic/symref.el            |   2 +-
 lisp/cedet/semantic/symref/list.el       |   8 +--
 lisp/cedet/semantic/util-modes.el        |   6 +-
 lisp/cedet/semantic/wisent/javascript.el |   2 +-
 lisp/cedet/srecode/document.el           |   6 +-
 lisp/cedet/srecode/insert.el             |   2 +-
 lisp/dired.el                            |   6 +-
 lisp/ecomplete.el                        |   2 +-
 lisp/emacs-lisp/backtrace.el             |   2 +-
 lisp/emacs-lisp/bytecomp.el              |   3 +-
 lisp/emacs-lisp/chart.el                 |   4 +-
 lisp/emulation/edt.el                    |   2 +-
 lisp/emulation/viper-cmd.el              |   8 +--
 lisp/epa.el                              |   2 +-
 lisp/epg-config.el                       |   4 +-
 lisp/erc/erc-speedbar.el                 |   2 +-
 lisp/erc/erc-stamp.el                    |   2 +-
 lisp/ffap.el                             |   4 +-
 lisp/font-lock.el                        |   2 +-
 lisp/gnus/gnus-agent.el                  |   6 +-
 lisp/gnus/gnus-art.el                    |  33 +++++-----
 lisp/gnus/gnus-bookmark.el               |   4 +-
 lisp/gnus/gnus-cache.el                  |   2 +-
 lisp/gnus/gnus-cite.el                   |   8 +--
 lisp/gnus/gnus-diary.el                  |   2 +-
 lisp/gnus/gnus-draft.el                  |   2 +-
 lisp/gnus/gnus-group.el                  |  22 +++----
 lisp/gnus/gnus-picon.el                  |   6 +-
 lisp/gnus/gnus-salt.el                   |   4 +-
 lisp/gnus/gnus-score.el                  |  14 ++---
 lisp/gnus/gnus-search.el                 |   2 +-
 lisp/gnus/gnus-srvr.el                   |   6 +-
 lisp/gnus/gnus-start.el                  |  16 ++---
 lisp/gnus/gnus-sum.el                    |  30 ++++-----
 lisp/gnus/gnus-topic.el                  |  10 +--
 lisp/gnus/gnus-util.el                   |   4 +-
 lisp/gnus/gnus-uu.el                     |   8 +--
 lisp/gnus/message.el                     |  16 ++---
 lisp/gnus/nnbabyl.el                     |   7 ++-
 lisp/gnus/nndiary.el                     |   2 +-
 lisp/gnus/nnfolder.el                    |   6 +-
 lisp/gnus/nnheader.el                    |   6 +-
 lisp/gnus/nnmail.el                      |   6 +-
 lisp/gnus/nnmairix.el                    |   2 +-
 lisp/gnus/nnml.el                        |   8 +--
 lisp/gnus/nntp.el                        |   7 ++-
 lisp/gnus/nnvirtual.el                   |   6 +-
 lisp/gnus/smime.el                       |   2 +-
 lisp/gnus/spam-report.el                 |   2 +-
 lisp/gnus/spam.el                        |   4 +-
 lisp/mail/mail-utils.el                  |   5 +-
 lisp/mail/mailabbrev.el                  |   2 +-
 lisp/mail/mspools.el                     |   4 +-
 lisp/mail/rfc2047.el                     |  16 ++---
 lisp/mail/sendmail.el                    |   2 +-
 lisp/mail/smtpmail.el                    |   5 +-
 lisp/mh-e/mh-seq.el                      |   2 +-
 lisp/net/eudc.el                         |   2 +-
 lisp/net/imap.el                         |   2 +-
 lisp/net/ldap.el                         |   2 +-
 lisp/net/newst-treeview.el               |   7 ++-
 lisp/net/pop3.el                         |   2 +-
 lisp/net/rcirc.el                        |   2 +-
 lisp/net/tramp-adb.el                    |   4 +-
 lisp/net/tramp-cmds.el                   |   2 +-
 lisp/net/tramp-crypt.el                  |   2 +-
 lisp/net/tramp-sh.el                     |  27 +++++----
 lisp/net/tramp-smb.el                    |   4 +-
 lisp/net/tramp-sshfs.el                  |   2 +-
 lisp/net/tramp-sudoedit.el               |   6 +-
 lisp/net/tramp.el                        |  18 +++---
 lisp/obsolete/netrc.el                   |   4 +-
 lisp/obsolete/tpu-extras.el              |   2 +-
 lisp/org/ob-core.el                      |   8 +--
 lisp/org/ob-lilypond.el                  |   2 +-
 lisp/org/ob-octave.el                    |   2 +-
 lisp/org/ol-irc.el                       |  12 ++--
 lisp/org/ol.el                           |   2 +-
 lisp/org/org-agenda.el                   | 101 +++++++++++++++++--------------
 lisp/org/org-capture.el                  |   2 +-
 lisp/org/org-clock.el                    |  14 ++---
 lisp/org/org-compat.el                   |   6 +-
 lisp/org/org-element.el                  |   8 +--
 lisp/org/org-habit.el                    |   2 +-
 lisp/org/org-inlinetask.el               |   6 +-
 lisp/org/org-list.el                     |  72 +++++++++++-----------
 lisp/org/org-macs.el                     |   4 +-
 lisp/org/org-mobile.el                   |  12 ++--
 lisp/org/org-mouse.el                    |   8 +--
 lisp/org/org-refile.el                   |   4 +-
 lisp/org/org-table.el                    |  28 +++++----
 lisp/org/org.el                          |  83 +++++++++++++------------
 lisp/play/decipher.el                    |   2 +-
 lisp/progmodes/cfengine.el               |   4 +-
 lisp/progmodes/cperl-mode.el             |  33 +++++-----
 lisp/progmodes/elisp-mode.el             |   2 +-
 lisp/progmodes/etags.el                  |   6 +-
 lisp/progmodes/glasses.el                |   6 +-
 lisp/progmodes/idlw-shell.el             |  14 ++---
 lisp/progmodes/idlwave.el                |  25 ++++----
 lisp/progmodes/js.el                     |  16 ++---
 lisp/progmodes/meta-mode.el              |   8 +--
 lisp/progmodes/pascal.el                 |  29 ++++-----
 lisp/progmodes/prolog.el                 |   4 +-
 lisp/progmodes/ruby-mode.el              |   4 +-
 lisp/progmodes/verilog-mode.el           |  16 ++---
 lisp/progmodes/vhdl-mode.el              |  18 +++---
 lisp/rect.el                             |  10 +--
 lisp/subr.el                             |   9 ++-
 lisp/term.el                             |   6 +-
 lisp/textmodes/css-mode.el               |   2 +-
 lisp/textmodes/flyspell.el               |   2 +-
 lisp/textmodes/ispell.el                 |  13 ++--
 lisp/textmodes/texinfo.el                |   6 +-
 lisp/vc/diff-mode.el                     |   2 +-
 lisp/vc/vc-hg.el                         |   2 +-
 lisp/xdg.el                              |   4 +-
 134 files changed, 586 insertions(+), 550 deletions(-)

diff --git a/admin/gitmerge.el b/admin/gitmerge.el
index a214dcbcb7..25bed949ad 100644
--- a/admin/gitmerge.el
+++ b/admin/gitmerge.el
@@ -135,7 +135,7 @@ If nil, the function `gitmerge-default-branch' guesses.")
 (defun gitmerge-get-sha1 ()
   "Get SHA1 from commit at point."
   (save-excursion
-    (goto-char (point-at-bol))
+    (goto-char (line-beginning-position))
     (when (looking-at "^[A-Z ]\\s-*\\([a-f0-9]+\\)")
       (match-string 1))))
 
@@ -187,7 +187,7 @@ If nil, the function `gitmerge-default-branch' guesses.")
        skip)
     (when commit
       (save-excursion
-       (goto-char (point-at-bol))
+        (goto-char (line-beginning-position))
        (when (looking-at "^\\([A-Z ]\\)\\s-*\\([a-f0-9]+\\)")
          (setq skip (string= (match-string 1) " "))
          (goto-char (match-beginning 2))
@@ -195,7 +195,7 @@ If nil, the function `gitmerge-default-branch' guesses.")
          (dolist (ct gitmerge--commits)
            (when (string-match commit (car ct))
              (setcdr ct (when skip "M"))))
-         (goto-char (point-at-bol))
+          (goto-char (line-beginning-position))
          (setq buffer-read-only nil)
          (delete-char 1)
          (insert (if skip "M" " "))
diff --git a/lisp/allout.el b/lisp/allout.el
index 8e303a8a02..fb922608b0 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -4598,7 +4598,7 @@ by pops to non-distinctive yanks.  Bug..."
         (save-match-data
           (save-excursion
             (let* ((text-start allout-recent-prefix-end)
-                   (heading-end (point-at-eol)))
+                   (heading-end (line-end-position)))
               (goto-char text-start)
               (setq file-name
                     (if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
@@ -4874,7 +4874,7 @@ siblings, even if the target topic is already closed."
   (interactive)
   (save-excursion
     (allout-back-to-heading)
-    (if (allout-hidden-p (point-at-eol))
+    (if (allout-hidden-p (line-end-position))
         (allout-show-current-subtree)
       (allout-hide-current-subtree))))
 ;;;_   > allout-show-current-branches ()
@@ -5537,7 +5537,7 @@ environment.  Leaves point at the end of the line."
   (let ((inhibit-field-text-motion t))
     (beginning-of-line)
     (let (;(beg (point))
-          (end (point-at-eol)))
+          (end (line-end-position)))
       (save-match-data
         (while (re-search-forward "\\\\"
   ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el
index 6144ee1c08..3db3746a8e 100644
--- a/lisp/calc/calc-keypd.el
+++ b/lisp/calc/calc-keypd.el
@@ -387,7 +387,7 @@
   (interactive)
   (unless (eq major-mode 'calc-keypad-mode)
     (error "Must be in *Calc Keypad* buffer for this command"))
-  (let* ((row (count-lines (point-min) (point-at-bol)))
+  (let* ((row (count-lines (point-min) (line-beginning-position)))
         (y (/ row 2))
         (x (/ (current-column) (if (>= y 4) 6 5)))
         radix frac inv
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index d4594370ca..504ba5b40d 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -48,7 +48,7 @@
         (let ((stuff (calc-top-list n (- num n -1))))
           (calc-cursor-stack-index num)
            (unless calc-kill-line-numbering
-             (re-search-forward "\\=[0-9]+:\\s-+" (point-at-eol) t))
+             (re-search-forward "\\=[0-9]+:\\s-+" (line-end-position) t))
           (let ((first (point)))
             (calc-cursor-stack-index (- num n))
             (if (null nn)
@@ -410,8 +410,8 @@ Interactively, reads the register using 
`register-read-with-preview'."
            (setq single t)
          (setq arg (prefix-numeric-value arg))
          (if (= arg 0)
-             (setq top (point-at-bol)
-                   bot (point-at-eol))
+              (setq top (line-beginning-position)
+                    bot (line-end-position))
            (save-excursion
              (setq top (point))
              (forward-line arg)
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el
index 6a147bf430..a2d8bae36b 100644
--- a/lisp/cedet/cedet-global.el
+++ b/lisp/cedet/cedet-global.el
@@ -133,7 +133,7 @@ DIR defaults to `default-directory'."
       (goto-char (point-min))
       (when (not (eobp))
        (file-name-as-directory
-        (buffer-substring (point) (point-at-eol)))))))
+         (buffer-substring (point) (line-end-position)))))))
 
 (defun cedet-gnu-global-version-check (&optional noerror)
   "Check the version of the installed GNU Global command.
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el
index e7635c0aec..605dc9fa19 100644
--- a/lisp/cedet/data-debug.el
+++ b/lisp/cedet/data-debug.el
@@ -902,14 +902,14 @@ If PARENT is non-nil, it is somehow related as a parent 
to thing."
   (interactive)
   (forward-line 1)
   (beginning-of-line)
-  (skip-chars-forward "- *><[]" (point-at-eol)))
+  (skip-chars-forward "- *><[]" (line-end-position)))
 
 (defun data-debug-prev ()
   "Go to the previous line in the Ddebug buffer."
   (interactive)
   (forward-line -1)
   (beginning-of-line)
-  (skip-chars-forward "- *><[]" (point-at-eol)))
+  (skip-chars-forward "- *><[]" (line-end-position)))
 
 (defun data-debug-next-expando ()
   "Go to the next line in the Ddebug buffer.
@@ -996,7 +996,7 @@ Do nothing if already contracted."
           (data-debug-current-line-expanded-p))
       (data-debug-contract-current-line)
     (data-debug-expand-current-line))
-  (skip-chars-forward "- *><[]" (point-at-eol)))
+  (skip-chars-forward "- *><[]" (line-end-position)))
 
 (defun data-debug-expand-or-contract-mouse (event)
   "Expand or contract anything at event EVENT."
diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el
index faf50edaa1..78edea1da8 100644
--- a/lisp/cedet/ede/autoconf-edit.el
+++ b/lisp/cedet/ede/autoconf-edit.el
@@ -383,16 +383,16 @@ Optional argument BODY is the code to execute which edits 
the autoconf file."
     (beginning-of-line)
     (let* ((end-of-cmd
            (save-excursion
-             (if (re-search-forward "(" (point-at-eol) t)
+              (if (re-search-forward "(" (line-end-position) t)
                  (progn
                    (forward-char -1)
                    (forward-sexp 1)
                    (point))
                ;; Else, just return EOL.
-               (point-at-eol))))
+                (line-end-position))))
           (cnt 0))
       (save-restriction
-       (narrow-to-region (point-at-bol) end-of-cmd)
+        (narrow-to-region (line-beginning-position) end-of-cmd)
        (condition-case nil
            (progn
              (down-list 1)
@@ -417,7 +417,7 @@ INDEX starts at 1."
   (down-list 1)
   (re-search-forward ", ?" nil nil (1- index))
   (let ((end (save-excursion
-              (re-search-forward ",\\|)" (point-at-eol))
+               (re-search-forward ",\\|)" (line-end-position))
               (forward-char -1)
               (point))))
     (setq autoconf-deleted-text (buffer-substring (point) end))
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index 9a913109f0..7739115b31 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -566,7 +566,7 @@ Argument THIS is the target that should insert stuff."
            (cond ((eq (cdr sv) 'share)
                   ;; This variable may be shared between multiple targets.
                   (if (re-search-backward (concat "\\$(" (car sv) ")")
-                                          (point-at-bol) t)
+                                           (line-beginning-position) t)
                       ;; If its already in the dist target, then skip it.
                       nil
                     (setq sv (car sv))))
diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el
index 7c56ca1993..594d8f1c29 100644
--- a/lisp/cedet/ede/proj-elisp.el
+++ b/lisp/cedet/ede/proj-elisp.el
@@ -272,7 +272,8 @@ is found, such as a `-version' variable, or the standard 
header."
            (let ((path (match-string 1)))
              (if (string= path "nil")
                  nil
-               (delete-region (point-at-bol) (point-at-bol 2)))))))))
+                (delete-region (line-beginning-position)
+                               (line-beginning-position 2)))))))))
 
 ;;;
 ;; Autoload generators
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index 544e39b872..de6936ad1a 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -911,7 +911,7 @@ Kill the Configure buffer if it was not already in a 
buffer."
     (goto-char (point-min))
     (when (re-search-forward (concat "^" (regexp-quote var) "\\s-*=\\s-*")
                             nil t)
-      (buffer-substring-no-properties (point) (point-at-eol)))))
+      (buffer-substring-no-properties (point) (line-end-position)))))
 
 (defun project-am-extract-package-info (dir)
   "Extract the package information for directory DIR."
diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el
index 604b660344..f45c070539 100644
--- a/lisp/cedet/ede/speedbar.el
+++ b/lisp/cedet/ede/speedbar.el
@@ -175,7 +175,7 @@ Argument DIR is the directory from which to derive the list 
of objects."
     (beginning-of-line)
     (looking-at "^\\([0-9]+\\):")
     (let ((depth (string-to-number (match-string 1))))
-      (while (not (re-search-forward "[]] [^ ]" (point-at-eol) t))
+      (while (not (re-search-forward "[]] [^ ]" (line-end-position) t))
        (re-search-backward (format "^%d:" (1- depth)))
        (setq depth (1- depth)))
       (speedbar-line-token))))
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index f7af10887c..9941f2a0cb 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -202,7 +202,7 @@ If POINT is nil or missing, the current point is used 
instead.
 Optional argument FACE specifies the face to do the highlighting."
   (save-excursion
     (goto-char (or point (point)))
-    (let ((start (point-at-bol))
+    (let ((start (line-beginning-position))
           (end (save-excursion
                  (end-of-line)
                  (when (not (eobp))
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index ee1cbcad4d..d4ce20589e 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -437,8 +437,8 @@ I think it just returns t/nil dependent on if VAR has been 
defined."
         (progn
           (semantic-push-parser-warning
           (format "Skip %s" (buffer-substring-no-properties
-                             (point-at-bol) (point-at-eol)))
-          (point-at-bol) (point-at-eol))
+                              (line-beginning-position) (line-end-position)))
+           (line-beginning-position) (line-end-position))
           nil)
       t)))
 
@@ -501,8 +501,10 @@ code to parse."
 
        ;; The if indicates to skip this preprocessor section
        (let () ;; (pt nil)
-         (semantic-push-parser-warning (format "Skip %s" 
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))
-                                       (point-at-bol) (point-at-eol))
+          (semantic-push-parser-warning (format "Skip %s" 
(buffer-substring-no-properties
+                                                           
(line-beginning-position)
+                                                           
(line-end-position)))
+                                        (line-beginning-position) 
(line-end-position))
          (beginning-of-line)
          ;; (setq pt (point))
          ;; This skips only a section of a conditional.  Once that section
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 97456265ea..d42022e042 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -252,7 +252,7 @@ That is tag names plus names defined in tag attribute 
`:rest'."
               (skip-chars-backward "\r\n\t")
               ;; If a grammar footer is found, skip it.
               (re-search-backward "^;;;\\s-+\\S-+\\s-+ends here"
-                                  (point-at-bol) t)
+                                  (line-beginning-position) t)
               (skip-chars-backward "\r\n\t")
               (point)))
            "\n"))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 1afb1d841d..2d6f26919d 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -818,13 +818,13 @@ visible, then highlight it."
               (goto-char (overlay-start region))
               (when (pos-visible-in-window-p
                      (point) (get-buffer-window (current-buffer) 'visible))
-                (if (< (overlay-end region) (point-at-eol))
+                 (if (< (overlay-end region) (line-end-position))
                     (pulse-momentary-highlight-overlay
                      region semantic-idle-symbol-highlight-face)
                   ;; Not the same
                   (pulse-momentary-highlight-region
                    (overlay-start region)
-                   (point-at-eol)
+                    (line-end-position)
                    semantic-idle-symbol-highlight-face))))
             ))
          ((vectorp region)
@@ -843,8 +843,8 @@ visible, then highlight it."
                        end t)
                   ;; This is likely it, give it a try.
                   (pulse-momentary-highlight-region
-                   start (if (<= end (point-at-eol)) end
-                           (point-at-eol))
+                    start (if (<= end (line-end-position)) end
+                            (line-end-position))
                    semantic-idle-symbol-highlight-face)))
               ))))
     nil))
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index 4bdaaf77ac..b66e5c19cb 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -826,7 +826,7 @@ Argument BEG and END specify the bounds of SYM in the 
buffer."
          (goto-char end)
          (setq arg-parsed
                (semantic-lex-spp-one-token-and-move-for-macro
-                ;; NOTE: This used to be (point-at-eol), but
+                 ;; NOTE: This used to be (line-end-position), but
                 ;;       that was too close for multi-line arguments
                 ;;       to a macro.  Point max may be too far if there
                 ;;       is a typo in the buffer.
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el
index 9c64cc9f7e..75c4ee328d 100644
--- a/lisp/cedet/semantic/lex.el
+++ b/lisp/cedet/semantic/lex.el
@@ -1423,7 +1423,7 @@ Return either a paren token or a semantic list token 
depending on
        ;; to work properly.  Lets try and move over
        ;; whatever white space we matched to begin
        ;; with.
-       (skip-syntax-forward "-.'" (point-at-eol))
+        (skip-syntax-forward "-.'" (line-end-position))
       ;; We may need to back up so newlines or whitespace is generated.
       (if (bolp)
          (backward-char 1)))
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el
index e48cefa4ca..16bbacc428 100644
--- a/lisp/cedet/semantic/symref.el
+++ b/lisp/cedet/semantic/symref.el
@@ -555,7 +555,7 @@ deleting the buffers that were opened."
     (when (re-search-forward (if (memq searchtype '(regexp tagregexp))
                                  searchtxt
                                (regexp-quote searchtxt))
-                            (point-at-eol)
+                             (line-end-position)
                             t)
       (goto-char (match-beginning 0))
       )
diff --git a/lisp/cedet/semantic/symref/list.el 
b/lisp/cedet/semantic/symref/list.el
index 7823dad6ef..eacbb6f1f8 100644
--- a/lisp/cedet/semantic/symref/list.el
+++ b/lisp/cedet/semantic/symref/list.el
@@ -234,7 +234,7 @@ Some useful functions are found in 
`semantic-format-tag-functions'."
   "Toggle showing the contents below the current line."
   (interactive)
   (beginning-of-line)
-  (when (re-search-forward "\\[[-+]\\]" (point-at-eol) t)
+  (when (re-search-forward "\\[[-+]\\]" (line-end-position) t)
     (forward-char -1)
     (push-button)))
 
@@ -255,7 +255,7 @@ BUTTON is the button that was clicked."
          (forward-line (1- H))
          (beginning-of-line)
          (back-to-indentation)
-         (setq text (cons (buffer-substring (point) (point-at-eol)) text)))
+          (setq text (cons (buffer-substring (point) (line-end-position)) 
text)))
        (setq text (nreverse text)))
       (goto-char (button-start button))
       (forward-char 1)
@@ -409,7 +409,7 @@ cursor to the beginning of that symbol, then record a macro 
as if
     (switch-to-buffer-other-window (semantic-tag-buffer tag))
     (goto-char (point-min))
     (forward-line (1- line))
-    (when (not (re-search-forward (regexp-quote oldsym) (point-at-eol) t))
+    (when (not (re-search-forward (regexp-quote oldsym) (line-end-position) t))
       (error "Cannot find hit.  Cannot record macro"))
     (goto-char (match-beginning 0))
     ;; Cursor is now in the right location.  Start recording a macro.
@@ -479,7 +479,7 @@ Return the number of occurrences FUNCTION was operated 
upon."
              (goto-char (point-min))
              (forward-line (1- line))
              (beginning-of-line)
-             (while (re-search-forward (regexp-quote oldsym) (point-at-eol) t)
+              (while (re-search-forward (regexp-quote oldsym) 
(line-end-position) t)
                (setq count (1+ count))
                (save-excursion ;; Leave cursor after the matched name.
                  (goto-char (match-beginning 0)) ;; Go to beginning of that sym
diff --git a/lisp/cedet/semantic/util-modes.el 
b/lisp/cedet/semantic/util-modes.el
index fdd93c6bcf..33fed9191e 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -750,7 +750,7 @@ If there is no function, disable the header line."
                    (if noshow
                        ""
                      (if semantic-stickyfunc-show-only-functions-p ""
-                       (buffer-substring (point-at-bol) (point-at-eol))
+                        (buffer-substring (line-beginning-position) 
(line-end-position))
                        ))
                  ;; Go get the first line of this tag.
                  (goto-char (semantic-tag-start tag))
@@ -765,7 +765,7 @@ If there is no function, disable the header line."
                  ;; Without going to the tag-name we would get"void" in the
                  ;; header line which is IMHO not really useful
                  (search-forward (semantic-tag-name tag) nil t)
-                 (buffer-substring (point-at-bol) (point-at-eol))
+                  (buffer-substring (line-beginning-position) 
(line-end-position))
                  ))))
           (start 0))
       (while (string-match "%" str start)
@@ -959,7 +959,7 @@ function was called, move the overlay."
            (goto-char (semantic-tag-start tag))
            (search-forward (semantic-tag-name tag) nil t)
            (overlay-put ol 'tag tag)
-           (move-overlay ol (point-at-bol) (point-at-eol)))))))
+            (move-overlay ol (line-beginning-position) 
(line-end-position)))))))
   nil)
 
 (semantic-add-minor-mode 'semantic-highlight-func-mode
diff --git a/lisp/cedet/semantic/wisent/javascript.el 
b/lisp/cedet/semantic/wisent/javascript.el
index cc7ae1b181..492f574fce 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -107,7 +107,7 @@ This is currently needed for the mozrepl omniscient 
database."
          (when (looking-at "\\w\\|\\s_")
            (forward-sexp 1))
          (setq end (point))
-         (unless (re-search-backward "\\s-" (point-at-bol) t)
+          (unless (re-search-backward "\\s-" (line-beginning-position) t)
            (beginning-of-line))
          (setq tmp (buffer-substring-no-properties (point) end))
          ;; (setq symlist
diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el
index 8c5f343e98..a25d1441f1 100644
--- a/lisp/cedet/srecode/document.el
+++ b/lisp/cedet/srecode/document.el
@@ -496,7 +496,7 @@ It is assumed that the comment occurs just after VAR-IN."
 
     ;; Find any existing doc strings.
     (goto-char (semantic-tag-end var-in))
-    (skip-syntax-forward "-" (point-at-eol))
+    (skip-syntax-forward "-" (line-end-position))
     (let ((lextok (semantic-doc-snarf-comment-for-tag 'lex))
          )
 
@@ -521,7 +521,7 @@ It is assumed that the comment occurs just after VAR-IN."
     (end-of-line)
     (delete-horizontal-space)
     (move-to-column comment-column t)
-    (when (< (point) (point-at-eol)) (end-of-line))
+    (when (< (point) (line-end-position)) (end-of-line))
 
     ;; Perform the insertion
     (let ((srecode-semantic-selected-tag var-in)
@@ -819,7 +819,7 @@ not account for verb parts."
   "Does TAG fit on one line with space on the end?"
   (save-excursion
     (semantic-go-to-tag tag)
-    (and (<= (semantic-tag-end tag) (point-at-eol))
+    (and (<= (semantic-tag-end tag) (line-end-position))
         (goto-char (semantic-tag-end tag))
         (< (current-column) 70))))
 
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index c0260c62a9..db17b7f23f 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -406,7 +406,7 @@ Specify the :blank argument to enable this inserter.")
            ((eq (oref sti where) 'end)
             ;; If there is whitespace after pnt, then clear it out.
             (when (looking-at "\\s-*$")
-              (delete-region (point) (point-at-eol)))
+               (delete-region (point) (line-end-position)))
             (when (not (eolp))
               (princ "\n")))
            )
diff --git a/lisp/dired.el b/lisp/dired.el
index 01098fdf89..f45d215ed6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1262,13 +1262,13 @@ The return value is the target column for the file 
names."
     (dired-goto-next-file)
     ;; Use point difference instead of `current-column', because
     ;; the former works when `dired-hide-details-mode' is enabled.
-    (let* ((first (- (point) (point-at-bol)))
+    (let* ((first (- (point) (line-beginning-position)))
            (target first))
       (while (and (not (eobp))
                   (progn
                     (forward-line)
                     (dired-move-to-filename)))
-        (when-let* ((distance (- (point) (point-at-bol)))
+        (when-let* ((distance (- (point) (line-beginning-position)))
                     (higher (> distance target)))
           (setq target distance)))
       (and (/= first target) target))))
@@ -1284,7 +1284,7 @@ The return value is the target column for the file names."
         (while (dired-move-to-filename)
           ;; Use point difference instead of `current-column', because
           ;; the former works when `dired-hide-details-mode' is enabled.
-          (let ((distance (- target (- (point) (point-at-bol))))
+          (let ((distance (- target (- (point) (line-beginning-position))))
                 (inhibit-read-only t))
             (unless (zerop distance)
               (re-search-backward regexp nil t)
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el
index d5f3fc7756..aa415a3e9e 100644
--- a/lisp/ecomplete.el
+++ b/lisp/ecomplete.el
@@ -199,7 +199,7 @@ matches."
     (goto-char (point-min))
     (forward-line line)
     (save-restriction
-      (narrow-to-region (point) (point-at-eol))
+      (narrow-to-region (point) (line-end-position))
       (while (not (eobp))
        ;; Put the 'region face on any characters on this line that
        ;; aren't already highlighted.
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 4f98bf3f4f..70473770d1 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -591,7 +591,7 @@ content of the sexp."
          (begin (previous-single-property-change end 'backtrace-form
                                                  nil (point-min))))
     (unless tag
-      (when (or (= end (point-max)) (> end (point-at-eol)))
+      (when (or (= end (point-max)) (> end (line-end-position)))
         (user-error "No form here to reformat"))
       (goto-char end)
       (setq pos end
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 5dde2d2bfb..c25250533a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1235,7 +1235,8 @@ Order is by depth-first search."
                     (let (new-l new-c)
                       (save-excursion
                         (goto-char offset)
-                        (setq new-l (1+ (count-lines (point-min) 
(point-at-bol)))
+                        (setq new-l (1+ (count-lines (point-min)
+                                                     
(line-beginning-position)))
                               new-c (1+ (current-column)))
                         (format "%d:%d:" new-l new-c))))
                ""))
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index ac6cbb53a5..6d1821504c 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -526,9 +526,9 @@ cons cells of the form (NAME . NUM).  See `sort' for more 
details."
 (defun chart-zap-chars (n)
   "Zap up to N chars without deleting EOLs."
   (if (not (eobp))
-      (if (< n (- (point-at-eol) (point)))
+      (if (< n (- (line-end-position) (point)))
          (delete-char n)
-       (delete-region (point) (point-at-eol)))))
+        (delete-region (point) (line-end-position)))))
 
 (defun chart-display-label (label dir zone start end &optional face)
   "Display LABEL in direction DIR in column/row ZONE between START and END.
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index 3f8113dea3..cd0e8d60cc 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -647,7 +647,7 @@ Argument NUM is the number of lines to move."
           (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
           (far (save-excursion
                  (goto-char bottom)
-                 (point-at-bol (1- height)))))
+                 (line-beginning-position (1- height)))))
      (ignore top far)
      ,@body))
 
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index ddb49609d4..26793989d0 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -3266,8 +3266,8 @@ controlled by the sign of prefix numeric value."
        (if (and (eolp) (not (bolp))) (forward-char -1))
        (if (not (looking-at "[][(){}]"))
            (setq anchor-point (point)))
-       (setq beg-lim (point-at-bol)
-             end-lim (point-at-eol))
+        (setq beg-lim (line-beginning-position)
+              end-lim (line-end-position))
        (cond ((re-search-forward "[][(){}]" end-lim t)
               (backward-char) )
              ((re-search-backward "[][(){}]" beg-lim t))
@@ -4390,7 +4390,7 @@ One can use \\=`\\=` and \\='\\=' to temporarily jump 1 
step back."
              (delete-char -1)
              (setq p (point))
              (setq indent nil)))
-       (setq bol (point-at-bol))
+        (setq bol (line-beginning-position))
        (if (re-search-backward "[^ \t]" bol 1) (forward-char))
        (delete-region (point) p)
        (if indent
@@ -4474,7 +4474,7 @@ One can use \\=`\\=` and \\='\\=' to temporarily jump 1 
step back."
                       (goto-char pos)
                       (beginning-of-line)
                       (if (re-search-backward "[^ \t]" nil t)
-                          (setq s (point-at-bol)))
+                           (setq s (line-beginning-position)))
                       (goto-char pos)
                       (forward-line 1)
                       (if (re-search-forward "[^ \t]" nil t)
diff --git a/lisp/epa.el b/lisp/epa.el
index 742c37d085..63bc0941d6 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -417,7 +417,7 @@ q  trust status questionable.  -  trust status unspecified.
                                             'epa-key))
                (setq keys (cons key keys))))
          (nreverse keys)))
-      (let ((key (get-text-property (point-at-bol) 'epa-key)))
+      (let ((key (get-text-property (line-beginning-position) 'epa-key)))
        (if key
            (list key)))))
 
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 28003eaf71..6501434e03 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -246,9 +246,9 @@ version requirement is met."
       (goto-char (match-end 0))
       (backward-char)
       (forward-sexp)
-      (skip-syntax-forward "-" (point-at-eol))
+      (skip-syntax-forward "-" (line-end-position))
       (list (cons 'program program)
-            (cons 'version (buffer-substring (point) (point-at-eol)))))))
+            (cons 'version (buffer-substring (point) (line-end-position)))))))
 
 ;;;###autoload
 (defun epg-configuration ()
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index 11979a0130..0c32f1e51f 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -343,7 +343,7 @@ The INDENT level is ignored."
   "Return the text for the item on the current line."
   (beginning-of-line)
   (when (re-search-forward "[]>] " nil t)
-    (buffer-substring-no-properties (point) (point-at-eol))))
+    (buffer-substring-no-properties (point) (line-end-position))))
 
 (defun erc-speedbar-item-info ()
   "Display information about the current buffer on the current line."
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index cdab3241c1..c167cd2393 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -303,7 +303,7 @@ printed just after each line's text (no alignment)."
       ;; to the next line before inserting a stamp.  It allows for
       ;; some margin of error if what is displayed on the line differs
       ;; from the number of characters on the line.
-      (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
+      (setq col (+ col (ceiling (/ (- col (- (point) 
(line-beginning-position))) 1.6))))
       (if (< col pos)
          (erc-insert-aligned string pos)
        (newline)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index e401759591..88b4bce9fd 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -948,7 +948,7 @@ out of NAME."
                (save-excursion
                  (re-search-backward (regexp-opt
                                       (mapcar 'car preferred-suffix-rules))
-                                     (point-at-bol)
+                                     (line-beginning-position)
                                      t))
              (push (cons "" (cdr (assoc (match-string 0) ; i.e. 
"(TeX-current-macro)"
                                         preferred-suffix-rules)))
@@ -962,7 +962,7 @@ out of NAME."
                                           (concat (car rule) name (cdr rule)))
                                         guess-rules)))
              (when (< (point-min) (point-max))
-               (buffer-substring (goto-char (point-min)) (point-at-eol))))))))
+               (buffer-substring (goto-char (point-min)) 
(line-end-position))))))))
 
 (defun ffap-tex (name)
   (ffap-tex-init)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 7eb5a414fe..b6f4150964 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1572,7 +1572,7 @@ START should be at the beginning of a line."
                                         font-lock-comment-delimiter-face)))
                (if (looking-back (or font-lock-comment-end-skip
                                      comment-end-skip)
-                                 (point-at-bol) t)
+                                  (line-beginning-position) t)
                    (put-text-property (match-beginning 0) (point) 'face
                                       font-lock-comment-delimiter-face))))
            (< (point) end))
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index e4704b35c8..e1c7bcb467 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -1681,7 +1681,7 @@ and that there are no duplicates."
              (gnus-message 1
                            "Overview buffer contains garbage `%s'."
                            (buffer-substring
-                            p (point-at-eol))))
+                             p (line-end-position))))
             ((= cur prev-num)
              (or backed-up
                   (setq backed-up (gnus-agent-backup-overview-buffer)))
@@ -2687,7 +2687,7 @@ The following commands are available:
     (gnus-category-position-point)))
 
 (defun gnus-category-name ()
-  (or (intern (get-text-property (point-at-bol) 'gnus-category))
+  (or (intern (get-text-property (line-beginning-position) 'gnus-category))
       (error "No category on the current line")))
 
 (defun gnus-category-read ()
@@ -3363,7 +3363,7 @@ missing NOV entry.  Run gnus-agent-regenerate-group to 
restore it.")))
 
                     (cl-incf nov-entries-deleted)
 
-                    (let* ((from (point-at-bol))
+                     (let* ((from (line-beginning-position))
                            (to (progn (forward-line 1) (point)))
                            (freed (- to from)))
                       (cl-incf bytes-freed freed)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 480ebe377d..83ba72c091 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1930,7 +1930,7 @@ always hide."
              (while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t)
                (forward-line -1)
                (gnus-article-hide-text-type
-                (point-at-bol)
+                 (line-beginning-position)
                 (progn
                   (end-of-line)
                   (if (re-search-forward "^[^ \t]" nil t)
@@ -2060,7 +2060,7 @@ always hide."
     (goto-char (point-min))
     (when (re-search-forward (concat "^" header ":") nil t)
       (gnus-article-hide-text-type
-       (point-at-bol)
+       (line-beginning-position)
        (progn
         (end-of-line)
         (if (re-search-forward "^[^ \t]" nil t)
@@ -2081,7 +2081,7 @@ always hide."
        (article-narrow-to-head)
        (while (not (eobp))
          (cond
-          ((< (setq column (- (point-at-eol) (point)))
+           ((< (setq column (- (line-end-position) (point)))
               gnus-article-normalized-header-length)
            (end-of-line)
            (insert (make-string
@@ -2092,7 +2092,7 @@ always hide."
             (progn
               (forward-char gnus-article-normalized-header-length)
               (point))
-            (point-at-eol)
+             (line-end-position)
             'invisible t))
           (t
            ;; Do nothing.
@@ -2389,7 +2389,7 @@ fill width."
            (end-of-line)
            (when (>= (current-column) width)
              (narrow-to-region (min (1+ (point)) (point-max))
-                               (point-at-bol))
+                                (line-beginning-position))
               (let ((goback (point-marker))
                    (fill-column width))
                 (fill-paragraph nil)
@@ -2446,7 +2446,7 @@ fill width."
         (while (and (not (bobp))
                     (looking-at "^[ \t]*$")
                     (not (gnus-annotation-in-region-p
-                          (point) (point-at-eol))))
+                           (point) (line-end-position))))
           (forward-line -1))
         (forward-line 1)
         (point))))))
@@ -3583,9 +3583,10 @@ possible values."
                                              'original-date)
                      bface (get-text-property (match-beginning 0) 'face)
                      eface (get-text-property (match-end 0) 'face))
-               (delete-region (point-at-bol) (progn
-                                               (gnus-article-forward-header)
-                                               (point)))))
+                (delete-region (line-beginning-position)
+                               (progn
+                                 (gnus-article-forward-header)
+                                 (point)))))
            (when (and (not date)
                       visible-date)
              (setq date visible-date))
@@ -4388,8 +4389,8 @@ If variable `gnus-use-long-file-name' is non-nil, it is
                (message-narrow-to-head)
                (goto-char (point-max))
                (forward-line -1)
-               (setq bface (get-text-property (point-at-bol) 'face)
-                     eface (get-text-property (1- (point-at-eol)) 'face))
+                (setq bface (get-text-property (line-beginning-position) 'face)
+                      eface (get-text-property (1- (line-end-position)) 'face))
                (message-remove-header "X-Gnus-PGP-Verify")
                (if (re-search-forward "^X-PGP-Sig:" nil t)
                    (forward-line)
@@ -5925,7 +5926,7 @@ all parts."
            ;; Go to the displayed subpart, assuming this is
            ;; multipart/alternative.
            (setq part start
-                 end (point-at-eol))
+                  end (line-end-position))
            (while (and (not handle)
                        part
                        (< part end)
@@ -6825,9 +6826,9 @@ not have a face in `gnus-article-boring-faces'."
   "Read article specified by message-id around point."
   (interactive nil gnus-article-mode)
   (save-excursion
-    (re-search-backward "[ \t]\\|^" (point-at-bol) t)
-    (re-search-forward "<?news:<?\\|<" (point-at-eol) t)
-    (if (re-search-forward "[^@ ]+@[^ \t>]+" (point-at-eol) t)
+    (re-search-backward "[ \t]\\|^" (line-beginning-position) t)
+    (re-search-forward "<?news:<?\\|<" (line-end-position) t)
+    (if (re-search-forward "[^@ ]+@[^ \t>]+" (line-end-position) t)
        (let ((msg-id (concat "<" (match-string 0) ">")))
          (set-buffer gnus-summary-buffer)
          (gnus-summary-refer-article msg-id))
@@ -8180,7 +8181,7 @@ url is put as the `gnus-button-url' overlay property on 
the button."
                     (goto-char start)
                     (string-match
                      "\\(?:\"\\|\\(<\\)\\)[\t ]*\\(?:url[\t ]*:[\t ]*\\)?\\'"
-                     (buffer-substring (point-at-bol) start)))
+                      (buffer-substring (line-beginning-position) start)))
                   (progn
                     (setq url (list (buffer-substring start end))
                           delim (if (match-beginning 1) ">" "\""))
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el
index 4f5b9bd342..18732218c9 100644
--- a/lisp/gnus/gnus-bookmark.el
+++ b/lisp/gnus/gnus-bookmark.el
@@ -509,7 +509,7 @@ Optional argument SHOW means show them unconditionally."
             (let ((bmrk (gnus-bookmark-bmenu-bookmark)))
               (setq gnus-bookmark-bmenu-hidden-bookmarks
                     (cons bmrk gnus-bookmark-bmenu-hidden-bookmarks))
-             (let ((start (point-at-eol)))
+              (let ((start (line-end-position)))
                (move-to-column gnus-bookmark-bmenu-file-column t)
                ;; Strip off `mouse-face' from the white spaces region.
                (if (display-mouse-p)
@@ -543,7 +543,7 @@ Optional argument SHOW means show them unconditionally."
   "Kill from point to end of line.
 If optional arg NEWLINE-TOO is non-nil, delete the newline too.
 Does not affect the kill ring."
-  (delete-region (point) (point-at-eol))
+  (delete-region (point) (line-end-position))
   (if (and newline-too (looking-at "\n"))
       (delete-char 1)))
 
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index ee20ba3c7f..449b73163f 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -552,7 +552,7 @@ Returns the list of articles removed."
       (set-buffer cache-buf)
       (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
                          nil t)
-         (setq beg (point-at-bol)
+          (setq beg (line-beginning-position)
                end (progn (end-of-line) (point)))
        (setq beg nil))
       (set-buffer nntp-server-buffer)
diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el
index 3ba2bbd6fe..b4d7661d74 100644
--- a/lisp/gnus/gnus-cite.el
+++ b/lisp/gnus/gnus-cite.el
@@ -371,7 +371,7 @@ Lines matching `gnus-cite-attribution-suffix' and perhaps
        (goto-char (point-min))
        (forward-line (1- number))
        (when (re-search-forward gnus-cite-attribution-suffix
-                                (point-at-eol)
+                                 (line-end-position)
                                 t)
          (gnus-article-add-button (match-beginning 1) (match-end 1)
                                   'gnus-cite-toggle prefix))
@@ -756,7 +756,7 @@ See also the documentation for 
`gnus-article-highlight-citation'."
       ;; Each line.
       (setq begin (point)
            guess-limit (progn (skip-chars-forward "^> \t\r\n") (point))
-           end (point-at-bol 2)
+            end (line-beginning-position 2)
            start end)
       (goto-char begin)
       ;; Ignore standard Supercite attribution prefix.
@@ -1105,8 +1105,8 @@ Returns nil if there is no such line before LIMIT, t 
otherwise."
                                       "[\t [:alnum:]]+")))
                       gnus-message-max-citation-depth))
          (mlist (make-list (* (1+ gnus-message-max-citation-depth) 2) nil))
-         (start (point-at-bol))
-         (end (point-at-eol)))
+          (start (line-beginning-position))
+          (end (line-end-position)))
       (setcar mlist start)
       (setcar (cdr mlist) end)
       (setcar (nthcdr (* cdepth 2) mlist) start)
diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el
index 6028d4fcb2..3c57d7b112 100644
--- a/lisp/gnus/gnus-diary.el
+++ b/lisp/gnus/gnus-diary.el
@@ -327,7 +327,7 @@ If ARG (or prefix) is non-nil, force prompting for all 
fields."
           (when (re-search-forward (concat "^" header ":") nil t)
             (unless (eq (char-after) ? )
               (insert " "))
-            (setq value (buffer-substring (point) (point-at-eol)))
+             (setq value (buffer-substring (point) (line-end-position)))
             (and (string-match "[ \t]*\\([^ \t]+\\)[ \t]*" value)
                  (setq value (match-string 1 value)))
             (condition-case ()
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 56d498cc4d..e38deefe2a 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -150,7 +150,7 @@ Obeys the standard process/prefix convention."
             (concat "^" (regexp-quote gnus-agent-target-move-group-header)
                     ":") nil t)
        (skip-syntax-forward "-")
-       (setq move-to (buffer-substring (point) (point-at-eol)))
+        (setq move-to (buffer-substring (point) (line-end-position)))
        (message-remove-header gnus-agent-target-move-group-header))
       (goto-char (point-min))
       (when (re-search-forward
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index a6b6c4a6cd..fcad601d0c 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1204,7 +1204,7 @@ case interactively), the level will be updated by this 
command."
   (gnus-group-setup-buffer)
   (gnus-update-format-specifications nil 'group 'group-mode)
   (let ((case-fold-search nil)
-       (props (text-properties-at (point-at-bol)))
+        (props (text-properties-at (line-beginning-position)))
        (empty (= (point-min) (point-max)))
        (group (gnus-group-group-name))
        number)
@@ -1724,24 +1724,24 @@ already.  If INFO-UNCHANGED is non-nil, dribble buffer 
is not updated."
 
 (defun gnus-group-group-name ()
   "Get the name of the newsgroup on the current line."
-  (let ((group (get-text-property (point-at-bol) 'gnus-group)))
+  (let ((group (get-text-property (line-beginning-position) 'gnus-group)))
     (cond ((stringp group) group)
           (group (symbol-name group)))))
 
 (defun gnus-group-group-level ()
   "Get the level of the newsgroup on the current line."
-  (get-text-property (point-at-bol) 'gnus-level))
+  (get-text-property (line-beginning-position) 'gnus-level))
 
 (defun gnus-group-group-indentation ()
   "Get the indentation of the newsgroup on the current line."
-  (or (get-text-property (point-at-bol) 'gnus-indentation)
+  (or (get-text-property (line-beginning-position) 'gnus-indentation)
       (and gnus-group-indentation-function
           (funcall gnus-group-indentation-function))
       ""))
 
 (defun gnus-group-group-unread ()
   "Get the number of unread articles of the newsgroup on the current line."
-  (get-text-property (point-at-bol) 'gnus-unread))
+  (get-text-property (line-beginning-position) 'gnus-unread))
 
 (defun gnus-group-new-mail (group)
   (if (nnmail-new-mail-p group)
@@ -2095,14 +2095,14 @@ be permanent."
                                (looking-at "[][\C-@-*,/;-@\\^`{-\C-?]")))
                       (prog1 t
                         (skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
-                                             (point-at-bol))))
+                                              (line-beginning-position))))
                  (and (looking-at "[][\C-@-\t\v-*,/;-@\\^`{-\C-?]*$")
                       (prog1 t
                         (skip-chars-backward "][\C-@-\t\v-*,/;-@\\^`{-\C-?")
                         (skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
-                                             (point-at-bol))))
+                                              (line-beginning-position))))
                  (string-match "\\`[][\C-@-\t\v-*,/;-@\\^`{-\C-?]*\\'"
-                               (buffer-substring (point-at-bol) (point))))
+                                (buffer-substring (line-beginning-position) 
(point))))
              (when (looking-at regexp)
                (match-string 1))
            (let (group distance)
@@ -2111,7 +2111,7 @@ be permanent."
                      distance (- (match-beginning 1) (match-beginning 0))))
              (skip-chars-backward "][\C-@-\t\v-*,/;-@\\^`{-\C-?")
              (skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
-                                  (point-at-bol))
+                                   (line-beginning-position))
              (if (looking-at regexp)
                  (if (and group (<= distance (- start (match-end 0))))
                      group
@@ -3948,10 +3948,10 @@ The killed newsgroups can be yanked by using 
\\[gnus-group-yank-group]."
           (count-lines
            (progn
              (goto-char begin)
-             (point-at-bol))
+              (line-beginning-position))
            (progn
              (goto-char end)
-             (point-at-bol))))))
+              (line-beginning-position))))))
     (goto-char begin)
     (beginning-of-line)                        ;Important when LINES < 1
     (gnus-group-kill-group lines)))
diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el
index d0edf2cba8..012ac9d556 100644
--- a/lisp/gnus/gnus-picon.el
+++ b/lisp/gnus/gnus-picon.el
@@ -220,13 +220,13 @@ replacement is added."
                                                   (error 0)))
                                               spec)))
                  (when (> len 0)
-                   (goto-char (point-at-eol))
+                    (goto-char (line-end-position))
                    (insert (propertize
                             " " 'display
                             (cons 'space
                                   (list :align-to (- (window-width) 1 len))))))
-                 (goto-char (point-at-eol))
-                 (setq point (point-at-eol))
+                  (goto-char (line-end-position))
+                  (setq point (line-end-position))
                  (dolist (image spec)
                    (unless (stringp image)
                      (goto-char point)
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 4ef2ebf1dd..6b7958dcb9 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -686,7 +686,7 @@ it in the environment specified by BINDINGS."
        (unless (zerop level)
          (gnus-tree-indent level)
          (insert (cadr gnus-tree-parent-child-edges))
-         (setq col (- (setq beg (point)) (point-at-bol) 1))
+          (setq col (- (setq beg (point)) (line-beginning-position) 1))
          ;; Draw "|" lines upwards.
          (while (progn
                   (forward-line -1)
@@ -710,7 +710,7 @@ it in the environment specified by BINDINGS."
 
 (defsubst gnus-tree-indent-vertical ()
   (let ((len (- (* (1+ gnus-tree-node-length) gnus-tmp-indent)
-               (- (point) (point-at-bol)))))
+                (- (point) (line-beginning-position)))))
     (when (> len 0)
       (insert (make-string len ? )))))
 
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index c852986ae6..5f49c28007 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1168,9 +1168,9 @@ If FORMAT, also format the current score file."
         (reg " -> +")
         (file (save-excursion
                 (end-of-line)
-                (if (and (re-search-backward reg (point-at-bol) t)
-                         (re-search-forward  reg (point-at-eol) t))
-                    (buffer-substring (point) (point-at-eol))
+                 (if (and (re-search-backward reg (line-beginning-position) t)
+                          (re-search-forward  reg (line-end-position) t))
+                     (buffer-substring (point) (line-end-position))
                   nil))))
     (if (or (not file)
            (string-match "\\<\\(non-file rule\\|A file\\)\\>" file)
@@ -1999,7 +1999,7 @@ score in `gnus-newsgroup-scored' by SCORE."
            (goto-char (point-min))
            (if (= dmt ?e)
                (while (funcall search-func match nil t)
-                 (and (= (point-at-bol)
+                  (and (= (line-beginning-position)
                          (match-beginning 0))
                       (= (progn (end-of-line) (point))
                          (match-end 0))
@@ -2170,7 +2170,7 @@ score in `gnus-newsgroup-scored' by SCORE."
                        (funcall search-func match nil t))
              ;; Is it really exact?
              (and (eolp)
-                  (= (point-at-bol) (match-beginning 0))
+                   (= (line-beginning-position) (match-beginning 0))
                   ;; Yup.
                   (progn
                     (setq found (setq arts (get-text-property
@@ -2260,7 +2260,7 @@ score in `gnus-newsgroup-scored' by SCORE."
          (goto-char (point-min))
          (while (and (not (eobp))
                      (search-forward match nil t))
-           (when (and (= (point-at-bol) (match-beginning 0))
+            (when (and (= (line-beginning-position) (match-beginning 0))
                       (eolp))
              (setq found (setq arts (get-text-property (point) 'articles)))
              (if trace
@@ -2344,7 +2344,7 @@ score in `gnus-newsgroup-scored' by SCORE."
               hashtb))
        (puthash
         word
-        (append (get-text-property (point-at-eol) 'articles) val)
+         (append (get-text-property (line-end-position) 'articles) val)
         hashtb)))
     ;; Make all the ignorable words ignored.
     (let ((ignored (append gnus-ignored-adaptive-words
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 53b6d1b4c6..327dba95c0 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -565,7 +565,7 @@ returning the one at the supplied position."
                      (buffer-substring
                       (point)
                       (progn
-                        (re-search-forward ":" (point-at-eol) t)
+                         (re-search-forward ":" (line-end-position) t)
                         (1- (point))))))
                (value (gnus-search-query-return-string
                        (when (looking-at-p "[\"/]") t))))
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 54be0f8e6a..e659a648e1 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -339,13 +339,13 @@ The following commands are available:
   (gnus-server-position-point))
 
 (defun gnus-server-server-name ()
-  (let ((server (get-text-property (point-at-bol) 'gnus-server)))
+  (let ((server (get-text-property (line-beginning-position) 'gnus-server)))
     (and server (symbol-name server))))
 
 (defun gnus-server-named-server ()
   "Return a server name that matches one of the names returned by
 `gnus-method-to-server'."
-  (let ((server (get-text-property (point-at-bol) 'gnus-named-server)))
+  (let ((server (get-text-property (line-beginning-position) 
'gnus-named-server)))
     (and server (symbol-name server))))
 
 (defalias 'gnus-server-position-point 'gnus-goto-colon)
@@ -949,7 +949,7 @@ how new groups will be entered into the group buffer."
   (save-excursion
     (beginning-of-line)
     (let ((name (get-text-property (point) 'gnus-group)))
-      (when (re-search-forward ": \\(.*\\)$" (point-at-eol) t)
+      (when (re-search-forward ": \\(.*\\)$" (line-end-position) t)
        (concat (gnus-method-to-server-name gnus-browse-current-method) ":"
                (or name
                    (match-string-no-properties 1)))))))
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 7b5721fafb..7700e6bd43 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -855,7 +855,7 @@ If REGEXP is given, lines that match it will be deleted."
            (unless (bolp) (forward-line 1))
            (setq end (point))
            (goto-char (match-beginning 0))
-           (delete-region (point-at-bol) end))))
+            (delete-region (line-beginning-position) end))))
       (goto-char (point-max))
       ;; Make sure that each dribble entry is a single line, so that
       ;; the "remove" code above works.
@@ -2173,7 +2173,7 @@ The info element is shared with the same element of
           (unless ignore-errors
             (gnus-message 3 "Warning - invalid active: %s"
                           (buffer-substring
-                           (point-at-bol) (point-at-eol))))))
+                            (line-beginning-position) (line-end-position))))))
        (forward-line 1)))))
 
 (defun gnus-groups-to-gnus-format (method &optional hashtb real-active)
@@ -2527,10 +2527,10 @@ The form should return either t or nil."
              ;; don't give a damn, frankly, my dear.
              (concat gnus-newsrc-options
                      (buffer-substring
-                      (point-at-bol)
+                       (line-beginning-position)
                       ;; Options may continue on the next line.
                       (or (and (re-search-forward "^[^ \t]" nil 'move)
-                               (point-at-bol))
+                                (line-beginning-position))
                           (point)))))
        (forward-line -1))
        (group
@@ -2592,8 +2592,8 @@ The form should return either t or nil."
                ;; The line was buggy.
                (setq group nil)
                (gnus-error 3.1 "Mangled line: %s"
-                           (buffer-substring (point-at-bol)
-                                             (point-at-eol))))
+                            (buffer-substring (line-beginning-position)
+                                              (line-end-position))))
              nil))
          ;; Skip past ", ".  Spaces are invalid in these ranges, but
          ;; we allow them, because it's a common mistake to put a
@@ -2702,9 +2702,9 @@ The form should return either t or nil."
       (while (re-search-forward "[ \t]-n" nil t)
        (setq eol
              (or (save-excursion
-                   (and (re-search-forward "[ \t]-n" (point-at-eol) t)
+                    (and (re-search-forward "[ \t]-n" (line-end-position) t)
                         (- (point) 2)))
-                 (point-at-eol)))
+                  (line-end-position)))
        ;; Search for all "words"...
        (while (re-search-forward "[^ \t,\n]+" eol t)
          (if (eq (char-after (match-beginning 0)) ?!)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 90b57695c5..dde60caee7 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3383,7 +3383,7 @@ marks of articles."
     (let (config)
       (goto-char (point-min))
       (while (not (eobp))
-        (when (eq (get-char-property (point-at-eol) 'invisible) 'gnus-sum)
+        (when (eq (get-char-property (line-end-position) 'invisible) 'gnus-sum)
           (push (save-excursion (forward-line 0) (point)) config))
         (forward-line 1))
       config)))
@@ -4505,7 +4505,7 @@ Returns HEADER if it was entered in the DEPENDENCIES.  
Returns nil otherwise."
   (let (header)
     ;; overview: [num subject from date id refs chars lines misc]
     (unwind-protect
-       (narrow-to-region (point) (point-at-eol))
+        (narrow-to-region (point) (line-end-position))
       (unless (eobp)
        (forward-char))
       (setq header (nnheader-parse-nov number))
@@ -4661,7 +4661,7 @@ If LINE, insert the rebuilt thread starting on line LINE."
        (setq thread (list (car (gnus-id-to-thread id))))
       ;; Get the thread this article is part of.
       (setq thread (gnus-remove-thread id)))
-    (setq old-pos (point-at-bol))
+    (setq old-pos (line-beginning-position))
     (setq current (save-excursion
                    (and (re-search-backward "[\r\n]" nil t)
                         (gnus-summary-article-number))))
@@ -4845,9 +4845,9 @@ If LINE, insert the rebuilt thread starting on line LINE."
       (gnus-summary-show-thread)
       (gnus-data-remove
        number
-       (- (point-at-bol)
+       (- (line-beginning-position)
          (prog1
-             (1+ (point-at-eol))
+              (1+ (line-end-position))
            (gnus-delete-line)))))))
 
 (defun gnus-sort-threads-recursive (threads func)
@@ -6468,7 +6468,7 @@ This is meant to be called in 
`gnus-article-internal-prepare-hook'."
                           (looking-at "Xref:"))
                      (search-forward "\nXref:" nil t))
              (goto-char (1+ (match-end 0)))
-             (setq xref (buffer-substring (point) (point-at-eol)))
+              (setq xref (buffer-substring (point) (line-end-position)))
              (setf (mail-header-xref headers) xref)))))))
 
 (defun gnus-summary-insert-subject (id &optional old-header use-old-header)
@@ -6499,9 +6499,9 @@ too, instead of trying to fetch new headers."
          (goto-char (gnus-data-pos d))
          (gnus-data-remove
           number
-          (- (point-at-bol)
+           (- (line-beginning-position)
              (prog1
-                 (1+ (point-at-eol))
+                  (1+ (line-end-position))
                (gnus-delete-line))))))
       ;; Remove list identifiers from subject.
       (let ((gnus-newsgroup-headers (list header)))
@@ -11219,7 +11219,7 @@ If NO-EXPIRE, auto-expiry will be inhibited."
 (defun gnus-summary-update-mark (mark type)
   (let ((forward (cdr (assq type gnus-summary-mark-positions)))
        (inhibit-read-only t))
-    (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
+    (re-search-backward "[\n\r]" (line-beginning-position) 'move-to-limit)
     (when forward
       (when (looking-at "\r")
        (cl-incf forward))
@@ -11756,7 +11756,7 @@ If ARG is positive number, turn showing conversation 
threads on."
 Returns nil if no thread was there to be shown."
   (interactive nil gnus-summary-mode)
   (let* ((orig (point))
-        (end (point-at-eol))
+         (end (line-end-position))
          (end (or (gnus-summary--inv end) (gnus-summary--inv (1- end))))
         ;; Leave point at bol
         (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
@@ -12675,8 +12675,8 @@ If REVERSE, save parts that do not match TYPE."
   ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
   (when gnus-summary-selected-face
     (save-excursion
-      (let* ((beg (point-at-bol))
-            (end (point-at-eol))
+      (let* ((beg (line-beginning-position))
+             (end (line-end-position))
             ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>.
             (from (if (get-text-property beg 'mouse-face)
                       beg
@@ -12732,7 +12732,7 @@ If REVERSE, save parts that do not match TYPE."
   (with-no-warnings                   ;See docstring of gnus-summary-highlight.
     (defvar score) (defvar default) (defvar default-high) (defvar default-low)
     (defvar mark) (defvar uncached))
-  (let* ((beg (point-at-bol))
+  (let* ((beg (line-beginning-position))
         (article (or (gnus-summary-article-number) gnus-current-article))
         (score (or (cdr (assq article
                               gnus-newsgroup-scored))
@@ -12748,7 +12748,7 @@ If REVERSE, save parts that do not match TYPE."
     (let ((face (funcall (gnus-summary-highlight-line-0))))
       (unless (eq face (gnus-get-text-property-excluding-characters-with-faces 
beg 'face))
        (gnus-put-text-property-excluding-characters-with-faces
-        beg (1+ (point-at-eol)) 'face
+         beg (1+ (line-end-position)) 'face
         (setq face (if (boundp face) (symbol-value face) face)))
        (when gnus-summary-highlight-line-function
          (funcall gnus-summary-highlight-line-function article face))))))
@@ -12895,7 +12895,7 @@ treated as multipart/mixed."
     (insert "Mime-Version: 1.0\n")
     (widen)
     (when (search-forward "\n--" nil t)
-      (let ((separator (buffer-substring (point) (point-at-eol))))
+      (let ((separator (buffer-substring (point) (line-end-position))))
        (message-narrow-to-head)
        (message-remove-header "Content-Type")
        (goto-char (point-max))
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index fa942bee8e..13263dddc9 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -107,15 +107,15 @@ should return non-nil if the topic is to be displayed."
 
 (defun gnus-group-topic-name ()
   "The name of the topic on the current line."
-  (get-text-property (point-at-bol) 'gnus-topic))
+  (get-text-property (line-beginning-position) 'gnus-topic))
 
 (defun gnus-group-topic-level ()
   "The level of the topic on the current line."
-  (get-text-property (point-at-bol) 'gnus-topic-level))
+  (get-text-property (line-beginning-position) 'gnus-topic-level))
 
 (defun gnus-group-topic-unread ()
   "The number of unread articles in topic on the current line."
-  (get-text-property (point-at-bol) 'gnus-topic-unread))
+  (get-text-property (line-beginning-position) 'gnus-topic-unread))
 
 (defun gnus-topic-unread (topic)
   "Return the number of unread articles in TOPIC."
@@ -128,7 +128,7 @@ should return non-nil if the topic is to be displayed."
 
 (defun gnus-topic-visible-p ()
   "Return non-nil if the current topic is visible."
-  (get-text-property (point-at-bol) 'gnus-topic-visible))
+  (get-text-property (line-beginning-position) 'gnus-topic-visible))
 
 (defun gnus-topic-articles-in-topic (entries)
   (let ((total 0)
@@ -188,7 +188,7 @@ If TOPIC, start with that topic."
 
 (defun gnus-group-active-topic-p ()
   "Say whether the current topic comes from the active topics."
-  (get-text-property (point-at-bol) 'gnus-active))
+  (get-text-property (line-beginning-position) 'gnus-active))
 
 (defun gnus-topic-find-groups (topic &optional level all lowest recursive)
   "Return entries for all visible groups in TOPIC.
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 4c93814e0d..fe556b155a 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -118,7 +118,7 @@ This is a compatibility function for different Emacsen."
 
 ;; Delete the current line (and the next N lines).
 (defmacro gnus-delete-line (&optional n)
-  `(delete-region (point-at-bol)
+  `(delete-region (line-beginning-position)
                  (progn (forward-line ,(or n 1)) (point))))
 
 (defun gnus-extract-address-components (from)
@@ -178,7 +178,7 @@ is slower."
 
 (defun gnus-goto-colon ()
   (move-beginning-of-line 1)
-  (let ((eol (point-at-eol)))
+  (let ((eol (line-end-position)))
     (goto-char (or (text-property-any (point) eol 'gnus-position t)
                   (search-forward ":" eol t)
                   (point)))))
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index ee6cab365f..9cafc78ab8 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -544,11 +544,11 @@ didn't work, and overwrite existing files.  Otherwise, 
ask each time."
                    "Various"))))
        (goto-char (point-min))
        (when (re-search-forward "^Subject: ")
-         (delete-region (point) (point-at-eol))
+          (delete-region (point) (line-end-position))
          (insert subject))
        (goto-char (point-min))
        (when (re-search-forward "^From:")
-         (delete-region (point) (point-at-eol))
+          (delete-region (point) (line-end-position))
          (insert " " from))
        (let ((message-forward-decoded-p t))
          (message-forward post t))))
@@ -1763,7 +1763,7 @@ Gnus might fail to display all of it.")
            (unless (looking-at (concat gnus-uu-begin-string "\\|"
                                        gnus-uu-end-string))
              (when (not found)
-               (setq length (- (point-at-eol) (point-at-bol))))
+                (setq length (- (line-end-position) 
(line-beginning-position))))
              (setq found t)
              (beginning-of-line)
              (setq beg (point))
@@ -2068,7 +2068,7 @@ If no file has been included, the user will be asked for 
a file."
     (goto-char (point-min))
     (re-search-forward
      (concat "^" (regexp-quote mail-header-separator) "$") nil t)
-    (setq header (buffer-substring (point-min) (point-at-bol)))
+    (setq header (buffer-substring (point-min) (line-beginning-position)))
 
     (goto-char (point-min))
     (when gnus-uu-post-separate-description
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index da05a768e3..b98e623db8 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2185,7 +2185,7 @@ see `message-narrow-to-headers-or-head'."
    (progn
      (forward-line 1)
      (if (re-search-forward "^[^ \n\t]" nil t)
-        (point-at-bol)
+         (line-beginning-position)
        (point-max))))
   (goto-char (point-min)))
 
@@ -3664,7 +3664,7 @@ Message buffers and is not meant to be called directly."
   (save-excursion
     (save-restriction
       (widen)
-      (let ((bound (+ (point-at-eol) 1)) case-fold-search)
+      (let ((bound (+ (line-end-position) 1)) case-fold-search)
         (goto-char (point-min))
         (not (search-forward (concat "\n" mail-header-separator "\n")
                              bound t))))))
@@ -5671,11 +5671,11 @@ Otherwise, generate and save a value for 
`canlock-password' first."
        (goto-char (point-max))
        (if (not (re-search-backward message-signature-separator nil t))
           t
-        (setq sig-start (1+ (point-at-eol)))
+         (setq sig-start (1+ (line-end-position)))
         (setq sig-end
               (if (re-search-forward
                    "<#/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
-                  (- (point-at-bol) 1)
+                   (- (line-beginning-position) 1)
                 (point-max)))
         (if (>= (count-lines sig-start sig-end) 5)
             (if (message-gnksa-enable-p 'signature)
@@ -6361,7 +6361,7 @@ Headers already prepared in the buffer are not modified."
                      (forward-line -1)))
                ;; The value of this header was empty, so we clear
                ;; totally and insert the new value.
-               (delete-region (point) (point-at-eol))
+                (delete-region (point) (line-end-position))
                ;; If the header is optional, and the header was
                ;; empty, we can't insert it anyway.
                (unless optionalp
@@ -6616,10 +6616,10 @@ beginning of a folded header)."
                 (or (eq (char-after) ?\s) (eq (char-after) ?\t)))
       (beginning-of-line 0)))
   (when (or (eq (char-after) ?\s) (eq (char-after) ?\t)
-            (search-forward ":" (point-at-eol) t))
+            (search-forward ":" (line-end-position) t))
     ;; We are a bit more lacks than the RFC and allow any positive number of 
WSP
     ;; characters.
-    (skip-chars-forward " \t" (point-at-eol))
+    (skip-chars-forward " \t" (line-end-position))
     (point)))
 
 (defun message-beginning-of-line (&optional n)
@@ -8642,7 +8642,7 @@ From headers in the original article."
 (autoload 'ecomplete-display-matches "ecomplete")
 
 (defun message--in-tocc-p ()
-  (and (memq (char-after (point-at-bol)) '(?C ?T ?\t ? ))
+  (and (memq (char-after (line-beginning-position)) '(?C ?T ?\t ? ))
        (message-point-in-header-p)
        (save-excursion
         (beginning-of-line)
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el
index 5f9903a5b0..1a699d0e70 100644
--- a/lisp/gnus/nnbabyl.el
+++ b/lisp/gnus/nnbabyl.el
@@ -307,7 +307,7 @@
        (while (re-search-forward
               "^X-Gnus-Newsgroup:"
               (save-excursion (search-forward "\n\n" nil t) (point)) t)
-        (delete-region (point-at-bol) (progn (forward-line 1) (point))))
+         (delete-region (line-beginning-position) (progn (forward-line 1) 
(point))))
        (setq result (eval accept-form t))
        (kill-buffer (current-buffer))
        result)
@@ -424,7 +424,7 @@
 (defun nnbabyl-delete-mail (&optional force leave-delim)
   ;; Delete the current X-Gnus-Newsgroup line.
   (unless force
-    (delete-region (point-at-bol) (progn (forward-line 1) (point))))
+    (delete-region (line-beginning-position) (progn (forward-line 1) (point))))
   ;; Beginning of the article.
   (save-excursion
     (save-restriction
@@ -630,7 +630,8 @@
       (while (re-search-forward "^X-Gnus-Newsgroup: \\([^ ]+\\) "  nil t)
        (if (gethash (setq id (match-string 1)) idents)
            (progn
-             (delete-region (point-at-bol) (progn (forward-line 1) (point)))
+              (delete-region (line-beginning-position)
+                             (progn (forward-line 1) (point)))
              (nnheader-message 7 "Moving %s..." id)
              (nnbabyl-save-mail
               (nnmail-article-group 'nnbabyl-active-number)))
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index 14540ac7e8..27204b3618 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -862,7 +862,7 @@ all.  This may very well take some time.")
                  (search-forward id nil t)) ; We find the ID.
        ;; And the id is in the fourth field.
        (if (not (and (search-backward "\t" nil t 4)
-                     (not (search-backward"\t" (point-at-bol) t))))
+                      (not (search-backward"\t" (line-beginning-position) t))))
            (forward-line 1)
          (beginning-of-line)
          (setq found t)
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index a2b461c15f..c47a398c4c 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -179,7 +179,7 @@ all.  This may very well take some time.")
                        (goto-char (match-end 0))
                        (setq num (string-to-number
                                   (buffer-substring
-                                   (point) (point-at-eol))))
+                                    (point) (line-end-position))))
                        (goto-char start)
                        (< num article)))
                      ;; Check that we are before an article with a
@@ -189,7 +189,7 @@ all.  This may very well take some time.")
                      (progn
                        (setq num (string-to-number
                                   (buffer-substring
-                                   (point) (point-at-eol))))
+                                    (point) (line-end-position))))
                        (> num article))
                      ;; Discard any article numbers before the one we're
                      ;; now looking at.
@@ -259,7 +259,7 @@ all.  This may very well take some time.")
                  (if (search-forward (concat "\n" nnfolder-article-marker)
                                      nil t)
                      (string-to-number (buffer-substring
-                                     (point) (point-at-eol)))
+                                         (point) (line-end-position)))
                    -1))))))))
 
 (deffoo nnfolder-request-group (group &optional server dont-check _info)
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 634cc251b8..b91798b8a0 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -188,7 +188,7 @@ on your system, you could say something like:
 
 (defsubst nnheader-header-value ()
   (skip-chars-forward " \t")
-  (buffer-substring (point) (point-at-eol)))
+  (buffer-substring (point) (line-end-position)))
 
 (autoload 'ietf-drums-unfold-fws "ietf-drums")
 
@@ -397,7 +397,7 @@ leaving the original buffer untouched."
 (autoload 'gnus-extract-message-id-from-in-reply-to "gnus-sum")
 
 (defun nnheader-parse-nov (&optional number)
-  (let ((eol (point-at-eol))
+  (let ((eol (line-end-position))
        references in-reply-to x header)
       (setq header
            (make-full-mail-header
@@ -632,7 +632,7 @@ the line could be found."
       ;; This is invalid, but not all articles have Message-IDs.
       ()
     (mail-position-on-field "References")
-    (let ((begin (point-at-bol))
+    (let ((begin (line-beginning-position))
          (fill-column 78)
          (fill-prefix "\t"))
       (when references
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index bde0de9892..afa14448fc 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -661,7 +661,7 @@ nn*-request-list should have been called before calling 
this function."
     (while (not (eobp))
       (condition-case nil
          (progn
-           (narrow-to-region (point) (point-at-eol))
+            (narrow-to-region (point) (line-end-position))
            (setq group (read buffer)
                  group
                  (cond ((symbolp group)
@@ -1116,7 +1116,7 @@ FUNC will be called with the group name to determine the 
article number."
        (while (not (eobp))
          (unless (< (move-to-column nnmail-split-header-length-limit)
                     nnmail-split-header-length-limit)
-           (delete-region (point) (point-at-eol)))
+            (delete-region (point) (line-end-position)))
          (forward-line 1))
        ;; Allow washing.
        (goto-char (point-min))
@@ -1650,7 +1650,7 @@ See the documentation for the variable 
`nnmail-split-fancy' for details."
        (skip-chars-forward "^\n\r\t")
        (unless (looking-at "[\r\n]")
          (forward-char 1)
-         (buffer-substring (point) (point-at-eol)))))))
+          (buffer-substring (point) (line-end-position)))))))
 
 ;; Function for nnmail-split-fancy: look up all references in the
 ;; cache and if a match is found, return that group.
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el
index 8c811b0c6c..b1eee2d530 100644
--- a/lisp/gnus/nnmairix.el
+++ b/lisp/gnus/nnmairix.el
@@ -574,7 +574,7 @@ Other back ends might or might not work.")
                              (gnus-group-get-parameter qualgroup 'folder)))
                (progn
                  (replace-match cur)
-                 (delete-region cpoint (point-at-bol))
+                  (delete-region cpoint (line-beginning-position))
                  (forward-line)
                  (setq cpoint (point)))
              (forward-line)))
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index ae726ba0f7..40e4b9ea82 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -601,7 +601,7 @@ non-nil.")
                  (search-forward id nil t)) ; We find the ID.
        ;; And the id is in the fourth field.
        (if (not (and (search-backward "\t" nil t 4)
-                     (not (search-backward "\t" (point-at-bol) t))))
+                      (not (search-backward "\t" (line-beginning-position) 
t))))
            (forward-line 1)
          (beginning-of-line)
          (setq found t)
@@ -755,7 +755,7 @@ article number.  This function is called narrowed to an 
article."
     (nnheader-insert-nov headers)))
 
 (defsubst nnml-header-value ()
-  (buffer-substring (match-end 0) (point-at-eol)))
+  (buffer-substring (match-end 0) (line-end-position)))
 
 (defun nnml-parse-head (chars &optional number)
   "Parse the head of the current buffer."
@@ -1061,7 +1061,7 @@ Use the nov database for the current group if available."
                                        (regexp-quote
                                         (concat group ":" old-number-string))
                                        "\\>")
-                               (point-at-eol) t))
+                                (line-end-position) t))
                      (replace-match
                       (concat group ":" new-number-string)))
                    ;; Save to the new file:
@@ -1109,7 +1109,7 @@ Use the nov database for the current group if available."
                                     (regexp-quote
                                      (concat group ":" old-number-string))
                                     "\\>")
-                            (point-at-eol) t)
+                             (line-end-position) t)
                        (replace-match
                         (concat "\\1" group ":" new-number-string))))))
                ;; 4/ Possibly remove the article from the backlog:
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 6fa424a155..6dea405d02 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -480,7 +480,7 @@ retried once before actually displaying the error report."
              (goto-char pos)
              (if (looking-at (regexp-quote command))
                  (delete-region pos (progn (forward-line 1)
-                                           (point-at-bol)))))))
+                                            (line-beginning-position)))))))
       (nnheader-report 'nntp "Couldn't open connection to %s."
                       nntp-address))))
 
@@ -503,7 +503,7 @@ retried once before actually displaying the error report."
              (goto-char pos)
              (if (looking-at (regexp-quote command))
                  (delete-region pos (progn (forward-line 1)
-                                           (point-at-bol)))))))
+                                            (line-beginning-position)))))))
       (nnheader-report 'nntp "Couldn't open connection to %s."
                       nntp-address))))
 
@@ -528,7 +528,8 @@ retried once before actually displaying the error report."
            (with-current-buffer buffer
              (goto-char pos)
              (if (looking-at (regexp-quote command))
-                 (delete-region pos (progn (forward-line 1) (point-at-bol))))
+                  (delete-region pos (progn (forward-line 1)
+                                            (line-beginning-position))))
              )))
       (nnheader-report 'nntp "Couldn't open connection to %s."
                       nntp-address))))
diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el
index 7b192aa1d2..e150cbf2b4 100644
--- a/lisp/gnus/nnvirtual.el
+++ b/lisp/gnus/nnvirtual.el
@@ -387,7 +387,7 @@ lines have the correct component server prefix."
   (looking-at
    "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
   (goto-char (match-end 0))
-  (unless (search-forward "\t" (point-at-eol) 'move)
+  (unless (search-forward "\t" (line-end-position) 'move)
     (insert "\t"))
 
   ;; Remove any spaces at the beginning of the Xref field.
@@ -403,8 +403,8 @@ lines have the correct component server prefix."
   ;; component server prefix.
   (save-restriction
     (narrow-to-region (point)
-                     (or (search-forward "\t" (point-at-eol) t)
-                         (point-at-eol)))
+                      (or (search-forward "\t" (line-end-position) t)
+                          (line-end-position)))
     (goto-char (point-min))
     (when (re-search-forward "Xref: *[^\n:0-9 ]+ *" nil t)
       (replace-match "" t t))
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 87b5551d31..fd2791f5c5 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -519,7 +519,7 @@ A string or a list of strings is returned."
     (goto-char b)
     (let (res)
       (while (< (point) e)
-       (let ((str (buffer-substring (point) (point-at-eol))))
+        (let ((str (buffer-substring (point) (line-end-position))))
          (unless (string= "" str)
            (push str res)))
        (forward-line))
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index 334204768b..014b8254fa 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -291,7 +291,7 @@ symbol `ask', query before flushing the queue file."
     (goto-char (point-min))
     (while (and (not (eobp))
                (re-search-forward
-                "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
+                 "http://\\([^/]+\\)\\(/.*\\) *$" (line-end-position) t))
       (let ((spam-report-gmane-wait
             (zerop (% (line-number-at-pos) spam-report-gmane-max-requests))))
        (gnus-message 6 "Reporting %s%s..."
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 2883a6186b..e0d90e5547 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -2132,7 +2132,7 @@ See `spam-ifile-database'."
         ;; check the return now (we're back in the temp buffer)
         (goto-char (point-min))
         (if (not (eobp))
-            (setq category (buffer-substring (point) (point-at-eol))))
+            (setq category (buffer-substring (point) (line-end-position))))
         (when (not (zerop (length category))) ; we need a category here
           (if spam-ifile-all-categories
               (setq return category)
@@ -2321,7 +2321,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
       (with-temp-buffer
         (insert-file-contents file)
         (while (not (eobp))
-          (setq address (buffer-substring (point) (point-at-eol)))
+          (setq address (buffer-substring (point) (line-end-position)))
           (forward-line 1)
           ;; insert the e-mail address if detected, otherwise the raw data
           (unless (zerop (length address))
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 63752f953a..a6e508155f 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -310,7 +310,7 @@ matches may be returned from the message body."
                                      (buffer-substring-no-properties
                                       opoint (point)))))
                 (if delete
-                    (delete-region (point-at-bol) (point)))))
+                    (delete-region (line-beginning-position) (point)))))
            (if list
                value
              (and (not (string= value "")) value)))
@@ -326,7 +326,8 @@ matches may be returned from the message body."
                 (prog1
                     (buffer-substring-no-properties opoint (point))
                   (if delete
-                      (delete-region (point-at-bol) (1+ (point))))))))))))
+                      (delete-region (line-beginning-position)
+                                     (1+ (point))))))))))))
 
 ;; Parse a list of tokens separated by commas.
 ;; It runs from point to the end of the visible part of the buffer.
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 86711a4543..0e0fb51200 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -394,7 +394,7 @@ with a space."
     (let (p)
       (save-excursion
        (while (>= (current-column) fill-column)
-         (while (and (search-backward "," (point-at-bol) 'move)
+          (while (and (search-backward "," (line-beginning-position) 'move)
                      (>= (current-column) (1- fill-column))
                      (setq p (point))))
          (when (or (not (bolp))
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el
index 2ab4fa411a..0673493487 100644
--- a/lisp/mail/mspools.el
+++ b/lisp/mail/mspools.el
@@ -264,7 +264,7 @@ Buffer is not displayed if SHOW is non-nil."
              (delete-char 1))))
 
       (message "folder %s spool %s" folder-name spool-name)
-      (forward-line (if (eq (count-lines (point-min) (point-at-eol))
+      (forward-line (if (eq (count-lines (point-min) (line-end-position))
                            mspools-files-len)
                        ;; FIXME: Why use `mspools-files-len' instead
                         ;; of looking if we're on the last line and
@@ -307,7 +307,7 @@ Buffer is not displayed if SHOW is non-nil."
 
 (defun mspools-get-spool-name ()
   "Return the name of the spool on the current line."
-  (let ((line-num (1- (count-lines (point-min) (point-at-eol)))))
+  (let ((line-num (1- (count-lines (point-min) (line-end-position)))))
     ;; FIXME: Why not extract the name directly from the current line's text?
     (car (nth line-num mspools-files))))
 
diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el
index 67874d508b..abb95a63f1 100644
--- a/lisp/mail/rfc2047.el
+++ b/lisp/mail/rfc2047.el
@@ -175,7 +175,7 @@ This is either `base64' or `quoted-printable'."
    (progn
      (forward-line 1)
      (if (re-search-forward "^[^ \n\t]" nil t)
-        (point-at-bol)
+         (line-beginning-position)
        (point-max))))
   (goto-char (point-min)))
 
@@ -681,14 +681,14 @@ Point moves to the end of the region."
             (goto-char b)
             (setq b (point-marker)
                   e (set-marker (make-marker) e))
-            (rfc2047-fold-region (point-at-bol) b)
+             (rfc2047-fold-region (line-beginning-position) b)
             (goto-char b)
             (skip-chars-backward "^ \t\n")
             (unless (= 0 (skip-chars-backward " \t"))
               ;; `crest' may contain whitespace and an open parenthesis.
               (setq crest (buffer-substring-no-properties (point) b)))
             (setq eword (rfc2047-encode-1
-                         (- b (point-at-bol))
+                          (- b (line-beginning-position))
                          (replace-regexp-in-string
                           "\n\\([ \t]?\\)" "\\1"
                           (buffer-substring-no-properties b e))
@@ -824,18 +824,18 @@ Return the new end point."
     (goto-char (point-min))
     (let ((bol (save-restriction
                 (widen)
-                (point-at-bol)))
-         (eol (point-at-eol)))
+                 (line-beginning-position)))
+          (eol (line-end-position)))
       (forward-line 1)
       (while (not (eobp))
        (if (and (looking-at "[ \t]")
-                (< (- (point-at-eol) bol) 76))
+                 (< (- (line-end-position) bol) 76))
            (delete-region eol (progn
                                 (goto-char eol)
                                 (skip-chars-forward "\r\n")
                                 (point)))
-         (setq bol (point-at-bol)))
-       (setq eol (point-at-eol))
+          (setq bol (line-beginning-position)))
+        (setq eol (line-end-position))
        (forward-line 1)))))
 
 (defun rfc2047-b-encode-string (string)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 189ad075c4..387792eb31 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1293,7 +1293,7 @@ external program defined by `sendmail-program'."
                   ;; should override any specified in the message itself.
                     (when where-content-type
                       (goto-char where-content-type)
-                      (delete-region (point-at-bol)
+                       (delete-region (line-beginning-position)
                                      (progn (forward-line 1) (point)))))))
            ;; Insert an extra newline if we need it to work around
            ;; Sun's bug that swallows newlines.
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 45b25b5530..c2f8f27377 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -474,7 +474,7 @@ for `smtpmail-try-auth-method'.")
                        (smtpmail--sanitize-error-message result))))))
        (delete-file file-data)
        (delete-file file-elisp)
-       (delete-region (point-at-bol) (point-at-bol 2)))
+        (delete-region (line-beginning-position) (line-beginning-position 2)))
       (write-region (point-min) (point-max) qfile))))
 
 (defun smtpmail--sanitize-error-message (string)
@@ -1057,7 +1057,8 @@ Returns an error if the server cannot be contacted."
     (while data-continue
       (with-current-buffer buffer
         (progress-reporter-update pr (point))
-        (setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
+        (setq sending-data (buffer-substring (line-beginning-position)
+                                             (line-end-position)))
        (end-of-line 2)
         (setq data-continue (not (eobp))))
       (smtpmail-send-data-1 process sending-data))
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index 8339273fc9..c82a1a53ba 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -802,7 +802,7 @@ that note messages to be refiled."
   "Return a list of message numbers from point to the end of the line.
 Expands ranges into set of individual numbers."
   (let ((msgs ())
-        (end-of-line (point-at-eol))
+        (end-of-line (line-end-position))
         num)
     (while (re-search-forward "[0-9]+" end-of-line t)
       (setq num (string-to-number (buffer-substring (match-beginning 0)
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el
index eb440ba614..40cb25fca2 100644
--- a/lisp/net/eudc.el
+++ b/lisp/net/eudc.el
@@ -856,7 +856,7 @@ non-nil, collect results from all servers."
   (let* ((end (point))
         (beg (save-excursion
                (if (re-search-backward "\\([:,]\\|^\\)[ \t]*"
-                                       (point-at-bol) 'move)
+                                        (line-beginning-position) 'move)
                    (goto-char (match-end 0)))
                (point)))
         (query-words (split-string (buffer-substring-no-properties beg end)
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 0b6488292d..fe78fbe833 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -2556,7 +2556,7 @@ Return nil if no complete line has arrived."
                              ;; next line for Courier IMAP bug.
                              (skip-chars-forward " ")
                              (point)))
-               (> (skip-chars-forward "^ )" (point-at-eol)) 0))
+                (> (skip-chars-forward "^ )" (line-end-position)) 0))
       (push (buffer-substring start (point)) flag-list))
     (cl-assert (eq (char-after) ?\)) nil "In imap-parse-flag-list 2")
     (imap-forward)
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 0f2943cbb0..5e14589d19 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -694,7 +694,7 @@ an alist of attribute/value pairs."
        (while (progn
                 (skip-chars-forward " \t\n")
                 (not (eobp)))
-         (setq dn (buffer-substring (point) (point-at-eol)))
+          (setq dn (buffer-substring (point) (line-end-position)))
          (forward-line 1)
           (while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\
 \\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index e98767ae7c..a1ac55bc7a 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -541,7 +541,7 @@ The sort function is chosen according to the value of
         (let ((inhibit-read-only t))
           (goto-char (point-min))
           (while (not (eobp))
-            (let* ((pos (point-at-eol))
+            (let* ((pos (line-end-position))
                    (item (get-text-property (point) :nt-item))
                    (age (newsticker--age item))
                    (selected (get-text-property (point) :nt-selected))
@@ -579,7 +579,8 @@ The sort function is chosen according to the value of
   (newsticker--treeview-list-clear-highlight)
   (with-current-buffer (newsticker--treeview-list-buffer)
     (let ((inhibit-read-only t))
-      (put-text-property (point-at-bol) (point-at-eol) :nt-selected t))
+      (put-text-property (line-beginning-position) (line-end-position)
+                         :nt-selected t))
     (newsticker--treeview-list-update-faces)))
 
 (defun newsticker--treeview-list-highlight-start ()
@@ -1080,7 +1081,7 @@ Arguments are ignored."
       (with-current-buffer (newsticker--treeview-tree-buffer)
         (goto-char pos)
         (move-overlay newsticker--tree-selection-overlay
-                      (point-at-bol) (1+ (point-at-eol))
+                      (line-beginning-position) (1+ (line-end-position))
                       (current-buffer)))
       (if (window-live-p (newsticker--treeview-tree-window))
           (set-window-point (newsticker--treeview-tree-window) pos)))))
diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el
index de225d76dc..9d59ddf978 100644
--- a/lisp/net/pop3.el
+++ b/lisp/net/pop3.el
@@ -469,7 +469,7 @@ Return non-nil if it is necessary to update the local UIDL 
file."
              (delete-char -3)
              (if (eq (char-before) ?\))
                  (insert ")\n ")
-               (goto-char (1+ (point-at-bol)))
+                (goto-char (1+ (line-beginning-position)))
                (delete-region (point) (point-max)))))
          (when (eq (char-before) ? )
            (delete-char -2))
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 065398b64a..71505dcaa3 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1640,7 +1640,7 @@ Create the buffer if it doesn't exist."
     (goto-char (point-max))
     (when (not (equal 0 (- (point) rcirc-prompt-end-marker)))
       ;; delete a trailing newline
-      (when (eq (point) (point-at-bol))
+      (when (eq (point) (line-beginning-position))
        (delete-char -1))
       (let ((input (buffer-substring-no-properties
                    rcirc-prompt-end-marker (point))))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 170583f608..be231fcba6 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1198,12 +1198,12 @@ FMT and ARGS are passed to `error'."
          (let ((inhibit-read-only t))
            (goto-char (point-min))
            ;; ADB terminal sends "^H" sequences.
-           (when (re-search-forward "<\b+" (point-at-eol) t)
+            (when (re-search-forward "<\b+" (line-end-position) t)
              (forward-line 1)
              (delete-region (point-min) (point)))
            ;; Delete the prompt.
             (goto-char (point-min))
-            (when (re-search-forward prompt (point-at-eol) t)
+            (when (re-search-forward prompt (line-end-position) t)
               (forward-line 1)
               (delete-region (point-min) (point)))
            (when (tramp-search-regexp prompt)
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index f7704864ec..b2a68fc5eb 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -694,7 +694,7 @@ buffer in your bug report.
        (setq buffer-read-only nil)
        (goto-char (point-min))
        (while (not (eobp))
-         (if (re-search-forward tramp-buf-regexp (point-at-eol) t)
+          (if (re-search-forward tramp-buf-regexp (line-end-position) t)
              (forward-line 1)
            (forward-line 0)
            (let ((start (point)))
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 27b359d439..657437b283 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -437,7 +437,7 @@ Otherwise, return NAME."
               (if (eq op 'encrypt) "Encoding" "Decoding") name))
            (with-current-buffer (tramp-get-connection-buffer crypt-vec)
              (goto-char (point-min))
-             (buffer-substring (point-min) (point-at-eol)))))))
+              (buffer-substring (point-min) (line-end-position)))))))
     ;; Nothing to do.
     name))
 
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 5075394d43..ca08c6f0b3 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1188,7 +1188,7 @@ component is used as the target of the symlink."
                             (tramp-shell-quote-argument localname)))
                  (with-current-buffer (tramp-get-connection-buffer v)
                    (goto-char (point-min))
-                   (buffer-substring (point-min) (point-at-eol))))
+                    (buffer-substring (point-min) (line-end-position))))
 
                 ;; Use Perl implementation.
                 ((and (tramp-get-remote-perl v)
@@ -1334,7 +1334,7 @@ component is used as the target of the symlink."
             (setq res-symlink-target
                   (if (looking-at-p "\"")
                       (read (current-buffer))
-                    (buffer-substring (point) (point-at-eol)))))
+                    (buffer-substring (point) (line-end-position)))))
          (forward-line)
           ;; ... file mode flags
          (read (current-buffer))
@@ -1416,7 +1416,7 @@ component is used as the target of the symlink."
               (format "%s -ild %s"
                       (tramp-get-ls-command v)
                       (tramp-shell-quote-argument localname)))
-             (setq attr (buffer-substring (point) (point-at-eol))))
+              (setq attr (buffer-substring (point) (line-end-position))))
            (tramp-set-file-property
             v localname "visited-file-modtime-ild" attr))
          (setq last-coding-system-used coding-system-used)
@@ -1460,7 +1460,7 @@ of."
                       (tramp-get-ls-command v)
                       (tramp-shell-quote-argument localname)))
              (with-current-buffer (tramp-get-buffer v)
-               (setq attr (buffer-substring (point) (point-at-eol))))
+                (setq attr (buffer-substring (point) (line-end-position))))
              (equal
               attr
               (tramp-get-file-property
@@ -1517,7 +1517,7 @@ VEC or USER, or if there is no home directory, return 
nil."
               (concat "~" (or user (tramp-file-name-user vec))))))
     (with-current-buffer (tramp-get-buffer vec)
       (goto-char (point-min))
-      (buffer-substring (point) (point-at-eol)))))
+      (buffer-substring (point) (line-end-position)))))
 
 (defun tramp-sh-handle-get-remote-uid (vec id-format)
   "The uid of the remote connection VEC, in ID-FORMAT.
@@ -1582,7 +1582,7 @@ ID-FORMAT valid values are `string' and `integer'."
                       (tramp-shell-quote-argument localname))))
          (with-current-buffer (tramp-get-connection-buffer v)
            (goto-char (point-min))
-           (when (re-search-forward regexp (point-at-eol) t)
+            (when (re-search-forward regexp (line-end-position) t)
              (setq context (list (match-string 1) (match-string 2)
                                  (match-string 3) (match-string 4))))))
        ;; Return the context.
@@ -1817,7 +1817,7 @@ ID-FORMAT valid values are `string' and `integer'."
                   (tramp-error
                    v 'file-error
                    "tramp-sh-handle-file-name-all-completions: %s"
-                   (buffer-substring (point) (point-at-eol))))
+                    (buffer-substring (point) (line-end-position))))
               ;; For peace of mind, if buffer doesn't end in `fail'
               ;; then it should end in `ok'.  If neither are in the
               ;; buffer something went seriously wrong on the remote
@@ -1830,7 +1830,7 @@ ID-FORMAT valid values are `string' and `integer'."
                  (tramp-shell-quote-argument localname) (buffer-string))))
 
             (while (zerop (forward-line -1))
-              (push (buffer-substring (point) (point-at-eol)) result)))
+               (push (buffer-substring (point) (line-end-position)) result)))
           result))))))
 
 ;; cp, mv and ln
@@ -3124,7 +3124,8 @@ implementation will be used."
                       (tramp-shell-quote-argument (format "kill -%d $$" i))))
                     (with-current-buffer (tramp-get-connection-buffer vec)
                       (goto-char (point-min))
-                      (buffer-substring (point-at-bol) (point-at-eol)))))
+                       (buffer-substring (line-beginning-position)
+                                         (line-end-position)))))
             (if (string-empty-p res)
                 (format "Signal %d" i)
               res)))
@@ -4087,8 +4088,8 @@ This function expects to be in the right *tramp* buffer."
        (when (search-backward "tramp_executable " nil t)
          (skip-chars-forward "^ ")
          (skip-chars-forward " ")
-         (setq result (buffer-substring (point) (point-at-eol)))))
-    result)))
+          (setq result (buffer-substring (point) (line-end-position)))))
+      result)))
 
 ;; On hydra.nixos.org, the $PATH environment variable is too long to
 ;; send it.  This is likely not due to PATH_MAX, but PIPE_BUF.  We
@@ -5276,7 +5277,7 @@ function waits for output unless NOOUTPUT is set."
            ;; A simple-minded busybox has sent " ^H" sequences.
            ;; Delete them.
            (goto-char (point-min))
-           (when (re-search-forward "^\\(.\b\\)+$" (point-at-eol) t)
+            (when (re-search-forward "^\\(.\b\\)+$" (line-end-position) t)
              (forward-line 1)
              (delete-region (point-min) (point)))
            ;; Delete the prompt.
@@ -5368,7 +5369,7 @@ raises an error."
                     (unless noerror signal-hook-function)))
                (read (current-buffer)))
            ;; Error handling.
-           (when (re-search-forward "\\S-" (point-at-eol) t)
+            (when (re-search-forward "\\S-" (line-end-position) t)
              (error nil)))
        (error (unless noerror
                 (tramp-error
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index a81a8f1363..ba0a1d3598 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1763,7 +1763,7 @@ If SHARE is result, entries are of type dir.  Otherwise, 
shares
 are listed.  Result is the list (LOCALNAME MODE SIZE MTIME)."
 ;; We are called from `tramp-smb-get-file-entries', which sets the
 ;; current buffer.
-  (let ((line (buffer-substring (point) (point-at-eol)))
+  (let ((line (buffer-substring (point) (line-end-position)))
        localname mode size month day hour min sec year mtime)
 
     (if (not share)
@@ -1877,7 +1877,7 @@ are listed.  Result is the list (LOCALNAME MODE SIZE 
MTIME)."
                (member
                 "pathnames"
                 (split-string
-                 (buffer-substring (point) (point-at-eol)) nil 'omit)))))))))
+                  (buffer-substring (point) (line-end-position)) nil 
'omit)))))))))
 
 (defun tramp-smb-get-stat-capability (vec)
   "Check whether the SMB server supports the `stat' command."
diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el
index a9225db434..4e3b94277b 100644
--- a/lisp/net/tramp-sshfs.el
+++ b/lisp/net/tramp-sshfs.el
@@ -215,7 +215,7 @@ arguments to pass to the OPERATION."
          (progn
            ;; Read the expression.
            (goto-char (point-min))
-           (buffer-substring (point) (point-at-eol)))
+            (buffer-substring (point) (line-end-position)))
          ":" 'omit))))
    ;; The equivalent to `exec-directory'.
    `(,(tramp-file-local-name (expand-file-name default-directory)))))
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 0de2e0ef69..643b5f35c0 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -512,7 +512,7 @@ the result will be a local, non-Tramp, file name."
                    (tramp-compat-file-name-unquote localname)))
          (with-current-buffer (tramp-get-connection-buffer v)
            (goto-char (point-min))
-           (when (re-search-forward regexp (point-at-eol) t)
+            (when (re-search-forward regexp (line-end-position) t)
              (setq context (list (match-string 1) (match-string 2)
                                  (match-string 3) (match-string 4))))))
        ;; Return the context.
@@ -752,7 +752,7 @@ ID-FORMAT valid values are `string' and `integer'."
     (delete-region (point-min) (point))
     ;; Delete empty lines.
     (goto-char (point-min))
-    (while (and (not (eobp)) (= (point) (point-at-eol)))
+    (while (and (not (eobp)) (= (point) (line-end-position)))
       (forward-line))
     (delete-region (point-min) (point))
     (tramp-message vec 3 "Process has finished.")
@@ -841,7 +841,7 @@ In case there is no valid Lisp expression, it raises an 
error."
       (condition-case nil
          (prog1 (read (current-buffer))
            ;; Error handling.
-           (when (re-search-forward "\\S-" (point-at-eol) t)
+            (when (re-search-forward "\\S-" (line-end-position) t)
              (error nil)))
        (error (tramp-error
                vec 'file-error
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index ed40245e8a..238ec50c40 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3203,7 +3203,7 @@ for all methods.  Resulting data are derived from default 
settings."
    "Return a (user host) tuple allowed to access.
 User is always nil."
    (let (result)
-     (when (re-search-forward regexp (point-at-eol) t)
+     (when (re-search-forward regexp (line-end-position) t)
        (setq result (list nil (match-string match-level))))
      (or
       (> (skip-chars-forward skip-chars) 0)
@@ -3236,7 +3236,7 @@ Either user or host may be nil."
          (concat
           "^\\(" tramp-host-regexp "\\)"
           "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
-     (when (re-search-forward regexp (point-at-eol) t)
+     (when (re-search-forward regexp (line-end-position) t)
        (setq result (append (list (match-string 3) (match-string 1)))))
      (forward-line 1)
      result))
@@ -3318,7 +3318,7 @@ Host is always \"localhost\"."
 Host is always \"localhost\"."
    (let (result
         (regexp (concat "^\\(" tramp-user-regexp "\\):")))
-     (when (re-search-forward regexp (point-at-eol) t)
+     (when (re-search-forward regexp (line-end-position) t)
        (setq result (list (match-string 1) "localhost")))
      (forward-line 1)
      result))
@@ -3339,7 +3339,7 @@ Host is always \"localhost\"."
    "Return a (group host) tuple allowed to access.
 Host is always \"localhost\"."
    (let (result
-        (split (split-string (buffer-substring (point) (point-at-eol)) ":")))
+         (split (split-string (buffer-substring (point) (line-end-position)) 
":")))
      (when (member (user-login-name) (split-string (nth 3 split) "," 'omit))
        (setq result (list (nth 0 split) "localhost")))
      (forward-line 1)
@@ -3374,7 +3374,7 @@ User is always nil."
 User is always nil."
    (let (result
         (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)")))
-     (when (re-search-forward regexp (point-at-eol) t)
+     (when (re-search-forward regexp (line-end-position) t)
        (setq result (list nil (match-string 1))))
      (forward-line 1)
      result))
@@ -4142,12 +4142,12 @@ Let-bind it when necessary.")
            (goto-char (point-min))
            (while (setq start
                         (text-property-not-all
-                         (point) (point-at-eol) 'dired-filename t))
+                          (point) (line-end-position) 'dired-filename t))
              (delete-region
               start
-              (or (text-property-any start (point-at-eol) 'dired-filename t)
-                  (point-at-eol)))
-             (if (= (point-at-bol) (point-at-eol))
+               (or (text-property-any start (line-end-position) 
'dired-filename t)
+                   (line-end-position)))
+              (if (= (line-beginning-position) (line-end-position))
                  ;; Empty line.
                  (delete-region (point) (progn (forward-line) (point)))
                (forward-line)))))))))
diff --git a/lisp/obsolete/netrc.el b/lisp/obsolete/netrc.el
index f664a77a9b..0114dadbab 100644
--- a/lisp/obsolete/netrc.el
+++ b/lisp/obsolete/netrc.el
@@ -82,7 +82,7 @@
          (goto-char (point-min))
          ;; Go through the file, line by line.
          (while (not (eobp))
-           (narrow-to-region (point) (point-at-eol))
+            (narrow-to-region (point) (line-end-position))
            ;; For each line, get the tokens and values.
            (while (not (eobp))
              (skip-chars-forward "\t ")
@@ -205,7 +205,7 @@ MODE can be \"login\" or \"password\", suitable for passing 
to
       (with-temp-buffer
        (insert-file-contents netrc-services-file)
        (while (search-forward "#" nil t)
-         (delete-region (1- (point)) (point-at-eol)))
+          (delete-region (1- (point)) (line-end-position)))
        (goto-char (point-min))
        (while (re-search-forward
                "^ *\\([^ \n\t]+\\)[ \t]+\\([0-9]+\\)/\\([^ \t\n]+\\)" nil t)
diff --git a/lisp/obsolete/tpu-extras.el b/lisp/obsolete/tpu-extras.el
index 76338cdd24..d631c47705 100644
--- a/lisp/obsolete/tpu-extras.el
+++ b/lisp/obsolete/tpu-extras.el
@@ -292,7 +292,7 @@ Prefix argument serves as repeat count."
           (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
           (far (save-excursion
                  (goto-char bottom)
-                 (point-at-bol (1- height)))))
+                 (line-beginning-position (1- height)))))
      ,@body))
 
 (defun tpu-paragraph (num)
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index 3b114703cd..41b7a2a971 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -917,7 +917,7 @@ arguments and pop open the results in a preview buffer."
                       vals ""))))))
     (save-excursion
       (goto-char begin)
-      (goto-char (point-at-eol))
+      (goto-char (line-end-position))
       (unless (= (char-before (point)) ?\ ) (insert " "))
       (insert ":" header-arg) (when value (insert " " value)))))
 
@@ -1936,9 +1936,9 @@ region is not active then the point is demarcated."
              (let ((lang (nth 0 info))
                    (indent (make-string (current-indentation) ?\s)))
               (when (string-match "^[[:space:]]*$"
-                                  (buffer-substring (point-at-bol)
-                                                    (point-at-eol)))
-                (delete-region (point-at-bol) (point-at-eol)))
+                                   (buffer-substring (line-beginning-position)
+                                                     (line-end-position)))
+                 (delete-region (line-beginning-position) (line-end-position)))
                (insert (concat
                        (if (looking-at "^") "" "\n")
                        indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index dd204d7f6b..f1ea803ba3 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -312,7 +312,7 @@ LINENO is the number of the erroneous line."
        (progn
          (goto-char (point-min))
          (forward-line (- lineNo 1))
-         (buffer-substring (point) (point-at-eol)))
+          (buffer-substring (point) (line-end-position)))
       nil)))
 
 (defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)
diff --git a/lisp/org/ob-octave.el b/lisp/org/ob-octave.el
index bbbda5bb1e..9be8f5ad3e 100644
--- a/lisp/org/ob-octave.el
+++ b/lisp/org/ob-octave.el
@@ -255,7 +255,7 @@ This removes initial blank and comment lines and then calls
       (insert-file-contents file-name)
       (re-search-forward "^[ \t]*[^# \t]" nil t)
       (when (< (setq beg (point-min))
-              (setq end (point-at-bol)))
+               (setq end (line-beginning-position)))
        (delete-region beg end)))
     (org-babel-import-elisp-from-file temp-file '(16))))
 
diff --git a/lisp/org/ol-irc.el b/lisp/org/ol-irc.el
index ed8bad5a50..e36c44ff70 100644
--- a/lisp/org/ol-irc.el
+++ b/lisp/org/ol-irc.el
@@ -135,13 +135,13 @@ result is a cons of the filename and search string."
      ;; can we get a '::' part?
      (if (string= erc-line (erc-prompt))
         (progn
-          (goto-char (point-at-bol))
+           (goto-char (line-beginning-position))
           (when (search-backward-regexp "^[^   ]" nil t)
-            (buffer-substring-no-properties (point-at-bol)
-                                            (point-at-eol))))
+             (buffer-substring-no-properties (line-beginning-position)
+                                             (line-end-position))))
        (when (search-backward erc-line nil t)
-        (buffer-substring-no-properties (point-at-bol)
-                                        (point-at-eol)))))))
+         (buffer-substring-no-properties (line-beginning-position)
+                                         (line-end-position)))))))
 
 (defun org-irc-erc-store-link ()
   "Store a link to the IRC log file or the session itself.
@@ -151,7 +151,7 @@ the session itself."
   (require 'erc-log)
   (if org-irc-link-to-logs
       (let* ((erc-line (buffer-substring-no-properties
-                       (point-at-bol) (point-at-eol)))
+                        (line-beginning-position) (line-end-position)))
             (parsed-line (org-irc-erc-get-line-from-log erc-line)))
        (if (erc-logging-enabled nil)
            (progn
diff --git a/lisp/org/ol.el b/lisp/org/ol.el
index a9e613e0d4..4ad1f6d345 100644
--- a/lisp/org/ol.el
+++ b/lisp/org/ol.el
@@ -1481,7 +1481,7 @@ non-nil."
        (let ((end (region-end)))
          (goto-char (region-beginning))
          (set-mark (point))
-         (while (< (point-at-eol) end)
+          (while (< (line-end-position) end)
            (move-end-of-line 1) (activate-mark)
            (let (current-prefix-arg)
              (call-interactively 'org-store-link))
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index a43b083d53..35f19cf03b 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -2113,7 +2113,7 @@ in that string.  If STRING is nil, it will be fetched 
from the beginning
 of the current line."
   (declare (debug t))
   (org-with-gensyms (marker)
-    `(let ((,marker (get-text-property (if ,string 0 (point-at-bol))
+    `(let ((,marker (get-text-property (if ,string 0 (line-beginning-position))
                                       'org-hd-marker ,string)))
        (with-current-buffer (marker-buffer ,marker)
         (save-excursion
@@ -3076,10 +3076,10 @@ s   Search for keywords                 M   Like m, but 
only TODO entries
          (when (eq rmheader t)
            (org-goto-line 1)
            (re-search-forward ":" nil t)
-           (delete-region (match-end 0) (point-at-eol))
+            (delete-region (match-end 0) (line-end-position))
            (forward-char 1)
            (looking-at "-+")
-           (delete-region (match-end 0) (point-at-eol))
+            (delete-region (match-end 0) (line-end-position))
            (move-marker header-end (match-end 0)))
          (goto-char header-end)
          (delete-region (point) (point-max))
@@ -3505,10 +3505,10 @@ This ensures the export commands can easily use it."
   "Mark the line at POS as an agenda structure header."
   (save-excursion
     (goto-char pos)
-    (put-text-property (point-at-bol) (point-at-eol)
+    (put-text-property (line-beginning-position) (line-end-position)
                       'org-agenda-structural-header t)
     (when org-agenda-title-append
-      (put-text-property (point-at-bol) (point-at-eol)
+      (put-text-property (line-beginning-position) (line-end-position)
                         'org-agenda-title-append org-agenda-title-append))))
 
 (defvar org-mobile-creating-agendas) ; defined in org-mobile.el
@@ -3715,7 +3715,7 @@ removed from the entry content.  Currently only 
`planning' is allowed here."
             (while (not (eobp))
               (unless (looking-at "[ \t]*$")
                 (move-to-column ind)
-                (delete-region (point-at-bol) (point)))
+                 (delete-region (line-beginning-position) (point)))
               (beginning-of-line 2))
 
             (run-hooks 'org-agenda-entry-text-cleanup-hook)
@@ -3987,7 +3987,7 @@ agenda display, configure `org-agenda-finalize-hook'."
              (goto-char (point-min))
              (while (equal (forward-line) 0)
                (when (setq mrk (get-text-property (point) 'org-hd-marker))
-                 (put-text-property (point-at-bol) (point-at-eol)
+                  (put-text-property (line-beginning-position) 
(line-end-position)
                                     'tags
                                     (org-with-point-at mrk
                                       (org-get-tags))))))))
@@ -4035,7 +4035,8 @@ agenda display, configure `org-agenda-finalize-hook'."
              (goto-char s)
              (when (equal (org-get-at-bol 'org-hd-marker)
                           org-clock-hd-marker)
-               (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
+                (setq ov (make-overlay (line-beginning-position)
+                                       (1+ (line-end-position))))
                (overlay-put ov 'type 'org-agenda-clocking)
                (overlay-put ov 'face 'org-agenda-clocking)
                (overlay-put ov 'help-echo
@@ -4066,7 +4067,7 @@ agenda display, configure `org-agenda-finalize-hook'."
              b (match-beginning 1)
              e (if (eq org-agenda-fontify-priorities 'cookies)
                    (1+ (match-end 2))
-                 (point-at-eol))
+                  (line-end-position))
              ov (make-overlay b e))
        (overlay-put
         ov 'face
@@ -4168,7 +4169,7 @@ A good way to set it is through options in 
`org-agenda-custom-commands'.")
   "Throw to `:skip' in places that should be skipped.
 Also moves point to the end of the skipped region, so that search can
 continue from there."
-  (let ((p (point-at-bol)) to)
+  (let ((p (line-beginning-position)) to)
     (when (or
           (save-excursion (goto-char p) (looking-at comment-start-skip))
           (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
@@ -4244,7 +4245,7 @@ This check for agenda markers in all agenda buffers 
currently active."
                             m org-agenda-entry-text-maxlines
                             org-agenda-entry-text-leaders))))
     (when (string-match "\\S-" txt)
-      (setq o (make-overlay (point-at-bol) (point-at-eol)))
+      (setq o (make-overlay (line-beginning-position) (line-end-position)))
       (overlay-put o 'evaporate t)
       (overlay-put o 'org-overlay-type 'agenda-entry-content)
       (overlay-put o 'after-string txt))))
@@ -4749,7 +4750,7 @@ is active."
                                  (forward-line -1)
                                  (org-back-to-heading t)))
                      (skip-chars-forward "* ")
-                     (setq beg (point-at-bol)
+                      (setq beg (line-beginning-position)
                            beg1 (point)
                            end (progn
                                  (outline-next-heading)
@@ -4764,8 +4765,8 @@ is active."
                        (goto-char beg)
                        (org-agenda-skip)
                        (setq str (buffer-substring-no-properties
-                                  (point-at-bol)
-                                  (if hdl-only (point-at-eol) end)))
+                                   (line-beginning-position)
+                                   (if hdl-only (line-end-position) end)))
                        (mapc (lambda (wr) (when (string-match wr str)
                                             (goto-char (1- end))
                                             (throw :skip t)))
@@ -4793,7 +4794,7 @@ is active."
                              txt (org-agenda-format-item
                                   ""
                                   (buffer-substring-no-properties
-                                   beg1 (point-at-eol))
+                                    beg1 (line-end-position))
                                   level category tags t))
                        (org-add-props txt props
                          'org-marker marker 'org-hd-marker marker
@@ -5335,7 +5336,7 @@ each date.  It also removes lines that contain only 
whitespace."
                           (abbreviate-file-name buffer-file-name))
                 "")
     'org-agenda-diary-link t
-    'org-marker (org-agenda-new-marker (point-at-bol))))
+    'org-marker (org-agenda-new-marker (line-beginning-position))))
 
 (defun org-diary-default-entry ()
   "Add a dummy entry to the diary.
@@ -5986,7 +5987,7 @@ then those holidays will be skipped."
              clockp (not (or closedp statep))
              state (and statep (match-string 2))
              category (org-get-category (match-beginning 0))
-             timestr (buffer-substring (match-beginning 0) (point-at-eol)))
+              timestr (buffer-substring (match-beginning 0) 
(line-end-position)))
        (when (string-match "\\]" timestr)
          ;; substring should only run to end of time stamp
          (setq rest (substring timestr (match-end 0))
@@ -6044,7 +6045,7 @@ then those holidays will be skipped."
            'type type 'date date
            'undone-face 'org-warning 'done-face 'org-agenda-done)
          (push txt ee))
-       (goto-char (point-at-eol))))
+        (goto-char (line-end-position))))
     (nreverse ee)))
 
 (defun org-agenda-show-clocking-issues ()
@@ -6081,7 +6082,7 @@ See also the user option 
`org-agenda-clock-consistency-checks'."
          (setq issue "No valid clock line") (throw 'next t))
        (org-with-point-at m
          (save-excursion
-           (goto-char (point-at-bol))
+            (goto-char (line-beginning-position))
            (unless (looking-at re)
              (error "No valid Clock line")
              (throw 'next t))
@@ -6127,7 +6128,7 @@ See also the user option 
`org-agenda-clock-consistency-checks'."
       (setq tlend (or te tlend) tlstart (or ts tlstart))
       (when issue
        ;; OK, there was some issue, add an overlay to show the issue
-       (setq ov (make-overlay (point-at-bol) (point-at-eol)))
+        (setq ov (make-overlay (line-beginning-position) (line-end-position)))
        (overlay-put ov 'before-string
                     (concat
                      (org-add-props
@@ -7147,7 +7148,10 @@ The optional argument TYPE tells the agenda type."
        (save-excursion
          (beginning-of-line 1)
          (setq re (org-get-at-bol 'org-todo-regexp))
-         (goto-char (or (text-property-any (point-at-bol) (point-at-eol) 
'org-heading t) (point)))
+          (goto-char (or (text-property-any (line-beginning-position)
+                                            (line-end-position)
+                                            'org-heading t)
+                         (point)))
          (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
            (add-text-properties (match-beginning 0) (match-end 1)
                                 (list 'face (org-get-todo-face 1)))
@@ -7428,7 +7432,7 @@ subtree."
                        (point)
                        (if org-agenda-restriction-lock-highlight-subtree
                            (save-excursion (org-end-of-subtree t t) (point))
-                         (point-at-eol)))
+                          (line-end-position)))
          (move-marker org-agenda-restrict-begin (point))
          (move-marker org-agenda-restrict-end
                       (save-excursion (org-end-of-subtree t t)))
@@ -8254,8 +8258,8 @@ grouptags."
 (defun org-agenda-filter-hide-line (type)
   "If current line is TYPE, hide it in the agenda buffer."
   (let* (buffer-invisibility-spec
-        (beg (max (point-min) (1- (point-at-bol))))
-        (end (point-at-eol)))
+         (beg (max (point-min) (1- (line-beginning-position))))
+         (end (line-end-position)))
     (let ((inhibit-read-only t))
       (add-text-properties
        beg end `(invisible org-filtered org-filter-type ,type)))))
@@ -8887,7 +8891,7 @@ When called with a prefix argument, include all archive 
files as well."
   (interactive "p")
   (let ((col (current-column)))
     (dotimes (_ n)
-      (when (next-single-property-change (point-at-eol) 'org-marker)
+      (when (next-single-property-change (line-end-position) 'org-marker)
        (move-end-of-line 1)
        (goto-char (next-single-property-change (point) 'org-marker))))
     (org-move-to-column col))
@@ -8945,7 +8949,8 @@ When called with a prefix argument, include all archive 
files as well."
        (when (re-search-forward org-complex-heading-regexp nil t)
          (goto-char (match-beginning 4)))))
     (run-hooks 'org-agenda-after-show-hook)
-    (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
+    (and highlight (org-highlight (line-beginning-position)
+                                  (line-end-position)))))
 
 (defvar org-agenda-after-show-hook nil
   "Normal hook run after an item has been shown from the agenda.
@@ -8968,7 +8973,7 @@ deletes the agenda entry and don't move to the next 
entry."
          (level (and (eq org-agenda-loop-over-headlines-in-active-region 
'start-level)
                      (org-get-at-bol 'level))))
       (while (< (point) mend)
-       (let ((ov (make-overlay (point) (point-at-eol))))
+        (let ((ov (make-overlay (point) (line-end-position))))
          (if (not (or all
                       (and match (looking-at-p match))
                       (eq level (org-get-at-bol 'level))))
@@ -9013,8 +9018,8 @@ Pass ARG, FORCE-ARG, DELETE and BODY to 
`org-agenda-do-in-region'."
           (if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
               (setq dbeg (progn (org-back-to-heading t) (point))
                     dend (org-end-of-subtree t t))
-            (setq dbeg (point-at-bol)
-                  dend (min (point-max) (1+ (point-at-eol)))))
+             (setq dbeg (line-beginning-position)
+                   dend (min (point-max) (1+ (line-end-position)))))
           (goto-char dbeg)
           (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
        (when (or (eq t org-agenda-confirm-kill)
@@ -9113,7 +9118,8 @@ If this information is not given, the function uses the 
tree at point."
                     (>= p beg)
                     (< p end))
            (let ((inhibit-read-only t))
-             (delete-region (point-at-bol) (1+ (point-at-eol)))))
+              (delete-region (line-beginning-position)
+                             (1+ (line-end-position)))))
          (beginning-of-line 0))))))
 
 (defun org-agenda-refile (&optional goto rfloc no-update)
@@ -9162,7 +9168,8 @@ It also looks at the text of the entry itself."
   (let* ((marker (or (org-get-at-bol 'org-hd-marker)
                     (org-get-at-bol 'org-marker)))
         (buffer (and marker (marker-buffer marker)))
-        (prefix (buffer-substring (point-at-bol) (point-at-eol)))
+         (prefix (buffer-substring (line-beginning-position)
+                                   (line-end-position)))
         (lkall (and buffer (org-offer-links-in-entry
                             buffer marker arg prefix)))
         (lk0 (car lkall))
@@ -9295,7 +9302,7 @@ if it was hidden in the outline."
   (let ((win (selected-window)))
     (org-agenda-goto t)
     (org-back-to-heading)
-    (set-window-start (selected-window) (point-at-bol))
+    (set-window-start (selected-window) (line-beginning-position))
     (cond
      ((= more 0)
       (org-flag-subtree t)
@@ -9532,7 +9539,8 @@ If FORCE-TAGS is non-nil, the car of it returns the new 
tags."
                  (with-current-buffer (marker-buffer hdmarker)
                    (org-with-wide-buffer
                     (org-agenda-format-item extra newhead level cat tags 
dotime))))
-               ;; pl (text-property-any (point-at-bol) (point-at-eol) 
'org-heading t)
+                ;; pl (text-property-any (line-beginning-position)
+                ;;                       (line-end-position) 'org-heading t)
                undone-face (org-get-at-bol 'undone-face)
                done-face (org-get-at-bol 'done-face))
          (beginning-of-line 1)
@@ -9549,10 +9557,11 @@ If FORCE-TAGS is non-nil, the car of it returns the new 
tags."
              (replace-match new t t)
              (beginning-of-line)
              (when mark (move-overlay mark (point) (+ 2 (point)))))
-           (add-text-properties (point-at-bol) (point-at-eol) props)
+            (add-text-properties (line-beginning-position)
+                                 (line-end-position) props)
            (when fixface
              (add-text-properties
-              (point-at-bol) (point-at-eol)
+               (line-beginning-position) (line-end-position)
               (list 'face
                     (if org-last-todo-state-is-todo
                         undone-face done-face))))
@@ -9560,7 +9569,7 @@ If FORCE-TAGS is non-nil, the car of it returns the new 
tags."
            (beginning-of-line 1))
           (t (error "Line update did not work")))
          (save-restriction
-           (narrow-to-region (point-at-bol) (point-at-eol))
+            (narrow-to-region (line-beginning-position) (line-end-position))
            (org-agenda-finalize)))
        (beginning-of-line 0)))))
 
@@ -9791,7 +9800,8 @@ When called programmatically, FORCE-DIRECTION can be 
`set', `up',
            (setq arg (- today cdate))))
        (org-timestamp-change arg (or what 'day))
        (when (and (org-at-date-range-p)
-                  (re-search-backward org-tr-regexp-both (point-at-bol)))
+                   (re-search-backward org-tr-regexp-both
+                                       (line-beginning-position)))
          (let ((end org-last-changed-timestamp))
            (org-timestamp-change arg (or what 'day))
            (setq org-last-changed-timestamp
@@ -9846,7 +9856,7 @@ When called programmatically, FORCE-DIRECTION can be 
`set', `up',
               (length stamp))
            t)
           (add-text-properties
-          (1- (point)) (point-at-eol)
+           (1- (point)) (line-end-position)
           (list 'display (org-add-props stamp nil
                            'face '(secondary-selection default))))
          (beginning-of-line 1))
@@ -9990,13 +10000,13 @@ buffer, display it in another window."
     (if (equal (buffer-name) "*Calendar*")
        (setq d1 (calendar-cursor-to-date t)
              d2 (car calendar-mark-ring))
-      (setq dp1 (get-text-property (point-at-bol) 'day))
+      (setq dp1 (get-text-property (line-beginning-position) 'day))
       (unless dp1 (user-error "No date defined in current line"))
       (setq d1 (calendar-gregorian-from-absolute dp1)
            d2 (and (ignore-errors (mark))
                    (save-excursion
                      (goto-char (mark))
-                     (setq dp2 (get-text-property (point-at-bol) 'day)))
+                      (setq dp2 (get-text-property (line-beginning-position) 
'day)))
                    (calendar-gregorian-from-absolute dp2))))
     (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree")
     (setq char (read-char-exclusive))
@@ -10319,7 +10329,7 @@ This is a command that has to be installed in 
`calendar-mode-map'."
 
 (defun org-agenda-bulk-marked-p ()
   "Non-nil when current entry is marked for bulk action."
-  (eq (get-char-property (point-at-bol) 'type)
+  (eq (get-char-property (line-beginning-position) 'type)
       'org-marked-entry-overlay))
 
 (defun org-agenda-bulk-mark (&optional arg)
@@ -10344,7 +10354,8 @@ When ARG is greater than one mark ARG lines."
        (unless (org-agenda-bulk-marked-p)
          (unless m (user-error "Nothing to mark at point"))
          (push m org-agenda-bulk-marked-entries)
-         (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
+          (setq ov (make-overlay (line-beginning-position)
+                                 (+ 2 (line-beginning-position))))
          (org-overlay-display ov (concat org-agenda-bulk-mark-char " ")
                               (org-get-todo-face "TODO")
                               'evaporate)
@@ -10388,7 +10399,7 @@ When ARG is greater than one mark ARG lines."
       (org-agenda-bulk-unmark-all)
     (cond ((org-agenda-bulk-marked-p)
           (org-agenda-bulk-remove-overlays
-           (point-at-bol) (+ 2 (point-at-bol)))
+            (line-beginning-position) (+ 2 (line-beginning-position)))
           (setq org-agenda-bulk-marked-entries
                 (delete (org-get-at-bol 'org-hd-marker)
                         org-agenda-bulk-marked-entries))
@@ -10768,8 +10779,8 @@ tag and note")))))
     (message "Entry unflagged")))
 
 (defun org-agenda-get-any-marker (&optional pos)
-  (or (get-text-property (or pos (point-at-bol)) 'org-hd-marker)
-      (get-text-property (or pos (point-at-bol)) 'org-marker)))
+  (or (get-text-property (or pos (line-beginning-position)) 'org-hd-marker)
+      (get-text-property (or pos (line-beginning-position)) 'org-marker)))
 
 ;;; Appointment reminders
 
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 2fd9a9c74d..abf4f9610e 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -1447,7 +1447,7 @@ Of course, if exact position has been required, just put 
it there."
                (if (org-at-table-p)
                    (save-excursion
                      (org-table-goto-line (nth 1 where))
-                     (point-at-bol))
+                      (line-beginning-position))
                  (point))))))
     (with-current-buffer (buffer-base-buffer (current-buffer))
       (org-with-point-at pos
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index fdc9818a5a..38e0826075 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1317,7 +1317,7 @@ the default behavior."
       ;; Clock in at which position?
       (setq target-pos
            (if (and (eobp) (not (org-at-heading-p)))
-               (point-at-bol 0)
+                (line-beginning-position 0)
              (point)))
       (save-excursion
        (when (and selected-task (marker-buffer selected-task))
@@ -1666,7 +1666,7 @@ to, overriding the existing value of 
`org-clock-out-switch-to-state'."
              (setq ts (match-string 2))
            (if fail-quietly (throw 'exit nil) (error "Clock start time is 
gone")))
          (goto-char (match-end 0))
-         (delete-region (point) (point-at-eol))
+          (delete-region (point) (line-end-position))
          (insert "--")
          (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
          (setq s (org-time-convert-to-integer
@@ -1804,7 +1804,7 @@ Optional argument N tells to change by that many units."
     (goto-char org-clock-marker)
     (if (looking-back (concat "^[ \t]*" org-clock-string ".*")
                      (line-beginning-position))
-       (progn (delete-region (1- (point-at-bol)) (point-at-eol))
+        (progn (delete-region (1- (line-beginning-position)) 
(line-end-position))
               (org-remove-empty-drawer-at (point)))
       (message "Clock gone, cancel the timer anyway")
       (sit-for 2)))
@@ -1946,7 +1946,7 @@ PROPNAME lets you set a custom text property instead of 
:org-clock-minutes."
                               (aset ltimes l (+ (aref ltimes l) t1))))
                  (setq time (aref ltimes level))
                  (goto-char (match-beginning 0))
-                 (put-text-property (point) (point-at-eol)
+                  (put-text-property (point) (line-end-position)
                                     (or propname :org-clock-minutes) time)
                  (when headline-filter
                    (save-excursion
@@ -2114,7 +2114,7 @@ fontified, and then returned."
     (forward-line 2)
     (buffer-substring (point) (progn
                                (re-search-forward "^[ \t]*#\\+END" nil t)
-                               (point-at-bol)))))
+                                (line-beginning-position)))))
 
 ;;;###autoload
 (defun org-clock-report (&optional arg)
@@ -2390,7 +2390,7 @@ the currently selected interval size."
   (setq n (prefix-numeric-value n))
   (and (memq dir '(left down)) (setq n (- n)))
   (save-excursion
-    (goto-char (point-at-bol))
+    (goto-char (line-beginning-position))
     (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ 
\t]+\\(\\S-+\\)"))
        (user-error "Line needs a :block definition before this command works")
       (let* ((b (match-beginning 1)) (e (match-end 1))
@@ -3030,7 +3030,7 @@ Otherwise, return nil."
         ((not (match-end 2))
          (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
                     (> org-clock-marker (point))
-                    (<= org-clock-marker (point-at-eol)))
+                     (<= org-clock-marker (line-end-position)))
            ;; The clock is running here
            (setq org-clock-start-time
                  (org-time-string-to-time (match-string 1)))
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 085e32d677..15f0daa91a 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -1028,7 +1028,7 @@ To get rid of the restriction, use 
`\\[org-agenda-remove-restriction-lock]'."
   (require 'org-agenda)
   (let (p m tp np dir txt)
     (cond
-     ((setq p (text-property-any (point-at-bol) (point-at-eol)
+     ((setq p (text-property-any (line-beginning-position) (line-end-position)
                                 'org-imenu t))
       (setq m (get-text-property p 'org-imenu-marker))
       (with-current-buffer (marker-buffer m)
@@ -1038,7 +1038,7 @@ To get rid of the restriction, use 
`\\[org-agenda-remove-restriction-lock]'."
                         (overlays-at (point))))
            (org-agenda-remove-restriction-lock 'noupdate)
          (org-agenda-set-restriction-lock 'subtree))))
-     ((setq p (text-property-any (point-at-bol) (point-at-eol)
+     ((setq p (text-property-any (line-beginning-position) (line-end-position)
                                 'speedbar-function 'speedbar-find-file))
       (setq tp (previous-single-property-change
                (1+ p) 'speedbar-function)
@@ -1055,7 +1055,7 @@ To get rid of the restriction, use 
`\\[org-agenda-remove-restriction-lock]'."
        (org-agenda-set-restriction-lock 'file)))
      (t (user-error "Don't know how to restrict Org mode agenda")))
     (move-overlay org-speedbar-restriction-lock-overlay
-                 (point-at-bol) (point-at-eol))
+                  (line-beginning-position) (line-end-position))
     (setq current-prefix-arg nil)
     (org-agenda-maybe-redo)))
 
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 20b5b03039..4c018062af 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -2205,7 +2205,7 @@ CDR is a plist containing `:key', `:value', `:begin', 
`:end',
          (key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):")
                      (upcase (match-string-no-properties 1))))
          (value (org-trim (buffer-substring-no-properties
-                           (match-end 0) (point-at-eol))))
+                            (match-end 0) (line-end-position))))
          (pos-before-blank (progn (forward-line) (point)))
          (end (progn (skip-chars-forward " \r\t\n" limit)
                      (if (eobp) (point) (line-beginning-position)))))
@@ -4273,7 +4273,7 @@ This function assumes that current major mode is 
`org-mode'."
     (goto-char (point-min))
     (org-skip-whitespace)
     (org-element--parse-elements
-     (point-at-bol) (point-max)
+     (line-beginning-position) (point-max)
      ;; Start in `first-section' mode so text before the first
      ;; headline belongs to a section.
      'first-section nil granularity visible-only (list 'org-data nil))))
@@ -6207,12 +6207,12 @@ end of ELEM-A."
           (end-A (save-excursion
                    (goto-char (org-element-property :end elem-A))
                    (skip-chars-backward " \r\t\n")
-                   (point-at-eol)))
+                    (line-end-position)))
           (beg-B (org-element-property :begin elem-B))
           (end-B (save-excursion
                    (goto-char (org-element-property :end elem-B))
                    (skip-chars-backward " \r\t\n")
-                   (point-at-eol)))
+                    (line-end-position)))
           ;; Store inner overlays responsible for visibility status.
           ;; We also need to store their boundaries as they will be
           ;; removed from buffer.
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index bc5175b163..3bf4307f4a 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -426,7 +426,7 @@ current time."
        (moment (org-time-subtract nil
                                   (* 3600 org-extend-today-until))))
     (save-excursion
-      (goto-char (if line (point-at-bol) (point-min)))
+      (goto-char (if line (line-beginning-position) (point-min)))
       (while (not (eobp))
        (let ((habit (get-text-property (point) 'org-habit-p))
               (invisible-prop (get-text-property (point) 'invisible)))
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index 581370bb53..2cbbf7f7ac 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.el
@@ -238,7 +238,7 @@ going below `org-inlinetask-min-level'."
          (setq beg (point))
          (replace-match down-task nil t nil 1)
          (org-inlinetask-goto-end)
-         (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+          (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
               (beginning-of-line)
             (forward-line -1))
          (unless (= (point) beg)
@@ -264,7 +264,7 @@ If the task has an end part, also demote it."
        (setq beg (point))
        (replace-match down-task nil t nil 1)
        (org-inlinetask-goto-end)
-        (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+        (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
             (beginning-of-line)
           (forward-line -1))
        (unless (= (point) beg)
@@ -312,7 +312,7 @@ If the task has an end part, also demote it."
               (if (bolp) (1- (point)) (point))))
        (start (save-excursion
                 (org-inlinetask-goto-beginning)
-                (point-at-eol))))
+                 (line-end-position))))
     (cond
      ;; Nothing to show/hide.
      ((= end start))
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index da309f8c6d..978e36ed61 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -517,7 +517,7 @@ Contexts `block' and `invalid' refer to 
`org-list-forbidden-blocks'."
                   (and (not (looking-at beg-re))
                        (not (looking-at end-re))
                        (setq beg (and (re-search-backward beg-re lim-up t)
-                                      (1+ (point-at-eol))))
+                                       (1+ (line-end-position))))
                        (setq end (or (and (re-search-forward end-re lim-down t)
                                           (1- (match-beginning 0)))
                                      lim-down))
@@ -528,12 +528,12 @@ Contexts `block' and `invalid' refer to 
`org-list-forbidden-blocks'."
           (when (save-excursion
                   (and (not (looking-at block-re))
                        (setq beg (and (re-search-backward block-re lim-up t)
-                                      (1+ (point-at-eol))))
+                                       (1+ (line-end-position))))
                        (looking-at "^[ \t]*#\\+begin_\\(\\S-+\\)")
                        (setq type (downcase (match-string 1)))
                        (goto-char beg)
                        (setq end (or (and (re-search-forward block-re lim-down 
t)
-                                          (1- (point-at-bol)))
+                                           (1- (line-beginning-position)))
                                      lim-down))
                        (>= end pos)
                        (equal (downcase (match-string 1)) "end")))
@@ -547,7 +547,7 @@ Contexts `block' and `invalid' refer to 
`org-list-forbidden-blocks'."
                             (end-re (concat beg-re "END[ \t]*$")))
                        (and (not (looking-at "^\\*+"))
                             (setq beg (and (re-search-backward beg-re lim-up t)
-                                           (1+ (point-at-eol))))
+                                            (1+ (line-end-position))))
                             (not (looking-at end-re))
                             (setq end (and (re-search-forward end-re lim-down 
t)
                                            (1- (match-beginning 0))))
@@ -569,7 +569,7 @@ values are:
 6. position at item end.
 
 Thus the following list, where numbers in parens are
-point-at-bol:
+line-beginning-position:
 
 - [X] first item                             (1)
   1. sub-item 1                              (18)
@@ -617,7 +617,7 @@ Assume point is at an item."
            ;; Ensure list ends at the first blank line.
            (lambda ()
              (skip-chars-backward " \r\t\n")
-             (min (1+ (point-at-eol)) lim-down))))
+              (min (1+ (line-end-position)) lim-down))))
       ;; 1. Read list from starting item to its beginning, and save
       ;;    top item position and indentation in BEG-CELL.  Also store
       ;;    ending position of items in END-LST.
@@ -872,7 +872,7 @@ Point returned is at end of line."
   (save-excursion
     (goto-char (org-list-get-item-end item struct))
     (skip-chars-backward " \r\t\n")
-    (point-at-eol)))
+    (line-end-position)))
 
 (defun org-list-get-parent (item struct parents)
   "Return parent of ITEM or nil.
@@ -1182,7 +1182,7 @@ some heuristics to guess the result."
           (lambda ()
             ;; Count blank lines above beginning of line.
             (save-excursion
-              (count-lines (goto-char (point-at-bol))
+               (count-lines (goto-char (line-beginning-position))
                            (progn (skip-chars-backward " \r\t\n")
                                   (forward-line)
                                   (point)))))))
@@ -1287,7 +1287,7 @@ This function modifies STRUCT."
                 ;; must be removed, or they will be left, stacking up
                 ;; after the list.
                 (when (< item-end pos)
-                  (delete-region (1- item-end) (point-at-eol)))
+                   (delete-region (1- item-end) (line-end-position)))
                 (skip-chars-backward " \r\t\n")
                 ;; Cut position is after any blank on the line.
                 (save-excursion
@@ -1364,7 +1364,7 @@ STRUCT is the list structure."
                  (save-excursion
                    (goto-char item)
                    (skip-chars-backward " \r\t\n")
-                   (min (1+ (point-at-eol)) (point-max)))
+                    (min (1+ (line-end-position)) (point-max)))
                item)))
     ;; Remove item from buffer.
     (delete-region beg end)
@@ -1441,7 +1441,7 @@ This function returns, destructively, the new list 
structure."
                      (setq dest (org-list-get-list-end item struct prevs))
                      (save-excursion
                        (goto-char (org-list-get-last-item item struct prevs))
-                       (point-at-eol)))
+                        (line-end-position)))
                     ((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest))
                      (let* ((all (org-list-get-all-items item struct prevs))
                             (len (length all))
@@ -1453,7 +1453,7 @@ This function returns, destructively, the new list 
structure."
                          (save-excursion
                            (goto-char
                             (org-list-get-last-item item struct prevs))
-                           (point-at-eol)))))
+                            (line-end-position)))))
                     (t dest)))
         (org-M-RET-may-split-line nil)
         ;; Store inner overlays (to preserve visibility).
@@ -1880,7 +1880,7 @@ Initial position of cursor is restored after the changes."
                    (insert (concat new-box (unless counterp " "))))))
              ;; c.  Indent item to appropriate column.
              (unless (= new-ind old-ind)
-               (delete-region (goto-char (point-at-bol))
+                (delete-region (goto-char (line-beginning-position))
                               (progn (skip-chars-forward " \t") (point)))
                (indent-to new-ind))))))
     ;; 1. First get list of items and position endings.  We maintain
@@ -2010,7 +2010,7 @@ Sublists of the list are skipped.  Cursor is always at the
 beginning of the item."
   (let* ((struct (org-list-struct))
         (prevs (org-list-prevs-alist struct))
-        (item (copy-marker (point-at-bol)))
+         (item (copy-marker (line-beginning-position)))
         (all (org-list-get-all-items (marker-position item) struct prevs))
         (value init-value))
     (dolist (e (nreverse all))
@@ -2147,10 +2147,10 @@ the item, so this really moves item trees."
   (interactive)
   (unless (org-at-item-p) (error "Not at an item"))
   (let* ((col (current-column))
-        (item (point-at-bol))
+         (item (line-beginning-position))
         (struct (org-list-struct))
         (prevs (org-list-prevs-alist struct))
-        (next-item (org-list-get-next-item (point-at-bol) struct prevs)))
+         (next-item (org-list-get-next-item (line-beginning-position) struct 
prevs)))
     (unless (or next-item org-list-use-circular-motion)
       (user-error "Cannot move this item further down"))
     (if (not next-item)
@@ -2168,10 +2168,10 @@ the item, so this really moves item trees."
   (interactive)
   (unless (org-at-item-p) (error "Not at an item"))
   (let* ((col (current-column))
-        (item (point-at-bol))
+         (item (line-beginning-position))
         (struct (org-list-struct))
         (prevs (org-list-prevs-alist struct))
-        (prev-item (org-list-get-prev-item (point-at-bol) struct prevs)))
+         (prev-item (org-list-get-prev-item (line-beginning-position) struct 
prevs)))
     (unless (or prev-item org-list-use-circular-motion)
       (user-error "Cannot move this item further up"))
     (if (not prev-item)
@@ -2312,7 +2312,7 @@ is an integer, 0 means `-', 1 means `+' etc.  If WHICH is
           (old-struct (copy-tree struct))
           (cbox (org-list-get-checkbox cpos struct))
            (prevs (org-list-prevs-alist struct))
-          (start (org-list-get-list-begin (point-at-bol) struct prevs))
+           (start (org-list-get-list-begin (line-beginning-position) struct 
prevs))
           (new (unless (and cbox (equal arg '(4)) (equal start cpos))
                  "[ ]")))
       (dolist (pos (org-list-get-all-items
@@ -2372,7 +2372,7 @@ subtree, ignoring planning line and any drawer following 
it."
                (let ((limit (region-end)))
                  (goto-char (region-beginning))
                  (if (org-list-search-forward (org-item-beginning-re) limit t)
-                     (setq lim-up (point-at-bol))
+                      (setq lim-up (line-beginning-position))
                    (error "No item in region"))
                  (setq lim-down (copy-marker limit))))
               ((org-at-heading-p)
@@ -2381,14 +2381,14 @@ subtree, ignoring planning line and any drawer 
following it."
                (let ((limit (save-excursion (outline-next-heading) (point))))
                  (org-end-of-meta-data t)
                  (if (org-list-search-forward (org-item-beginning-re) limit t)
-                     (setq lim-up (point-at-bol))
+                      (setq lim-up (line-beginning-position))
                    (error "No item in subtree"))
                  (setq lim-down (copy-marker limit))))
               ;; Just one item: set SINGLEP flag.
               ((org-at-item-p)
                (setq singlep t)
-               (setq lim-up (point-at-bol)
-                     lim-down (copy-marker (point-at-eol))))
+                (setq lim-up (line-beginning-position)
+                      lim-down (copy-marker (line-end-position))))
               (t (error "Not at an item or heading, and no active region"))))
             ;; Determine the checkbox going to be applied to all items
             ;; within bounds.
@@ -2636,7 +2636,7 @@ Return t if successful."
           ;; Are we going to move the whole list?
           (specialp
            (and (not regionp)
-                (= top (point-at-bol))
+                 (= top (line-beginning-position))
                 (cdr (assq 'indent org-list-automatic-rules))
                 (if no-subtree
                     (user-error
@@ -2650,12 +2650,12 @@ Return t if successful."
            (progn
              (set-marker org-last-indent-begin-marker rbeg)
              (set-marker org-last-indent-end-marker rend))
-         (set-marker org-last-indent-begin-marker (point-at-bol))
+          (set-marker org-last-indent-begin-marker (line-beginning-position))
          (set-marker org-last-indent-end-marker
                      (cond
                       (specialp (org-list-get-bottom-point struct))
-                      (no-subtree (1+ (point-at-bol)))
-                      (t (org-list-get-item-end (point-at-bol) struct))))))
+                       (no-subtree (1+ (line-beginning-position)))
+                       (t (org-list-get-item-end (line-beginning-position) 
struct))))))
       (let* ((beg (marker-position org-last-indent-begin-marker))
             (end (marker-position org-last-indent-end-marker)))
        (cond
@@ -2893,8 +2893,8 @@ function is being called interactively."
   (let* ((case-func (if with-case 'identity 'downcase))
          (struct (org-list-struct))
          (prevs (org-list-prevs-alist struct))
-        (start (org-list-get-list-begin (point-at-bol) struct prevs))
-        (end (org-list-get-list-end (point-at-bol) struct prevs))
+         (start (org-list-get-list-begin (line-beginning-position) struct 
prevs))
+         (end (org-list-get-list-end (line-beginning-position) struct prevs))
         (sorting-type
          (or sorting-type
              (progn
@@ -2939,21 +2939,21 @@ function is being called interactively."
                   ((= dcst ?n)
                    (string-to-number
                     (org-sort-remove-invisible
-                     (buffer-substring (match-end 0) (point-at-eol)))))
+                      (buffer-substring (match-end 0) (line-end-position)))))
                   ((= dcst ?a)
                    (funcall case-func
                             (org-sort-remove-invisible
                              (buffer-substring
-                              (match-end 0) (point-at-eol)))))
+                               (match-end 0) (line-end-position)))))
                   ((= dcst ?t)
                    (cond
                     ;; If it is a timer list, convert timer to seconds
                     ((org-at-item-timer-p)
                      (org-timer-hms-to-secs (match-string 1)))
                     ((or (save-excursion
-                           (re-search-forward org-ts-regexp (point-at-eol) t))
+                            (re-search-forward org-ts-regexp 
(line-end-position) t))
                          (save-excursion (re-search-forward org-ts-regexp-both
-                                                            (point-at-eol) t)))
+                                                             
(line-end-position) t)))
                      (org-time-string-to-seconds (match-string 0)))
                     (t (float-time now))))
                   ((= dcst ?x) (or (and (stringp (match-string 1))
@@ -3026,14 +3026,14 @@ With a prefix argument ARG, change the region in a 
single item."
           (save-excursion
             (goto-char pos)
             (skip-chars-forward " \r\t\n")
-            (point-at-bol))))
+             (line-beginning-position))))
        beg end)
     ;; Determine boundaries of changes.
     (if (org-region-active-p)
        (setq beg (funcall skip-blanks (region-beginning))
              end (copy-marker (region-end)))
-      (setq beg (point-at-bol)
-           end (copy-marker (point-at-eol))))
+      (setq beg (line-beginning-position)
+            end (copy-marker (line-end-position))))
     ;; Depending on the starting line, choose an action on the text
     ;; between BEG and END.
     (org-with-limited-levels
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index bb0562dde0..cf0eb48f2d 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -1124,11 +1124,11 @@ the value in cadr."
 
 (defsubst org-get-at-bol (property)
   "Get text property PROPERTY at the beginning of line."
-  (get-text-property (point-at-bol) property))
+  (get-text-property (line-beginning-position) property))
 
 (defun org-get-at-eol (property n)
   "Get text property PROPERTY at the end of line less N characters."
-  (get-text-property (- (point-at-eol) n) property))
+  (get-text-property (- (line-end-position) n) property))
 
 (defun org-find-text-property-in-string (prop s)
   "Return the first non-nil value of property PROP in string S."
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index 5cfaa7fe0a..6f0a60125c 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -617,7 +617,7 @@ The table of checksums is written to the file 
mobile-checksums."
         ((looking-at "[ \t]*$")) ; keep empty lines
         ((looking-at "=+$")
          ;; remove underlining
-         (delete-region (point) (point-at-eol)))
+          (delete-region (point) (line-end-position)))
         ((get-text-property (point) 'org-agenda-structural-header)
          (setq in-date nil)
          (setq app (get-text-property (point) 'org-agenda-title-append))
@@ -637,14 +637,14 @@ The table of checksums is written to the file 
mobile-checksums."
                      (get-text-property (point) 'org-marker)))
          (setq sexp (member (get-text-property (point) 'type)
                             '("diary" "sexp")))
-         (if (setq pl (text-property-any (point) (point-at-eol) 'org-heading 
t))
+          (if (setq pl (text-property-any (point) (line-end-position) 
'org-heading t))
              (progn
                (setq prefix (org-trim (buffer-substring
                                        (point) pl))
                      line (org-trim (buffer-substring
                                      pl
-                                     (point-at-eol))))
-               (delete-region (point-at-bol) (point-at-eol))
+                                      (line-end-position))))
+                (delete-region (line-beginning-position) (line-end-position))
                (insert line "<before>" prefix "</before>")
                (beginning-of-line 1))
            (and (looking-at "[ \t]+") (replace-match "")))
@@ -857,7 +857,7 @@ If BEG and END are given, only do this in that region."
            (org-mobile-timestamp-buffer (marker-buffer id-pos))
            (push (marker-buffer id-pos) buf-list))
          (unless (markerp id-pos)
-           (goto-char (+ 2 (point-at-bol)))
+            (goto-char (+ 2 (line-beginning-position)))
            (if (stringp id-pos)
                (insert id-pos " ")
              (insert "BAD REFERENCE "))
@@ -1093,7 +1093,7 @@ be returned that indicates what went wrong."
       (org-archive-to-archive-sibling))
 
      ((eq what 'body)
-      (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
+      (setq current (buffer-substring (min (1+ (line-end-position)) 
(point-max))
                                      (save-excursion (outline-next-heading)
                                                      (point))))
       (if (not (string-match "\\S-" current)) (setq current nil))
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index a590ff87f2..aa4c20050f 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -184,7 +184,7 @@ Changing this variable requires a restart of Emacs to get 
activated."
 (defun org-mouse-re-search-line (regexp)
   "Search the current line for a given regular expression."
   (beginning-of-line)
-  (re-search-forward regexp (point-at-eol) t))
+  (re-search-forward regexp (line-end-position) t))
 
 (defun org-mouse-end-headline ()
   "Go to the end of current headline (ignoring tags)."
@@ -574,7 +574,7 @@ This means, between the beginning of line and the point."
      (insert "+ "))
     (:end                              ; insert text here
      (skip-chars-backward " \t")
-     (kill-region (point) (point-at-eol))
+     (kill-region (point) (line-end-position))
      (unless (looking-back org-mouse-punctuation (line-beginning-position))
        (insert (concat org-mouse-punctuation " ")))))
   (insert text)
@@ -985,7 +985,7 @@ This means, between the beginning of line and the point."
 (defun org-mouse-do-remotely (command)
   ;;  (org-agenda-check-no-diary)
   (when (get-text-property (point) 'org-marker)
-    (let* ((anticol (- (point-at-eol) (point)))
+    (let* ((anticol (- (line-end-position) (point)))
           (marker (get-text-property (point) 'org-marker))
           (buffer (marker-buffer marker))
           (pos (marker-position marker))
@@ -1009,7 +1009,7 @@ This means, between the beginning of line and the point."
                     (org-flag-heading nil)))   ; show the next heading
              (org-back-to-heading)
              (setq marker (point-marker))
-             (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
+              (goto-char (max (line-beginning-position) (- (line-end-position) 
anticol)))
              (funcall command)
              (message "_cmd: %S" org-mouse-cmd)
              (message "this-command: %S" this-command)
diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el
index 71d00a7a22..3b3344b270 100644
--- a/lisp/org/org-refile.el
+++ b/lisp/org/org-refile.el
@@ -465,9 +465,9 @@ prefix argument (`C-u C-u C-u C-c C-w')."
        (unless (or (org-kill-is-subtree-p
                     (buffer-substring region-start region-end))
                    (prog1 org-refile-active-region-within-subtree
-                     (let ((s (point-at-eol)))
+                      (let ((s (line-end-position)))
                        (org-toggle-heading)
-                       (setq region-end (+ (- (point-at-eol) s) region-end)))))
+                        (setq region-end (+ (- (line-end-position) s) 
region-end)))))
          (user-error "The region is not a (sequence of) subtree(s)")))
       (if (equal arg '(16))
          (org-refile-goto-last-stored)
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index c301bc6af1..9b692d0973 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
diff --git a/lisp/org/org.el b/lisp/org/org.el
index df708a2159..9facbed04d 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5971,7 +5971,7 @@ and subscripts."
           (emph-p (get-text-property mpos 'org-emphasis))
           (link-p (get-text-property mpos 'mouse-face))
           (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
-      (goto-char (point-at-bol))
+      (goto-char (line-beginning-position))
       (setq table-p (looking-at-p org-table-dataline-regexp)
            comment-p (looking-at-p "^[ \t]*#[ +]"))
       (goto-char pos)
@@ -6443,7 +6443,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
                (and (memq org-cycle-emulate-tab '(white whitestart))
                     (save-excursion (beginning-of-line 1) (looking-at "[ 
\t]*"))
                     (or (and (eq org-cycle-emulate-tab 'white)
-                             (= (match-end 0) (point-at-eol)))
+                              (= (match-end 0) (line-end-position)))
                         (and (eq org-cycle-emulate-tab 'whitestart)
                              (>= (match-end 0) pos)))))
            (call-interactively (global-key-binding (kbd "TAB"))))
@@ -6498,7 +6498,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
          (progn
            (beginning-of-line)
            (setq struct (org-list-struct))
-           (setq eoh (point-at-eol))
+            (setq eoh (line-end-position))
            (setq eos (org-list-get-item-end-before-blank (point) struct))
            (setq has-children (org-list-has-child-p (point) struct)))
        (org-back-to-heading)
@@ -6545,7 +6545,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
       (unless (org-before-first-heading-p)
        (run-hook-with-args 'org-pre-cycle-hook 'children))
       (if (org-at-item-p)
-         (org-list-set-item-visibility (point-at-bol) struct 'children)
+          (org-list-set-item-visibility (line-beginning-position) struct 
'children)
        (org-show-entry)
        (org-with-limited-levels (org-show-children))
        (org-show-set-visibility 'tree)
@@ -6729,7 +6729,7 @@ This function is the default value of the hook 
`org-cycle-hook'."
                     (org-get-next-sibling)
                     (org-get-next-sibling))
                (if (org-at-heading-p)
-                   (point-at-eol)
+                    (line-end-position)
                  (point))))
         (level (looking-at "\\*+"))
         (re (when level (concat "^" (regexp-quote (match-string 0)) " "))))
@@ -7147,7 +7147,7 @@ This is a list with the following elements:
   "Get the entry text, after heading, entire subtree."
   (save-excursion
     (org-back-to-heading t)
-    (buffer-substring (point-at-bol 2) (org-end-of-subtree t))))
+    (buffer-substring (line-beginning-position 2) (org-end-of-subtree t))))
 
 (defun org-edit-headline (&optional heading)
   "Edit the current headline.
@@ -8402,7 +8402,7 @@ function is being called interactively."
                    (org-time-string-to-seconds (match-string 1))
                  (float-time now))))
             ((= dcst ?p)
-             (if (re-search-forward org-priority-regexp (point-at-eol) t)
+              (if (re-search-forward org-priority-regexp (line-end-position) t)
                  (string-to-char (match-string 2))
                org-priority-default))
             ((= dcst ?r)
@@ -9244,7 +9244,8 @@ If not found, stay at current position and return nil."
 (defun org-create-dblock (plist)
   "Create a dynamic block section, with parameters taken from PLIST.
 PLIST must contain a :name entry which is used as the name of the block."
-  (when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol)))
+  (when (string-match "\\S-" (buffer-substring (line-beginning-position)
+                                               (line-end-position)))
     (end-of-line 1)
     (newline))
   (let ((col (current-column))
@@ -9908,7 +9909,8 @@ When called through ELisp, arg is also interpreted in the 
following way:
            (run-hooks 'org-after-todo-state-change-hook)
            (when (and arg (not (member org-state org-done-keywords)))
              (setq head (org-get-todo-sequence-head org-state)))
-           (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head 
head)
+            (put-text-property (line-beginning-position)
+                               (line-end-position) 'org-todo-head head)
            ;; Do we need to trigger a repeat?
            (when now-done-p
              (when (boundp 'org-agenda-headline-snapshot-before-repeat)
@@ -10121,7 +10123,7 @@ all statistics cookies in the buffer."
              (beginning-of-line 1)
              (while (re-search-forward
                      "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
-                     (point-at-eol) t)
+                      (line-end-position) t)
                (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
        (goto-char pos)
        (move-marker pos nil)))))
@@ -10168,7 +10170,7 @@ statistics everywhere."
                             (downcase (or (org-entry-get nil "COOKIE_DATA")
                                           "")))))
            (throw 'exit nil))
-         (while (re-search-forward box-re (point-at-eol) t)
+          (while (re-search-forward box-re (line-end-position) t)
            (setq cnt-all 0 cnt-done 0 cookie-present t)
            (setq is-percent (match-end 2) checkbox-beg (match-beginning 0))
            (save-match-data
@@ -10277,10 +10279,11 @@ right sequence."
   (let (p)
     (cond
      ((not kwd)
-      (or (get-text-property (point-at-bol) 'org-todo-head)
+      (or (get-text-property (line-beginning-position) 'org-todo-head)
          (progn
-           (setq p (next-single-property-change (point-at-bol) 'org-todo-head
-                                                nil (point-at-eol)))
+            (setq p (next-single-property-change (line-beginning-position)
+                                                 'org-todo-head
+                                                 nil (line-end-position)))
            (get-text-property p 'org-todo-head))))
      ((not (member kwd org-todo-keywords-1))
       (car org-todo-keywords-1))
@@ -10736,13 +10739,13 @@ nil."
       (outline-next-heading)
       (while (re-search-backward re beg t)
        (replace-match "")
-       (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point)))
+        (if (and (string-match "\\S-" (buffer-substring 
(line-beginning-position) (point)))
                 (equal (char-before) ?\ ))
            (backward-delete-char 1)
          (when (string-match "^[ \t]*$" (buffer-substring
-                                         (point-at-bol) (point-at-eol)))
-           (delete-region (point-at-bol)
-                          (min (point-max) (1+ (point-at-eol))))))))))
+                                          (line-beginning-position) 
(line-end-position)))
+            (delete-region (line-beginning-position)
+                           (min (point-max) (1+ (line-end-position))))))))))
 
 (defvar org-time-was-given) ; dynamically scoped parameter
 (defvar org-end-time-was-given) ; dynamically scoped parameter
@@ -12216,7 +12219,7 @@ Also insert END."
 (defun org-fast-tag-show-exit (flag)
   (save-excursion
     (org-goto-line 3)
-    (when (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
+    (when (re-search-forward "[ \t]+Next change exits" (line-end-position) t)
       (replace-match ""))
     (when flag
       (end-of-line 1)
@@ -12263,7 +12266,7 @@ Returns the new tags string, or nil to not change the 
current settings."
          (setq ov-start (match-beginning 1)
                ov-end (match-end 1)
                ov-prefix "")
-       (setq ov-start (1- (point-at-eol))
+        (setq ov-start (1- (line-end-position))
              ov-end (1+ ov-start))
        (skip-chars-forward "^\n\r")
        (setq ov-prefix
@@ -12422,7 +12425,7 @@ Returns the new tags string, or nil to not change the 
current settings."
                  (when (eq exit-after-next 'now) (throw 'exit t))
                  (goto-char (point-min))
                  (beginning-of-line 2)
-                 (delete-region (point) (point-at-eol))
+                  (delete-region (point) (line-end-position))
                  (org-fast-tag-insert "Current" current c-face)
                  (org-set-current-tags-overlay current ov-prefix)
                  (let ((tag-re (concat "\\[.\\] \\(" org-tag-re "\\)")))
@@ -14082,7 +14085,8 @@ user."
                            (max (point-min) (- (point) 4)) (point))
                           "    "))
          (insert " ")))
-      (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+      (let* ((ans (concat (buffer-substring (line-beginning-position)
+                                            (point-max))
                          " " (or org-ans1 org-ans2)))
             (org-end-time-was-given nil)
             (f (org-read-date-analyze ans org-def org-defdecode))
@@ -14104,7 +14108,7 @@ user."
        (when org-read-date-analyze-futurep
          (setq txt (concat txt " (=>F)")))
        (setq org-read-date-overlay
-             (make-overlay (1- (point-at-eol)) (point-at-eol)))
+              (make-overlay (1- (line-end-position)) (line-end-position)))
        (org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
 
 (defun org-read-date-analyze (ans def defdecode)
@@ -14654,8 +14658,8 @@ days in order to avoid rounding problems."
    (org-clock-update-time-maybe)
    (save-excursion
      (unless (org-at-date-range-p t)
-       (goto-char (point-at-bol))
-       (re-search-forward org-tr-regexp-both (point-at-eol) t))
+       (goto-char (line-beginning-position))
+       (re-search-forward org-tr-regexp-both (line-end-position) t))
      (unless (org-at-date-range-p t)
        (user-error "Not at a time-stamp range, and none found in current 
line")))
    (let* ((ts1 (match-string 1))
@@ -15719,7 +15723,8 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
                  (goto-char (point-min))
                  (while (re-search-forward rea nil t)
                    (when (org-at-heading-p t)
-                     (add-text-properties (point-at-bol) (org-end-of-subtree 
t) pa))))
+                      (add-text-properties (line-beginning-position)
+                                           (org-end-of-subtree t) pa))))
                (goto-char (point-min))
                (setq re (format "^\\*+ .*\\<%s\\>" org-comment-string))
                (while (re-search-forward re nil t)
@@ -17231,14 +17236,14 @@ this function returns t, nil otherwise."
     (save-excursion
       (catch 'exit
        (unless (org-region-active-p)
-         (setq beg (point-at-bol))
+          (setq beg (line-beginning-position))
          (beginning-of-line 2)
          (while (and (not (eobp)) ;; this is like `next-line'
                      (get-char-property (1- (point)) 'invisible))
            (beginning-of-line 2))
          (setq end (point))
          (goto-char beg)
-         (goto-char (point-at-eol))
+          (goto-char (line-end-position))
          (setq end (max end (point)))
          (while (re-search-forward re end t)
            (when (get-char-property (match-beginning 0) 'invisible)
@@ -18160,7 +18165,7 @@ number of stars to add."
             (goto-char pos)
             (while (org-at-comment-p) (forward-line))
             (skip-chars-forward " \r\t\n")
-            (point-at-bol))))
+             (line-beginning-position))))
        beg end toggled)
     ;; Determine boundaries of changes.  If a universal prefix has
     ;; been given, put the list in a region.  If region ends at a bol,
@@ -18174,9 +18179,9 @@ number of stars to add."
        (setq beg (funcall skip-blanks (region-beginning))
              end (copy-marker (save-excursion
                                 (goto-char (region-end))
-                                (if (bolp) (point) (point-at-eol)))))
-      (setq beg (funcall skip-blanks (point-at-bol))
-           end (copy-marker (point-at-eol))))
+                                 (if (bolp) (point) (line-end-position)))))
+      (setq beg (funcall skip-blanks (line-beginning-position))
+            end (copy-marker (line-end-position))))
     ;; Ensure inline tasks don't count as headings.
     (org-with-limited-levels
      (save-excursion
@@ -18787,7 +18792,9 @@ and :keyword."
     ;; First the large context
     (cond
      ((org-at-heading-p t)
-      (push (list :headline (point-at-bol) (point-at-eol)) clist)
+      (push (list :headline (line-beginning-position)
+                  (line-end-position))
+            clist)
       (when (progn
              (beginning-of-line 1)
              (looking-at org-todo-line-tags-regexp))
@@ -18801,7 +18808,7 @@ and :keyword."
 
      ((org-at-item-p)
       (push (org-point-in-group p 2 :item-bullet) clist)
-      (push (list :item (point-at-bol)
+      (push (list :item (line-beginning-position)
                  (save-excursion (org-end-of-item) (point)))
            clist)
       (and (org-at-item-checkbox-p)
@@ -19198,7 +19205,7 @@ Also align node properties according to 
`org-property-format'."
                      (beginning-of-line 1)
                      (skip-chars-backward "\n")
                      (or (org-at-heading-p)
-                         (looking-back ":END:.*" (point-at-bol))))))
+                         (looking-back ":END:.*" (line-beginning-position))))))
     (let* ((element (save-excursion (beginning-of-line) 
(org-element-at-point)))
           (type (org-element-type element)))
       (cond ((and (memq type '(plain-list item))
@@ -19938,7 +19945,7 @@ major mode."
                (point))))
       (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
     (beginning-of-line)
-    (if (looking-at "\\s-*$") (delete-region (point) (point-at-eol))
+    (if (looking-at "\\s-*$") (delete-region (point) (line-end-position))
       (open-line 1))
     (org-indent-line)
     (insert "# ")))
@@ -20431,7 +20438,7 @@ interactive command with similar behavior."
                    (and (looking-at "[ \t]*$")
                         (string-match
                          "\\`\\*+\\'"
-                         (buffer-substring (point-at-bol) (point)))))))
+                          (buffer-substring (line-beginning-position) 
(point)))))))
          swallowp)
       (cond
        ((and subtreep org-yank-folded-subtrees)
@@ -20464,7 +20471,7 @@ interactive command with similar behavior."
          (beginning-of-line 1)
          (push-mark beg 'nomsg)))
        ((and subtreep org-yank-adjusted-subtrees)
-       (let ((beg (point-at-bol)))
+        (let ((beg (line-beginning-position)))
          (org-paste-subtree nil nil 'for-yank)
          (push-mark beg 'nomsg)))
        (t
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index bb3369de5f..c9bd8ea9fe 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -445,7 +445,7 @@ The most useful commands are:
       (let ((font-lock-fontify-region-function #'ignore))
         ;; insert-and-inherit will pick the right face automatically
         (while (search-forward-regexp "^:" nil t)
-          (setq bound (point-at-eol))
+          (setq bound (line-end-position))
           (while (search-forward cipher-string bound 'end)
             (decipher-insert plain-char)))))))
 
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 32031d1946..7d7e926538 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1186,7 +1186,7 @@ Intended as the value of `indent-line-function'."
                  (skip-syntax-forward "w_")
                  (when (search-backward-regexp
                         cfengine-mode-syntax-functions-regex
-                        (point-at-bol)
+                        (line-beginning-position)
                         t)
                    (match-string 1)))))
         (and w (assq (intern w) flist))))))
@@ -1285,7 +1285,7 @@ see.  Use it by enabling `eldoc-mode'."
   "Return completions for function name around or before point."
   (let* ((bounds (save-excursion
                    (let ((p (point)))
-                     (skip-syntax-backward "w_" (point-at-bol))
+                     (skip-syntax-backward "w_" (line-beginning-position))
                      (list (point) p))))
          (syntax (cfengine3-make-syntax-cache))
          (flist (assq 'functions syntax)))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 2a7bbf0105..ba0adcc913 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -2081,7 +2081,7 @@ Affected by `cperl-electric-parens'."
   "Insert a construction appropriate after a keyword.
 Help message may be switched off by setting `cperl-message-electric-keyword'
 to nil."
-  (let ((beg (point-at-bol))
+  (let ((beg (line-beginning-position))
        (dollar (and (eq last-command-event ?$)
                     (eq this-command 'self-insert-command)))
        (delete (and (memq last-command-event '(?\s ?\n ?\t ?\f))
@@ -2224,7 +2224,7 @@ to nil."
   "Insert a construction appropriate after a keyword.
 Help message may be switched off by setting `cperl-message-electric-keyword'
 to nil."
-  (let ((beg (point-at-bol)))
+  (let ((beg (line-beginning-position)))
     (and (save-excursion
            (skip-chars-backward "[:alpha:]")
           (cperl-after-expr-p nil "{;:"))
@@ -2264,8 +2264,8 @@ to nil."
   "Go to end of line, open a new line and indent appropriately.
 If in POD, insert appropriate lines."
   (interactive)
-  (let ((beg (point-at-bol))
-       (end (point-at-eol))
+  (let ((beg (line-beginning-position))
+        (end (line-end-position))
        (pos (point)) start over cut res)
     (if (and                           ; Check if we need to split:
                                        ; i.e., on a boundary and inside "{...}"
@@ -2343,8 +2343,8 @@ If in POD, insert appropriate lines."
                   (forward-paragraph -1)
                   (forward-word-strictly 1)
                   (setq pos (point))
-                  (setq cut (buffer-substring (point) (point-at-eol)))
-                  (delete-char (- (point-at-eol) (point)))
+                   (setq cut (buffer-substring (point) (line-end-position)))
+                   (delete-char (- (line-end-position) (point)))
                   (setq res (expand-abbrev))
                   (save-excursion
                     (goto-char pos)
@@ -2823,7 +2823,7 @@ Will not look before LIM."
                                        (point-max)))) ; do not loop if no 
syntaxification
                                  ;; label:
                                  (t
-                                  (setq colon-line-end (point-at-eol))
+                                   (setq colon-line-end (line-end-position))
                                   (search-forward ":"))))
                          ;; We are at beginning of code (NOT label or comment)
                          ;; First, the following code counts
@@ -2866,7 +2866,7 @@ Will not look before LIM."
                                    (looking-at (concat cperl-sub-regexp 
"\\>"))))
                             (setq p (nth 1 ; start of innermost containing list
                                          (parse-partial-sexp
-                                          (point-at-bol)
+                                           (line-beginning-position)
                                           (point)))))
                            (progn
                              (goto-char (1+ p)) ; enclosing block on the same 
line
@@ -3109,7 +3109,7 @@ comment."
 Returns true if comment is found.  In POD will not move the point."
   ;; If the line is inside other syntax groups (qq-style strings, HERE-docs)
   ;; then looks for literal # or end-of-line.
-  (let (state stop-in cpoint (lim (point-at-eol)) pr e)
+  (let (state stop-in cpoint (lim (line-end-position)) pr e)
     (or cperl-font-locking
        (cperl-update-syntaxification lim))
     (beginning-of-line)
@@ -4020,7 +4020,8 @@ recursive calls in starting lines of here-documents."
                             "")
                      tb (match-beginning 0))
                (setq argument nil)
-               (put-text-property (point-at-bol) b 'first-format-line 't)
+                (put-text-property (line-beginning-position)
+                                   b 'first-format-line 't)
                (if cperl-pod-here-fontify
                    (while (and (eq (forward-line) 0)
                                (not (looking-at "^[.;]$")))
@@ -4996,7 +4997,7 @@ If `cperl-indent-region-fix-constructs', will improve 
spacing on
 conditional/loop constructs."
   (interactive)
   (save-excursion
-    (let ((tmp-end (point-at-eol)) top done)
+    (let ((tmp-end (line-end-position)) top done)
       (save-excursion
        (beginning-of-line)
        (while (null done)
@@ -5046,9 +5047,9 @@ conditional/loop constructs."
                           "\\<\\(else\\|elsif\\|continue\\)\\>"))
                  (progn
                    (goto-char (match-end 0))
-                   (setq tmp-end (point-at-eol)))
+                    (setq tmp-end (line-end-position)))
                (setq done t))))
-         (setq tmp-end (point-at-eol)))
+          (setq tmp-end (line-end-position)))
        (goto-char tmp-end)
        (setq tmp-end (point-marker)))
       (if cperl-indent-region-fix-constructs
@@ -5061,7 +5062,7 @@ Returns some position at the last line."
   (interactive)
   (or end
       (setq end (point-max)))
-  (let ((ee (point-at-eol))
+  (let ((ee (line-end-position))
        (cperl-indent-region-fix-constructs
         (or cperl-indent-region-fix-constructs 1))
        p pp ml have-brace ret)
@@ -5237,7 +5238,7 @@ Returns some position at the last line."
                                (if (cperl-indent-line parse-data)
                                    (setq ret (cperl-fix-line-spacing end 
parse-data)))))))))))
        (beginning-of-line)
-       (setq p (point) pp (point-at-eol)) ; May be different from ee.
+        (setq p (point) pp (line-end-position)) ; May be different from ee.
        ;; Now check whether there is a hanging `}'
        ;; Looking at:
        ;; } blah
@@ -7282,7 +7283,7 @@ Currently it is tuned to C and Perl syntax."
   ;; Get to the something meaningful
   (or (eobp) (eolp) (forward-char 1))
   (re-search-backward "[-[:alnum:]_:!&*+,./<=>?\\^|~$%@]"
-                     (point-at-bol)
+                      (line-beginning-position)
                      'to-beg)
   ;;  (cond
   ;;   ((or (eobp) (looking-at "[][ \t\n{}();,]")) ; Not at a symbol
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 0c4a9bfdbe..4617a01947 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1899,7 +1899,7 @@ or elsewhere, return a 1-line docstring."
           ;; go to the arg after `&rest'.
           (if (and key-have-value
                    (save-excursion
-                     (not (re-search-forward ":.*" (point-at-eol) t)))
+                     (not (re-search-forward ":.*" (line-end-position) t)))
                    (string-match "&rest \\([^ ()]*\\)" args))
               (setq index nil ; Skip next block based on positional args.
                     start (match-beginning 1)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 7766694edf..65bc42c099 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1144,7 +1144,7 @@ error message."
              ;; Naive match found.  Qualify the match.
              (and (funcall (car order) pattern)
                   ;; Make sure it is not a previous qualified match.
-                  (not (member (set-marker match-marker (point-at-bol))
+                   (not (member (set-marker match-marker 
(line-beginning-position))
                                tag-lines-already-matched))
                   (throw 'qualified-match-found nil))
              (if next-line-after-failure-p
@@ -1314,11 +1314,11 @@ buffer-local values of tags table format variables."
 
       ;; Find the end of the tag and record the whole tag text.
       (search-forward "\177")
-      (setq tag-text (buffer-substring (1- (point)) (point-at-bol)))
+      (setq tag-text (buffer-substring (1- (point)) (line-beginning-position)))
       ;; If use-explicit is non-nil and explicit tag is present, use it as 
part of
       ;; return value. Else just skip it.
       (setq explicit-start (point))
-      (when (and (search-forward "\001" (point-at-bol 2) t)
+      (when (and (search-forward "\001" (line-beginning-position 2) t)
                 use-explicit)
        (setq tag-text (buffer-substring explicit-start (1- (point)))))
 
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index f760ccf368..c7b0587336 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -243,7 +243,8 @@ CATEGORY is the overlay category.  If it is nil, use the 
`glasses' category."
        (when glasses-separate-parentheses-p
          (goto-char beg)
          (while (re-search-forward "[a-zA-Z]_*\\((\\)" end t)
-           (unless (glasses-parenthesis-exception-p (point-at-bol) (match-end 
1))
+            (unless (glasses-parenthesis-exception-p (line-beginning-position)
+                                                     (match-end 1))
              (glasses-make-overlay (match-beginning 1) (match-end 1)
                                    'glasses-parenthesis))))))))
 
@@ -282,7 +283,8 @@ recognized according to the current value of the variable 
`glasses-separator'."
        (when glasses-separate-parentheses-p
          (goto-char (point-min))
          (while (re-search-forward "[a-zA-Z]_*\\( \\)(" nil t)
-           (unless (glasses-parenthesis-exception-p (point-at-bol) (1+ 
(match-end 1)))
+            (unless (glasses-parenthesis-exception-p (line-beginning-position)
+                                                     (1+ (match-end 1)))
              (replace-match "" t nil nil 1)))))))
   ;; nil must be returned to allow use in write file hooks
   nil)
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index d21a9faec9..63f032b7b3 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1381,7 +1381,7 @@ Otherwise just move the line.  Move down unless UP is 
non-nil."
         (arg (if up arg (- arg))))
     (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
     (if (and idlwave-shell-arrows-do-history
-            (>= (1+ (point-at-eol)) proc-pos))
+             (>= (1+ (line-end-position)) proc-pos))
        (comint-previous-input arg)
       (forward-line (- arg)))))
 
@@ -2130,7 +2130,7 @@ args of an executive .run, .rnew or .compile."
 
 (defun idlwave-shell-filename-string ()
   "Return t if in a string and after what could be a file name."
-  (let ((limit (point-at-bol)))
+  (let ((limit (line-beginning-position)))
     (save-excursion
       ;; Skip backwards over file name chars
       (skip-chars-backward idlwave-shell-file-name-chars limit)
@@ -2139,7 +2139,7 @@ args of an executive .run, .rnew or .compile."
 
 (defun idlwave-shell-batch-command ()
   "Return t if we're in a batch command statement like \"@foo\"."
-  (let ((limit (point-at-bol)))
+  (let ((limit (line-beginning-position)))
     (save-excursion
       ;; Skip backwards over filename
       (skip-chars-backward idlwave-shell-file-name-chars limit)
@@ -2317,7 +2317,7 @@ matter what the settings of that variable."
                                    idlwave-shell-electric-stop-line-face
                                  idlwave-shell-stop-line-face))
                  (move-overlay idlwave-shell-stop-line-overlay
-                               (point) (point-at-eol)
+                                (point) (line-end-position)
                                (current-buffer)))
              ;; use the arrow instead, but only if marking is wanted.
              (if idlwave-shell-mark-stop-line
@@ -2510,7 +2510,7 @@ If in the IDL shell buffer, returns 
`idlwave-shell-pc-frame'."
     (list (idlwave-shell-file-name (buffer-file-name))
           (save-restriction
             (widen)
-           (1+ (count-lines 1 (point-at-bol)))))))
+            (1+ (count-lines 1 (line-beginning-position)))))))
 
 (defun idlwave-shell-current-module ()
   "Return the name of the module for the current file.
@@ -3528,7 +3528,7 @@ Existing overlays are recycled, in order to minimize 
consumption."
       (while (setq bp (pop bp-list))
        (save-excursion
          (idlwave-shell-goto-frame (car bp))
-         (let* ((end (point-at-eol))
+          (let* ((end (line-end-position))
                 (beg (progn (beginning-of-line 1) (point)))
                 (condition (idlwave-shell-bp-get bp 'condition))
                 (count (idlwave-shell-bp-get bp 'count))
@@ -3851,7 +3851,7 @@ of the form:
                   (append
                    ;; compiled procedures
                    (progn
-                     (narrow-to-region cpro (point-at-bol))
+                     (narrow-to-region cpro (line-beginning-position))
                      (goto-char (point-min))
                      (idlwave-shell-sources-grep))
                    ;; compiled functions
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index b290854e1b..81f74dc1fa 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -2004,7 +2004,7 @@ Returns non-nil if abbrev is left expanded."
 Moves to end of line if there is no comment delimiter.
 Ignores comment delimiters in strings.
 Returns point if comment found and nil otherwise."
-  (let ((eos (point-at-eol))
+  (let ((eos (line-end-position))
         (data (match-data))
         found)
     ;; Look for first comment delimiter not in a string
@@ -2054,7 +2054,7 @@ Also checks if the correct END statement has been used."
   ;;(backward-char 1)
   (let* ((pos (point-marker))
         (last-abbrev-marker (copy-marker last-abbrev-location))
-        (eol-pos (point-at-eol))
+         (eol-pos (line-end-position))
         begin-pos end-pos end end1 )
     (if idlwave-reindent-end  (idlwave-indent-line))
     (setq last-abbrev-location (marker-position last-abbrev-marker))
@@ -3202,7 +3202,7 @@ ignored."
         (beginning-of-line)
         (setq bcl (point))
         (re-search-forward (concat "^[ \t]*" comment-start "+")
-                          (point-at-eol) t)
+                           (line-end-position) t)
         ;; Get the comment leader on the line and its length
         (setq pre (current-column))
         ;; the comment leader is the indentation plus exactly the
@@ -3210,7 +3210,8 @@ ignored."
         (setq fill-prefix-reg
               (concat
                (setq fill-prefix
-                     (regexp-quote (buffer-substring (point-at-bol) (point))))
+                     (regexp-quote (buffer-substring (line-beginning-position)
+                                                     (point))))
                "[^;]"))
 
         ;; Mark the beginning and end of the paragraph
@@ -3264,7 +3265,7 @@ ignored."
               (setq indent hang)
               (beginning-of-line)
               (while (> (point) start)
-                (re-search-forward comment-start-skip (point-at-eol) t)
+                (re-search-forward comment-start-skip (line-end-position) t)
                 (if (> (setq diff (- indent (current-column))) 0)
                     (progn
                       (if (>= here (point))
@@ -3286,7 +3287,7 @@ ignored."
             (setq indent
                   (min indent
                        (progn
-                         (re-search-forward comment-start-skip (point-at-eol) 
t)
+                         (re-search-forward comment-start-skip 
(line-end-position) t)
                          (current-column))))
             (forward-line -1)))
         (setq fill-prefix (concat fill-prefix
@@ -3296,7 +3297,7 @@ ignored."
         (setq first-indent
               (max
                (progn
-                 (re-search-forward comment-start-skip (point-at-eol) t)
+                 (re-search-forward comment-start-skip (line-end-position) t)
                  (current-column))
                indent))
 
@@ -3334,11 +3335,11 @@ If not found returns nil."
   (if idlwave-use-last-hang-indent
       (save-excursion
         (end-of-line)
-        (if (re-search-backward idlwave-hang-indent-regexp (point-at-bol) t)
+        (if (re-search-backward idlwave-hang-indent-regexp 
(line-beginning-position) t)
             (+ (current-column) (length idlwave-hang-indent-regexp))))
     (save-excursion
       (beginning-of-line)
-      (if (re-search-forward idlwave-hang-indent-regexp (point-at-eol) t)
+      (if (re-search-forward idlwave-hang-indent-regexp (line-end-position) t)
           (current-column)))))
 
 (defun idlwave-auto-fill ()
@@ -3386,7 +3387,7 @@ if `idlwave-auto-fill-split-string' is non-nil."
                      ;; Remove whitespace between comment delimiter and
                      ;; text, insert spaces for appropriate indentation.
                      (beginning-of-line)
-                     (re-search-forward comment-start-skip (point-at-eol) t)
+                      (re-search-forward comment-start-skip 
(line-end-position) t)
                      (delete-horizontal-space)
                      (idlwave-indent-to indent)
                      (goto-char (- (point-max) here)))))
@@ -3548,7 +3549,7 @@ constants - a double quote followed by an octal digit."
     ;; Because single and double quotes can quote each other we must
     ;; search for the string start from the beginning of line.
     (let* ((start (point))
-           (eol (point-at-eol))
+           (eol (line-end-position))
            (bq (progn (beginning-of-line) (point)))
            (endq (point))
            (data (match-data))
@@ -3626,7 +3627,7 @@ unless the optional second argument NOINDENT is non-nil."
           (setq s1 (downcase s1) s2 (downcase s2)))
          (idlwave-abbrev-change-case
           (setq s1 (upcase s1) s2 (upcase s2))))
-    (let ((beg (point-at-bol))
+    (let ((beg (line-beginning-position))
          end)
       (if (not (looking-at "\\s-*\n"))
          (open-line 1))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index efad3b52aa..b920ef6c2c 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))
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 30d37cf7ec..00bab00a0d 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -520,7 +520,7 @@ If the list was changed, sort the list and remove 
duplicates first."
            (looking-at meta-ignore-comment-regexp))
       (current-indentation))
      ;; Beginning of buffer.
-     ((eq (point-at-bol) (point-min))
+     ((eq (line-beginning-position) (point-min))
       0)
      ;; Backindent at end of environments.
      ((meta-indent-looking-at-code
@@ -558,14 +558,14 @@ If the list was changed, sort the list and remove 
duplicates first."
     (end-of-line)
     ;; Skip backward the comments.
     (let ((point-not-in-string (point)))
-      (while (search-backward comment-start (point-at-bol) t)
+      (while (search-backward comment-start (line-beginning-position) t)
        (unless (meta-indent-in-string-p)
          (setq point-not-in-string (point))))
       (goto-char point-not-in-string))
     ;; Search for the end of the previous expression.
-    (if (search-backward ";" (point-at-bol) t)
+    (if (search-backward ";" (line-beginning-position) t)
        (progn (while (and (meta-indent-in-string-p)
-                          (search-backward ";" (point-at-bol) t)))
+                           (search-backward ";" (line-beginning-position) t)))
               (if (= (char-after) ?\;)
                   (forward-char)
                 (beginning-of-line)))
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 8d3194e6a4..9786b1aa45 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -274,7 +274,7 @@ are handled in another way, and should not be added to this 
list."
     (while (and (> nest 0)
                (re-search-forward
                 "[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
-                (point-at-eol 2) t))
+                 (line-end-position 2) t))
       (cond ((match-beginning 1) (setq nest (1+ nest)))
            ((match-beginning 2) (setq nest (1- nest)))
            ((looking-at "[^(\n]+)") (setq nest 0))))))
@@ -283,7 +283,8 @@ are handled in another way, and should not be added to this 
list."
 (defun pascal-declaration-beg ()
   (let ((nest 1))
     (while (and (> nest 0)
-               (re-search-backward 
"[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
 (point-at-bol 0) t))
+                (re-search-backward 
"[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
+                                    (line-beginning-position 0) t))
       (cond ((match-beginning 1) (setq nest 0))
            ((match-beginning 2) (setq nest (1- nest)))
            ((match-beginning 3) (setq nest (1+ nest)))))
@@ -291,7 +292,7 @@ are handled in another way, and should not be added to this 
list."
 
 
 (defsubst pascal-within-string ()
-  (nth 3 (parse-partial-sexp (point-at-bol) (point))))
+  (nth 3 (parse-partial-sexp (line-beginning-position) (point))))
 
 
 ;;;###autoload
@@ -388,7 +389,7 @@ See also the user variables `pascal-type-keywords', 
`pascal-start-keywords' and
             (forward-char 1)
             (delete-horizontal-space))
            ((and (looking-at "(\\*\\|\\*[^)]")
-                 (not (save-excursion (search-forward "*)" (point-at-eol) t))))
+                  (not (save-excursion (search-forward "*)" 
(line-end-position) t))))
             (setq setstar t))))
     ;; If last line was a star comment line then this one shall be too.
     (if (null setstar)
@@ -707,7 +708,7 @@ on the line which ends a function or procedure named NAME."
     (if (and (looking-at "\\<end;")
             (not (save-excursion
                    (end-of-line)
-                   (search-backward "{" (point-at-bol) t))))
+                    (search-backward "{" (line-beginning-position) t))))
        (let ((type (car (pascal-calculate-indent))))
          (if (eq type 'declaration)
              ()
@@ -979,7 +980,7 @@ indent of the current line in parameterlist."
           (stpos (progn (goto-char (scan-lists (point) -1 1)) (point)))
           (stcol (1+ (current-column)))
           (edpos (progn (pascal-declaration-end)
-                        (search-backward ")" (point-at-bol) t)
+                         (search-backward ")" (line-beginning-position) t)
                         (point)))
           (usevar (re-search-backward "\\<var\\>" stpos t)))
       (if arg (progn
@@ -1026,7 +1027,7 @@ indent of the current line in parameterlist."
        (setq pascal--extra-indent (pascal-get-lineup-indent stpos edpos 
lineup))
        (goto-char stpos)
        (while (and (<= (point) edpos) (not (eobp)))
-         (if (search-forward lineup (point-at-eol) 'move)
+          (if (search-forward lineup (line-end-position) 'move)
              (forward-char -1))
          (delete-horizontal-space)
          (indent-to pascal--extra-indent)
@@ -1053,7 +1054,7 @@ indent of the current line in parameterlist."
       (goto-char b)
       ;; Get rightmost position
       (while (< (point) e)
-       (and (re-search-forward reg (min e (point-at-eol 2)) 'move)
+        (and (re-search-forward reg (min e (line-end-position 2)) 'move)
             (cond ((match-beginning 1)
                    ;; Skip record blocks
                    (pascal-declaration-end))
@@ -1117,7 +1118,7 @@ indent of the current line in parameterlist."
 
       ;; Search through all reachable functions
       (while (pascal-beg-of-defun)
-        (if (re-search-forward pascal-str (point-at-eol) t)
+        (if (re-search-forward pascal-str (line-end-position) t)
             (progn (setq match (buffer-substring (match-beginning 2)
                                                  (match-end 2)))
                    (push match pascal-all)))
@@ -1134,17 +1135,17 @@ indent of the current line in parameterlist."
        match)
     ;; Traverse lines
     (while (< (point) end)
-      (if (re-search-forward "[:=]" (point-at-eol) t)
+      (if (re-search-forward "[:=]" (line-end-position) t)
          ;; Traverse current line
          (while (and (re-search-backward
                       (concat "\\((\\|\\<\\(var\\|type\\|const\\)\\>\\)\\|"
                               pascal-symbol-re)
-                      (point-at-bol) t)
+                       (line-beginning-position) t)
                      (not (match-end 1)))
            (setq match (buffer-substring (match-beginning 0) (match-end 0)))
            (if (string-match (concat "\\<" pascal-str) match)
                 (push match pascal-all))))
-      (if (re-search-forward "\\<record\\>" (point-at-eol) t)
+      (if (re-search-forward "\\<record\\>" (line-end-position) t)
          (pascal-declaration-end)
        (forward-line 1)))
 
@@ -1187,7 +1188,7 @@ indent of the current line in parameterlist."
           (if (> start (prog1 (save-excursion (pascal-end-of-defun)
                                               (point))))
               ()                        ; Declarations not reachable
-            (if (search-forward "(" (point-at-eol) t)
+            (if (search-forward "(" (line-end-position) t)
                 ;; Check parameterlist
                 ;; FIXME: pascal-get-completion-decl doesn't understand
                 ;; the var declarations in parameter lists :-(
@@ -1245,7 +1246,7 @@ indent of the current line in parameterlist."
                 (or (eq state 'declaration) (eq state 'paramlist)
                     (and (eq state 'defun)
                          (save-excursion
-                           (re-search-backward ")[ \t]*:" (point-at-bol) t))))
+                           (re-search-backward ")[ \t]*:" 
(line-beginning-position) t))))
                 (save-excursion
                   (if (or (eq state 'paramlist) (eq state 'defun))
                       (pascal-beg-of-defun))
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 6437bbd4c1..f8edc2b1f7 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -2282,12 +2282,12 @@ between them)."
             (backward-paragraph)
             (unless (bobp) (forward-line))
             (if (string-match "^/\\*[^a-zA-Z]*$" (thing-at-point 'line))
-                (narrow-to-region (point-at-eol) (point-max))))
+                (narrow-to-region (line-end-position) (point-max))))
           (save-excursion
             (forward-paragraph)
             (forward-line -1)
             (if (string-match "^[^a-zA-Z]*\\*/$" (thing-at-point 'line))
-                (narrow-to-region (point-min) (point-at-bol))))
+                (narrow-to-region (point-min) (line-beginning-position))))
           (let ((fill-prefix (prolog-guess-fill-prefix)))
             (fill-paragraph nil))))
       )))
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 87bb92908d..955daa393c 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1147,7 +1147,7 @@ delimiter."
           (setq re (regexp-quote (or (match-string 4) (match-string 2))))
           (if (match-beginning 1) (setq re (concat "\\s *" re)))
           (let* ((id-end (goto-char (match-end 0)))
-                 (line-end-position (point-at-eol))
+                 (line-end-position (line-end-position))
                  (state (list in-string nest depth pcol indent)))
             ;; parse the rest of the line
             (while (and (> line-end-position (point))
@@ -1924,7 +1924,7 @@ It will be properly highlighted even when the call omits 
parens.")
                         (save-excursion
                           (forward-char -1)
                           (looking-back ruby-syntax-before-regexp-re
-                                        (point-at-bol))))
+                                        (line-beginning-position))))
                    ;; End of regexp.  We don't match the whole
                    ;; regexp at once because it can have
                    ;; string interpolation inside, or span
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index f063fb5a7c..fa799a0fb3 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -1824,7 +1824,7 @@ If set will become buffer local.")
 ;;
 
 (defsubst verilog-within-string ()
-  (nth 3 (parse-partial-sexp (point-at-bol) (point))))
+  (nth 3 (parse-partial-sexp (line-beginning-position) (point))))
 
 (defsubst verilog-string-match-fold (regexp string &optional start)
   "Like `string-match', but use `verilog-case-fold'.
@@ -1927,7 +1927,7 @@ This speeds up complicated regexp matches."
                (search-forward substr bound noerror))
       (save-excursion
        (beginning-of-line)
-       (setq done (re-search-forward regexp (point-at-eol) noerror)))
+        (setq done (re-search-forward regexp (line-end-position) noerror)))
       (unless (and (<= (match-beginning 0) (point))
                   (>= (match-end 0) (point)))
        (setq done nil)))
@@ -1947,7 +1947,7 @@ This speeds up complicated regexp matches."
                (search-backward substr bound noerror))
       (save-excursion
        (end-of-line)
-       (setq done (re-search-backward regexp (point-at-bol) noerror)))
+        (setq done (re-search-backward regexp (line-beginning-position) 
noerror)))
       (unless (and (<= (match-beginning 0) (point))
                   (>= (match-end 0) (point)))
        (setq done nil)))
@@ -4908,7 +4908,7 @@ primitive or interface named NAME."
        (or  kill-existing-comment
            (not (save-excursion
                   (end-of-line)
-                  (search-backward "//" (point-at-bol) t)))))
+                   (search-backward "//" (line-beginning-position) t)))))
       (let ((nest 1) b e
            m
            (else (if (match-end 2) "!" " ")))
@@ -4961,7 +4961,7 @@ primitive or interface named NAME."
           (or kill-existing-comment
               (not (save-excursion
                      (end-of-line)
-                     (search-backward "//" (point-at-bol) t)))))
+                      (search-backward "//" (line-beginning-position) t)))))
       (let ((type (car indent-str)))
        (unless (eq type 'declaration)
           (unless (looking-at (concat "\\(" verilog-end-block-ordered-re "\\)[ 
\t]*:"))  ; ignore named ends
@@ -5503,7 +5503,7 @@ becomes:
                 (cond
                  ((looking-at "// surefire lint_off_line ")
                   (goto-char (match-end 0))
-                  (let ((lim (point-at-eol)))
+                  (let ((lim (line-end-position)))
                     (if (re-search-forward code lim 'move)
                         (throw 'already t)
                       (insert (concat " " code)))))
@@ -9958,7 +9958,7 @@ Use DEFAULT-DIR to anchor paths if non-nil."
               (verilog-point-text) filename))
       (goto-char (point-min))
       (while (not (eobp))
-       (setq line (buffer-substring (point) (point-at-eol)))
+        (setq line (buffer-substring (point) (line-end-position)))
        (forward-line 1)
        (when (string-match "//" line)
          (setq line (substring line 0 (match-beginning 0))))
@@ -14758,7 +14758,7 @@ Clicking on the middle-mouse button loads them in a 
buffer (as in dired)."
         (verilog-save-scan-cache
          (let (end-point)
            (goto-char end)
-           (setq end-point (point-at-eol))
+            (setq end-point (line-end-position))
            (goto-char beg)
            (beginning-of-line)  ; scan entire line
            ;; delete overlays existing on this line
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 18219db740..b763da3fbc 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -7707,7 +7707,7 @@ non-nil, indentation is done before aligning."
        (save-excursion
         (goto-char begin)
         (let (element
-              (eol (point-at-eol)))
+               (eol (line-end-position)))
           (setq element (nth 0 copy))
           (when (and (or (and (listp (car element))
                               (memq major-mode (car element)))
@@ -7733,7 +7733,7 @@ space is inserted after the token in MATCH."
       ;; Determine the greatest whitespace distance to the alignment
       ;; character
       (goto-char begin)
-      (setq eol (point-at-eol)
+      (setq eol (line-end-position)
            bol (setq begin (progn (beginning-of-line) (point))))
       (while (< bol end)
        (save-excursion
@@ -7750,13 +7750,13 @@ space is inserted after the token in MATCH."
              (setq max distance))))
        (forward-line)
        (setq bol (point)
-             eol (point-at-eol))
+              eol (line-end-position))
        (setq lines (1+ lines)))
       ;; Now insert enough maxs to push each assignment operator to
       ;; the same column.  We need to use 'lines' as a counter, since
       ;; the location of the mark may change
       (goto-char (setq bol begin))
-      (setq eol (point-at-eol))
+      (setq eol (line-end-position))
       (while (> lines 0)
        (when (and (vhdl-re-search-forward match eol t)
                   (save-excursion
@@ -7776,7 +7776,7 @@ space is inserted after the token in MATCH."
        (beginning-of-line)
        (forward-line)
        (setq bol (point)
-             eol (point-at-eol))
+              eol (line-end-position))
        (setq lines (1- lines))))))
 
 (defun vhdl-align-region-groups (beg end &optional spacing
@@ -8647,7 +8647,7 @@ buffer."
           (forward-char)
           (vhdl-forward-syntactic-ws))
         (goto-char end)
-        (when (> pos (point-at-eol))
+         (when (> pos (line-end-position))
           (error "ERROR:  Not within a generic/port clause"))
         ;; delete closing parenthesis on separate line (not supported style)
         (when (save-excursion (beginning-of-line) (looking-at "^\\s-*);"))
@@ -12838,7 +12838,7 @@ expressions (e.g. for index ranges of types and 
signals)."
   "Return the line number of the line containing point."
   (save-restriction
     (widen)
-    (1+ (count-lines (point-min) (point-at-bol)))))
+    (1+ (count-lines (point-min) (line-beginning-position)))))
 
 (defun vhdl-line-kill-entire (&optional arg)
   "Delete entire line."
@@ -12855,7 +12855,7 @@ expressions (e.g. for index ranges of types and 
signals)."
   "Copy current line."
   (interactive "p")
   (save-excursion
-    (let ((position (point-at-bol)))
+    (let ((position (line-beginning-position)))
       (forward-line (or arg 1))
       (copy-region-as-kill position (point)))))
 
@@ -16752,7 +16752,7 @@ current project/directory."
   (let ((ent-alist ent-alist-arg)
        (conf-alist conf-alist-arg)
        (margin (current-indentation))
-       (beg (point-at-bol))
+        (beg (line-beginning-position))
        ent-entry inst-entry inst-path inst-prev-path tmp-alist) ;; cons-key
     ;; insert block configuration (for architecture)
     (vhdl-insert-keyword "FOR ") (insert arch-name "\n")
diff --git a/lisp/rect.el b/lisp/rect.el
index 6babd04605..e1d79da962 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -218,7 +218,7 @@ The returned value has the form of (WIDTH . HEIGHT)."
                          (point)))))
 
 (defun delete-extract-rectangle-line (startcol endcol lines fill)
-  (let ((pt (point-at-eol)))
+  (let ((pt (line-end-position)))
     (if (< (move-to-column startcol (if fill t 'coerce)) startcol)
        (setcdr lines (cons (spaces-string (- endcol startcol))
                            (cdr lines)))
@@ -397,13 +397,13 @@ no text on the right side of the rectangle."
 (defun open-rectangle-line (startcol endcol fill)
   (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
     (unless (and (not fill)
-                (= (point) (point-at-eol)))
+                 (= (point) (line-end-position)))
       (indent-to endcol))))
 
 (defun delete-whitespace-rectangle-line (startcol _endcol fill)
   (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
-    (unless (= (point) (point-at-eol))
-      (delete-region (point) (progn (skip-syntax-forward " " (point-at-eol))
+    (unless (= (point) (line-end-position))
+      (delete-region (point) (progn (skip-syntax-forward " " 
(line-end-position))
                                    (point))))))
 
 ;;;###autoload
@@ -568,7 +568,7 @@ rectangle which were empty."
   (apply-on-rectangle 'clear-rectangle-line start end fill))
 
 (defun clear-rectangle-line (startcol endcol fill)
-  (let ((pt (point-at-eol)))
+  (let ((pt (line-end-position)))
     (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
       (if (and (not fill)
               (<= (save-excursion (goto-char pt) (current-column)) endcol))
diff --git a/lisp/subr.el b/lisp/subr.el
index 3fde0551cc..36f5e2fee4 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1911,12 +1911,11 @@ be a list of the form returned by `event-start' and 
`event-end'."
 (defalias 'store-match-data #'set-match-data)
 (defalias 'chmod #'set-file-modes)
 (defalias 'mkdir #'make-directory)
-;; These are the XEmacs names:
-(defalias 'point-at-eol #'line-end-position)
-(defalias 'point-at-bol #'line-beginning-position)
 
-(define-obsolete-function-alias 'user-original-login-name
-  #'user-login-name "28.1")
+;; These were the XEmacs names, now obsolete:
+(define-obsolete-function-alias 'point-at-eol #'line-end-position "29.1")
+(define-obsolete-function-alias 'point-at-bol #'line-beginning-position "29.1")
+(define-obsolete-function-alias 'user-original-login-name #'user-login-name 
"28.1")
 
 ;; These are in obsolete/autoload.el, but are commonly used by
 ;; third-party scripts that assume that they exist without requiring
diff --git a/lisp/term.el b/lisp/term.el
index 11c2d2aaa1..797fb18074 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2862,13 +2862,13 @@ See `term-prompt-regexp'."
 
 (defun term-move-to-column (column)
   (setq term-current-column column)
-  (let ((point-at-eol (line-end-position)))
+  (let ((line-end-position (line-end-position)))
     (move-to-column term-current-column t)
     ;; If move-to-column extends the current line it will use the face
     ;; from the last character on the line, set the face for the chars
     ;; to default.
-    (when (> (point) point-at-eol)
-      (put-text-property point-at-eol (point) 'font-lock-face 'default))))
+    (when (> (point) line-end-position)
+      (put-text-property line-end-position (point) 'font-lock-face 'default))))
 
 ;; Move DELTA column right (or left if delta < 0 limiting at column 0).
 (defun term-move-columns (delta)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index a2a7774aba..d2a35bd550 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1711,7 +1711,7 @@ be used to fill comments.
     ;; comment.
     (when (save-excursion
             (beginning-of-line)
-            (comment-search-forward (point-at-eol) t))
+            (comment-search-forward (line-end-position) t))
       (goto-char (match-end 0)))
     (let ((ppss (syntax-ppss))
           (eol (line-end-position)))
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 2ee20ef1d4..1094ef3e93 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1553,7 +1553,7 @@ The buffer to mark them in is 
`flyspell-large-region-buffer'."
       (goto-char (point-min))
       ;; Localwords parsing copied from ispell.el.
       (while (search-forward ispell-words-keyword nil t)
-       (let ((end (point-at-eol))
+        (let ((end (line-end-position))
              string)
          ;; buffer-local words separated by a space, and can contain
          ;; any character other than a space.  Not rigorous enough.
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6e83982e22..8e63368809 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3154,7 +3154,7 @@ ispell-region: Search for first region to skip after 
(ispell-begin-skip-region-r
                                       (min skip-region-start ispell-region-end)
                                     (marker-position ispell-region-end))))
                (let* ((ispell-start (point))
-                      (ispell-end (min (point-at-eol) reg-end))
+                       (ispell-end (min (line-end-position) reg-end))
                       ;; See if line must be prefixed by comment string to let 
ispell know this is
                       ;; part of a comment string.  This is only supported in 
some modes.
                       ;; In particular, this is not supported in autoconf mode 
where adding the
@@ -3167,7 +3167,8 @@ ispell-region: Search for first region to skip after 
(ispell-begin-skip-region-r
                                ispell-start ispell-end add-comment)))
                  (ispell-print-if-debug
                    "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: 
[%s], [add-comment]: [%s], [string]: [%s]\n"
-                   ispell-start ispell-end (point-at-eol) in-comment 
add-comment string)
+                   ispell-start ispell-end (line-end-position)
+                   in-comment add-comment string)
                  (if add-comment               ; account for comment chars 
added
                      (setq ispell-start (- ispell-start (length add-comment))
                            ;; Reset `in-comment' (and indirectly 
`add-comment') for new line
@@ -4104,7 +4105,7 @@ Includes LaTeX/Nroff modes and extended character mode."
     (goto-char (point-max))
     ;; Uses last occurrence of ispell-parsing-keyword
     (if (search-backward ispell-parsing-keyword nil t)
-       (let ((end (point-at-eol))
+        (let ((end (line-end-position))
              string)
          (search-forward ispell-parsing-keyword)
          (while (re-search-forward " *\\([^ \"]+\\)" end t)
@@ -4140,7 +4141,7 @@ Both should not be used to define a buffer-local 
dictionary."
        (if (search-backward ispell-dictionary-keyword nil t)
            (progn
              (search-forward ispell-dictionary-keyword)
-             (setq end (point-at-eol))
+              (setq end (line-end-position))
              (if (re-search-forward " *\\([^ \"]+\\)" end t)
                  (setq ispell-local-dictionary
                        (match-string-no-properties 1))))))
@@ -4148,7 +4149,7 @@ Both should not be used to define a buffer-local 
dictionary."
       (if (search-backward ispell-pdict-keyword nil t)
          (progn
            (search-forward ispell-pdict-keyword)
-           (setq end (point-at-eol))
+            (setq end (line-end-position))
            (if (re-search-forward " *\\([^ \"]+\\)" end t)
                (setq ispell-local-pdict
                      (match-string-no-properties 1)))))))
@@ -4177,7 +4178,7 @@ Both should not be used to define a buffer-local 
dictionary."
     (while (search-forward ispell-words-keyword nil t)
       (or ispell-buffer-local-name
          (setq ispell-buffer-local-name (buffer-name)))
-      (let ((end (point-at-eol))
+      (let ((end (line-end-position))
            (ispell-casechars (ispell-get-casechars))
            string)
        ;; buffer-local words separated by a space, and can contain
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 7a654f72ab..98672f42b3 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -779,10 +779,10 @@ braces."
   nil
   (cond
    ;; parenthesis
-   ((looking-back "([^)]*" (point-at-bol 0))
+   ((looking-back "([^)]*" (line-beginning-position 0))
     "@pxref{")
    ;; beginning of sentence or buffer
-   ((or (looking-back (sentence-end) (point-at-bol 0))
+   ((or (looking-back (sentence-end) (line-beginning-position 0))
         (= (point) (point-min)))
     "@xref{")
    ;; bol or eol
@@ -790,7 +790,7 @@ braces."
     "@ref{")
    ;; inside word
    ((not (eq (char-syntax (char-after)) ? ))
-    (skip-syntax-backward "^ " (point-at-bol))
+    (skip-syntax-backward "^ " (line-beginning-position))
     "@ref{")
    ;; everything else
    (t
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index e4a1996c1b..6b30de3cb3 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -633,7 +633,7 @@ See 
https://lists.gnu.org/r/emacs-devel/2007-11/msg01990.html";)
         (when (looking-at regexp-hunk) ; Hunk header.
           (throw 'headerp (point)))
         (forward-line -1)
-        (when (re-search-forward regexp-file (point-at-eol 4) t) ; File header.
+        (when (re-search-forward regexp-file (line-end-position 4) t) ; File 
header.
           (forward-line 0)
           (throw 'headerp (point)))
         (goto-char orig)
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 61976288e3..f4a44df3c2 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -907,7 +907,7 @@ if we don't understand a construct, we signal
         ;; should cover the common cases.  Remember that we fall back
         ;; to regular hg commands if we see something we don't like.
         (save-restriction
-          (narrow-to-region (point) (point-at-eol))
+          (narrow-to-region (point) (line-end-position))
           (cond ((looking-at "[ \t]*\\(?:#.*\\)?$"))
                 ((looking-at "syntax:[ \t]*re[ \t]*$")
                  (setf default-syntax 'vc-hg--hgignore-add-pcre))
diff --git a/lisp/xdg.el b/lisp/xdg.el
index c7d9c0e785..dd0d51290d 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -250,7 +250,7 @@ This should be called at the beginning of a line."
        ;; Filter localized strings
        ((looking-at (rx (group-n 1 (+ (in alnum "-"))) (* blank) "[")))
        (t (error "Malformed line: %s"
-                 (buffer-substring (point) (point-at-eol)))))
+                 (buffer-substring (point) (line-end-position)))))
       (forward-line))
     res))
 
@@ -265,7 +265,7 @@ Optional argument GROUP defaults to the string \"Desktop 
Entry\"."
       (forward-line))
     (unless (looking-at xdg-desktop-group-regexp)
       (error "Expected group name!  Instead saw: %s"
-             (buffer-substring (point) (point-at-eol))))
+             (buffer-substring (point) (line-end-position))))
     (when group
       (while (and (re-search-forward xdg-desktop-group-regexp nil t)
                   (not (equal (match-string 1) group)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]