emacs-diffs
[Top][All Lists]
Advanced

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

feature/improved-locked-narrowing 3bf19c417f: Merge master into feature/


From: Gregory Heytings
Subject: feature/improved-locked-narrowing 3bf19c417f: Merge master into feature/improved-locked-narrowing.
Date: Tue, 23 Aug 2022 11:51:41 -0400 (EDT)

branch: feature/improved-locked-narrowing
commit 3bf19c417fd39766ee9c7a793c9faadd3bd88478
Merge: ea8e0f67bb 1c837c42c2
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>

    Merge master into feature/improved-locked-narrowing.
---
 Makefile.in                              |   2 +-
 admin/gitmerge.el                        |   6 +-
 doc/lispref/commands.texi                |   6 +-
 doc/lispref/positions.texi               |   4 +-
 doc/lispref/text.texi                    |   7 +-
 doc/lispref/variables.texi               |  10 +++
 doc/misc/auth.texi                       |   6 +-
 doc/misc/cl.texi                         |   6 +-
 doc/misc/htmlfontify.texi                |   2 +-
 etc/NEWS                                 |  39 +++++++++--
 etc/emacs_lldb.py                        |   6 +-
 lisp/allout.el                           |   6 +-
 lisp/auth-source.el                      |  11 ++--
 lisp/autorevert.el                       |   2 +-
 lisp/bookmark.el                         |   8 +--
 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/cus-edit.el                         |   3 +
 lisp/dired.el                            |   6 +-
 lisp/ecomplete.el                        |   2 +-
 lisp/elec-pair.el                        |   3 +-
 lisp/electric.el                         |   9 ++-
 lisp/emacs-lisp/backtrace.el             |   2 +-
 lisp/emacs-lisp/byte-opt.el              |  20 ++++--
 lisp/emacs-lisp/byte-run.el              |   1 -
 lisp/emacs-lisp/bytecomp.el              |  33 ++++++----
 lisp/emacs-lisp/chart.el                 |   6 +-
 lisp/emacs-lisp/comp.el                  |  22 +++++--
 lisp/emacs-lisp/easymenu.el              |  18 +----
 lisp/emacs-lisp/gv.el                    | 105 ++++++++++++++++++++++++++++-
 lisp/emacs-lisp/icons.el                 |   4 +-
 lisp/emacs-lisp/lisp-mode.el             |  73 +++++---------------
 lisp/emacs-lisp/re-builder.el            |   3 +-
 lisp/emacs-lisp/shortdoc.el              |  15 +++--
 lisp/emacs-lisp/tabulated-list.el        |  16 ++---
 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/eshell/esh-io.el                    |   2 +-
 lisp/faces.el                            |  11 ++--
 lisp/ffap.el                             |   4 +-
 lisp/files.el                            |  32 +++++----
 lisp/find-file.el                        |  15 ++++-
 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/help-fns.el                         |  11 ++++
 lisp/image.el                            |   2 +
 lisp/ldefs-boot.el                       |  18 ++---
 lisp/mail/emacsbug.el                    |  10 +--
 lisp/mail/mail-utils.el                  |   5 +-
 lisp/mail/mailabbrev.el                  |   2 +-
 lisp/mail/mspools.el                     |   4 +-
 lisp/mail/rfc2047.el                     |  16 ++---
 lisp/mail/rmailmm.el                     |   5 +-
 lisp/mail/sendmail.el                    |   2 +-
 lisp/mail/smtpmail.el                    |   5 +-
 lisp/mh-e/mh-seq.el                      |   2 +-
 lisp/mouse.el                            |   3 +
 lisp/net/eudc.el                         |   2 +-
 lisp/net/eudcb-ldap.el                   |  12 +---
 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-julia.el                     |   7 +-
 lisp/org/ob-lilypond.el                  |   2 +-
 lisp/org/ob-octave.el                    |   2 +-
 lisp/org/oc-basic.el                     |  13 ++--
 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-plot.el                     |   3 +-
 lisp/org/org-refile.el                   |   4 +-
 lisp/org/org-table.el                    |  28 ++++----
 lisp/org/org-version.el                  |   2 +-
 lisp/org/org.el                          |  83 ++++++++++++-----------
 lisp/org/ox-icalendar.el                 |  12 ++--
 lisp/paren.el                            |   3 +-
 lisp/pixel-scroll.el                     |  20 +++---
 lisp/play/decipher.el                    |   2 +-
 lisp/play/gamegrid.el                    |  33 +++++++---
 lisp/progmodes/cfengine.el               |   4 +-
 lisp/progmodes/cperl-mode.el             |  33 +++++-----
 lisp/progmodes/elisp-mode.el             |   6 +-
 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/python.el                 |  10 ++-
 lisp/progmodes/ruby-mode.el              |   4 +-
 lisp/progmodes/verilog-mode.el           |  16 ++---
 lisp/progmodes/vhdl-mode.el              |  22 +++----
 lisp/rect.el                             |  10 +--
 lisp/server.el                           |   5 +-
 lisp/simple.el                           |   2 +-
 lisp/subr.el                             |  14 ++--
 lisp/term.el                             |   6 +-
 lisp/textmodes/css-mode.el               |   2 +-
 lisp/textmodes/flyspell.el               |   2 +-
 lisp/textmodes/ispell.el                 |  65 ++++++++++--------
 lisp/textmodes/texinfo.el                |   6 +-
 lisp/thumbs.el                           |   1 +
 lisp/vc/diff-mode.el                     |   2 +-
 lisp/vc/ediff-init.el                    |   2 +-
 lisp/vc/vc-hg.el                         |   2 +-
 lisp/wdired.el                           |  31 ++++++---
 lisp/winner.el                           |   3 +-
 lisp/xdg.el                              |   4 +-
 src/buffer.c                             |   1 +
 src/buffer.h                             |   9 +++
 src/editfns.c                            |  12 ++--
 src/pdumper.c                            |   3 +-
 src/xdisp.c                              |   3 +-
 src/xfns.c                               |   7 +-
 src/xml.c                                |  16 ++++-
 src/xterm.c                              | 110 ++++++++++++++++++++++++++-----
 src/xterm.h                              |   5 +-
 test/lisp/autorevert-tests.el            |   2 +-
 test/lisp/calendar/todo-mode-tests.el    |  10 +--
 test/lisp/cedet/semantic-utest-ia.el     |  12 ++--
 test/lisp/cedet/semantic-utest.el        |   6 +-
 test/lisp/dired-tests.el                 |   4 +-
 test/lisp/emacs-lisp/backtrace-tests.el  |   6 +-
 test/lisp/emacs-lisp/find-func-tests.el  |   4 +-
 test/lisp/emacs-lisp/lisp-mode-tests.el  |  22 ++++---
 test/lisp/erc/erc-tests.el               |  12 ++--
 test/lisp/eshell/esh-proc-tests.el       |   4 ++
 test/lisp/gnus/message-tests.el          |   8 +--
 test/lisp/info-xref-tests.el             |   3 +-
 test/lisp/mail/footnote-tests.el         |   2 +-
 test/lisp/progmodes/elisp-mode-tests.el  |   2 +-
 test/lisp/progmodes/f90-tests.el         |   4 +-
 test/lisp/progmodes/python-tests.el      |  60 ++++++++---------
 test/lisp/replace-tests.el               |   4 +-
 test/lisp/simple-tests.el                |  20 +++---
 test/lisp/textmodes/css-mode-tests.el    |   8 +--
 test/lisp/textmodes/fill-tests.el        |   8 +--
 test/lisp/time-stamp-tests.el            |   6 +-
 test/src/lread-tests.el                  |   2 +-
 test/src/process-tests.el                |   6 +-
 test/src/undo-tests.el                   |   5 +-
 219 files changed, 1317 insertions(+), 971 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 78103f897f..7541e8d6b6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -367,7 +367,7 @@ all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) 
src-depending-on-lisp
 # .pdmp containing the new autoloads.
 .PHONY: src-depending-on-lisp
 src-depending-on-lisp: lisp
-       ${MAKE} -C src
+       ${MAKE} -C src BIN_DESTDIR='$(BIN_DESTDIR)' ELN_DESTDIR='$(ELN_DESTDIR)'
 
 # If configure were to just generate emacsver.tex from emacsver.tex.in
 # in the normal way, the timestamp of emacsver.tex would always be
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/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 26739bf5b8..ede1c4d762 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -443,9 +443,9 @@ specification.  If the key sequence that invoked the 
command has
 and @acronym{ASCII} characters, do not count where @samp{e} is concerned.
 
 @item f
-A file name of an existing file (@pxref{File Names}).  The default
-directory is @code{default-directory}.  Existing, Completion, Default,
-Prompt.
+A file name of an existing file (@pxref{File Names}).  @xref{Reading
+File Names}, for details about default values.  Existing, Completion,
+Default, Prompt.
 
 @item F
 A file name.  The file need not exist.  Completion, Default, Prompt.
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 53846ed297..7945232bf8 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -387,12 +387,12 @@ Return the position that @code{(end-of-line @var{count})}
 would move to.
 @end defun
 
-@defun bol &optional count
+@defun pos-bol &optional count
 Like @code{line-beginning-position}, but ignores fields (and is more
 efficient).
 @end defun
 
-@defun eol &optional count
+@defun pos-eol &optional count
 Like @code{line-end-position}, but ignores fields (and is more
 efficient).
 @end defun
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index c2161b9341..8b859042ad 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -5473,12 +5473,15 @@ available in this Emacs session.
 When libxml2 support is available, the following functions can be used
 to parse HTML or XML text into Lisp object trees.
 
-@defun libxml-parse-html-region start end &optional base-url discard-comments
+@defun libxml-parse-html-region &optional start end base-url discard-comments
 This function parses the text between @var{start} and @var{end} as
 HTML, and returns a list representing the HTML @dfn{parse tree}.  It
 attempts to handle real-world HTML by robustly coping with syntax
 mistakes.
 
+If @var{start} or @var{end} are @code{nil}, they default to the values
+from @code{point-min} and @code{point-max}, respectively.
+
 The optional argument @var{base-url}, if non-@code{nil}, should be a
 string specifying the base URL for relative URLs occurring in links.
 
@@ -5524,7 +5527,7 @@ buffer.  The argument @var{dom} should be a list as 
generated by
 @end defun
 
 @cindex parsing xml
-@defun libxml-parse-xml-region start end &optional base-url discard-comments
+@defun libxml-parse-xml-region &optional start end base-url discard-comments
 This function is the same as @code{libxml-parse-html-region}, except
 that it parses the text as XML rather than HTML (so it is stricter
 about syntax).
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 242b1a3be9..ed119a709c 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -2822,6 +2822,16 @@ expression manipulating @var{place} via @var{getter} and 
@var{setter}.
 
 Consult the source file @file{gv.el} for more details.
 
+@defun make-obsolete-generalized-variable obsolete-name current-name when
+This function makes the byte compiler warn that the generalized
+variable @var{obsolete-name} is obsolete.  If @var{current-name} is a
+symbol, then the warning message says to use @var{current-name}
+instead of @var{obsolete-name}.  If @var{current-name} is a string,
+this is the message.  @var{when} should be a string indicating when
+the variable was first made obsolete (usually a version number
+string).
+@end defun
+
 @cindex CL note---no @code{setf} functions
 @quotation
 @b{Common Lisp note:} Common Lisp defines another way to specify the
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index 91a9afd9c9..9dc63af6bc 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -384,7 +384,7 @@ This function creates a new item in @var{collection} with 
label
 @var{item} and password @var{password}.  The label @var{item} does not
 have to be unique in @var{collection}.  @var{attributes} are key-value
 pairs set for the created item.  The keys are keyword symbols,
-starting with a colon.  Example:
+starting with a colon; values are strings.  Example:
 
 @example
 ;;; The collection is "session", the label is "my item"
@@ -466,6 +466,10 @@ then fall back to @file{~/.authinfo.gpg}.
                      "~/.authinfo.gpg"))
 @end example
 
+Attribute values in the auth-source spec, which are not strings (like
+port numbers), are stringified prior calling the @file{secrets.el}
+functions.
+
 @node The Unix password store
 @chapter The Unix password store
 
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index a7548bb1f8..b2f43ad051 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -938,9 +938,9 @@ current-window-configuration       read-mouse-position
 default-file-modes                 screen-height
 documentation-property             screen-width
 face-background                    selected-window
-face-background-pixmap             selected-screen
-face-font                          selected-frame
-face-foreground                    standard-case-table
+face-font                          selected-screen
+face-foreground                    selected-frame
+face-stipple                       standard-case-table
 face-underline-p                   syntax-table
 file-modes                         visited-file-modtime
 frame-height                       window-height
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
index fadc6a5cbe..dabe2e36ff 100644
--- a/doc/misc/htmlfontify.texi
+++ b/doc/misc/htmlfontify.texi
@@ -33,7 +33,7 @@ modify this GNU manual.''
 @titlepage
 @title Htmlfontify User Manual
 @sp 4
-@subtitle Htmlfontify version 0.20
+@subtitle Htmlfontify version 0.21
 @sp 1
 @subtitle Jun 2002
 @sp 5
diff --git a/etc/NEWS b/etc/NEWS
index 0274e3b153..a5b5e9053d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -39,16 +39,12 @@ C++ compiler to be present on your system.  If Emacs is not 
built with
 the option '--with-be-app', the resulting Emacs will only run in
 text-mode terminals.
 
-+++
-** Cairo drawing support has been enabled for Haiku builds.
 To enable Cairo support, ensure that the Cairo and FreeType
 development files are present on your system, and configure Emacs with
 '--with-be-cairo'.
 
----
-** Double buffering is now enabled on the Haiku operating system.
 Unlike X, there is no compile-time option to enable or disable
-double-buffering.  If you wish to disable double-buffering, change the
+double-buffering; it is always enabled.  To disable it, change the
 frame parameter 'inhibit-double-buffering' instead.
 
 ---
@@ -2585,11 +2581,42 @@ abbrevlist.el, assoc.el, complete.el, cust-print.el,
 erc-hecomplete.el, mailpost.el, mouse-sel.el, old-emacs-lock.el,
 patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el.
 
+---
+** Many seldom-used generalized variables have been made obsolete.
+Emacs has a number of rather obscure generalized variables defined,
+that, for instance, allowed you to say things like:
+
+   (setf (point-min) 4)
+
+These never caught on and have been made obsolete.  The form above,
+for instance, is the same as saying
+
+   (narrow-to-region 4 (point-max))
+
+The following generalized variables have been made obsolete:
+'buffer-local-value', 'visited-file-name', 'buffer-modified-p',
+'buffer-name', 'buffer-string', 'buffer-substring', 'current-buffer',
+'current-column', 'current-global-map', 'current-input-mode',
+'current-local-map', 'current-window-configuration',
+'default-file-modes', 'documentation-property', 'frame-height',
+'frame-visible-p', 'global-key-binding', 'local-key-binding', 'mark',
+'mark-marker', 'marker-position', 'mouse-position', 'point',
+'point-marker', 'point-max', 'point-min', 'read-mouse-position',
+'screen-height', 'screen-width', 'selected-window', 'selected-screen',
+'selected-frame', 'standard-case-table', 'syntax-table',
+'visited-file-modtime', 'window-height', 'window-width' and
+'x-get-secondary-selection'.
+
 
 * Lisp Changes in Emacs 29.1
 
 +++
-** New functions 'eol' and 'bol'.
+** New function 'make-obsolete-generalized-variable'.
+This can be used to mark setters used by 'setf' as obsolete, and the
+byte-compiler will then warn about using them.
+
++++
+** New functions 'pos-eol' and 'pos-bol'.
 These are like 'line-end-position' and 'line-beginning-position'
 (respectively), but ignore fields (and are more efficient).
 
diff --git a/etc/emacs_lldb.py b/etc/emacs_lldb.py
index 880a835341..a2329e6ea4 100644
--- a/etc/emacs_lldb.py
+++ b/etc/emacs_lldb.py
@@ -33,7 +33,10 @@ import lldb
 # Return the name of enumerator ENUM as a string.
 def enumerator_name(enum):
     enumerators = enum.GetType().GetEnumMembers()
-    return enumerators[enum.GetValueAsUnsigned()].GetName()
+    for enum_member in enumerators:
+        if enum.GetValueAsUnsigned() == enum_member.GetValueAsUnsigned():
+            return enum_member.GetName()
+    return None
 
 # A class wrapping an SBValue for a Lisp_Object, providing convenience
 # functions.
@@ -91,7 +94,6 @@ class Lisp_Object:
             self.unsigned = lisp_word.GetValueAsUnsigned()
         else:
             self.unsigned = self.lisp_obj.GetValueAsUnsigned()
-        pass
 
     # Initialize self.lisp_type to the C Lisp_Type enumerator of the
     # Lisp_Object, as a string.  Initialize self.pvec_type likewise to
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/auth-source.el b/lisp/auth-source.el
index f198362f10..c79e5b81f7 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -1618,10 +1618,13 @@ authentication tokens:
          (search-specs (auth-source-secrets-listify-pattern
                         (apply #'append (mapcar
                                       (lambda (k)
-                                        (if (or (null (plist-get spec k))
-                                                (eq t (plist-get spec k)))
-                                            nil
-                                          (list k (plist-get spec k))))
+                                        (let ((v (plist-get spec k)))
+                                          (if (or (null v)
+                                                  (eq t v))
+                                              nil
+                                            (list
+                                             k
+                                             (auth-source-ensure-strings v)))))
                                       search-keys))))
          ;; needed keys (always including host, login, port, and secret)
          (returned-keys (delete-dups (append
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 918c0c7f19..872a896689 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -800,7 +800,7 @@ This is an internal function used by Auto-Revert Mode."
     (when revert
       (when (and auto-revert-verbose
                  (not (eq revert 'fast)))
-        (message "Reverting buffer `%s'." (buffer-name)))
+        (message "Reverting buffer `%s'" (buffer-name)))
       ;; If point (or a window point) is at the end of the buffer, we
       ;; want to keep it at the end after reverting.  This allows one
       ;; to tail a file.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index b3b3660902..8dfc16bf9f 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -495,7 +495,7 @@ In other words, return all information but the name."
 (defun bookmark--set-fringe-mark ()
   "Apply a colorized overlay to the bookmarked location.
 See user option `bookmark-fringe-mark'."
-  (let ((bm (make-overlay (point-at-bol) (1+ (point-at-bol)))))
+  (let ((bm (make-overlay (pos-bol) (1+ (pos-bol)))))
     (overlay-put bm 'category 'bookmark)
     (overlay-put bm 'evaporate t)
     (overlay-put bm 'before-string
@@ -518,7 +518,7 @@ See user option `bookmark-fringe-mark'."
             (setq overlays
                   (save-excursion
                     (goto-char pos)
-                    (overlays-in (point-at-bol) (1+ (point-at-bol)))))
+                    (overlays-in (pos-bol) (1+ (pos-bol)))))
             (while (and (not found) (setq temp (pop overlays)))
               (when (eq 'bookmark (overlay-get temp 'category))
                 (delete-overlay (setq found temp))))))))))
@@ -1014,7 +1014,7 @@ the list of bookmarks.)"
   "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."
-  (let ((eol (line-end-position)))
+  (let ((eol (pos-eol)))
     (delete-region (point) eol)
     (when (and newline-too (= (following-char) ?\n))
       (delete-char 1))))
@@ -1221,7 +1221,7 @@ and then show any annotations for this bookmark."
   ;; FIXME: we used to only run bookmark-after-jump-hook in
   ;; `bookmark-jump' itself, but in none of the other commands.
   (when bookmark-fringe-mark
-    (let ((overlays (overlays-in (point-at-bol) (1+ (point-at-bol))))
+    (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol))))
           temp found)
       (while (and (not found) (setq temp (pop overlays)))
         (when (eq 'bookmark (overlay-get temp 'category))
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/cus-edit.el b/lisp/cus-edit.el
index d5bae8f66f..d3768766be 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4291,6 +4291,9 @@ restoring it to the state of a face that has never been 
customized."
 (defvar widget-fringe-bitmap-prompt-value-history nil
   "History of input to `widget-fringe-bitmap-prompt-value'.")
 
+;; In no-X builds, fringe.el isn't preloaded.
+(autoload 'fringe-bitmap-p "fringe")
+
 (define-widget 'fringe-bitmap 'symbol
   "A Lisp fringe bitmap name."
   :format "%v"
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/elec-pair.el b/lisp/elec-pair.el
index e5adb0dda7..e4d6461505 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -666,7 +666,8 @@ To toggle the mode in a single buffer, use 
`electric-pair-local-mode'."
 ;;;###autoload
 (define-minor-mode electric-pair-local-mode
   "Toggle `electric-pair-mode' only in this buffer."
-  :variable (buffer-local-value 'electric-pair-mode (current-buffer))
+  :variable ( electric-pair-mode .
+              (lambda (val) (setq-local electric-pair-mode val)))
   (cond
    ((eq electric-pair-mode (default-value 'electric-pair-mode))
     (kill-local-variable 'electric-pair-mode))
diff --git a/lisp/electric.el b/lisp/electric.el
index f2ff837333..bd7ea527ba 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -340,7 +340,8 @@ use `electric-indent-local-mode'."
 ;;;###autoload
 (define-minor-mode electric-indent-local-mode
   "Toggle `electric-indent-mode' only in this buffer."
-  :variable (buffer-local-value 'electric-indent-mode (current-buffer))
+  :variable ( electric-indent-mode .
+              (lambda (val) (setq-local electric-indent-mode val)))
   (cond
    ((eq electric-indent-mode (default-value 'electric-indent-mode))
     (kill-local-variable 'electric-indent-mode))
@@ -484,7 +485,8 @@ The variable `electric-layout-rules' says when and how to 
insert newlines."
 ;;;###autoload
 (define-minor-mode electric-layout-local-mode
   "Toggle `electric-layout-mode' only in this buffer."
-  :variable (buffer-local-value 'electric-layout-mode (current-buffer))
+  :variable ( electric-layout-mode .
+              (lambda (val) (setq-local electric-layout-mode val)))
   (cond
    ((eq electric-layout-mode (default-value 'electric-layout-mode))
     (kill-local-variable 'electric-layout-mode))
@@ -661,7 +663,8 @@ use `electric-quote-local-mode'."
 ;;;###autoload
 (define-minor-mode electric-quote-local-mode
   "Toggle `electric-quote-mode' only in this buffer."
-  :variable (buffer-local-value 'electric-quote-mode (current-buffer))
+  :variable ( electric-quote-mode .
+              (lambda (val) (setq-local electric-quote-mode val)))
   (cond
    ((eq electric-quote-mode (default-value 'electric-quote-mode))
     (kill-local-variable 'electric-quote-mode))
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/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 2467b468a4..27b0d33d3e 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -728,17 +728,20 @@ for speeding up processing.")
   (while (let ((head (car-safe form)))
            (cond ((memq head '( progn inline save-excursion save-restriction
                                 save-current-buffer))
-                  (setq form (car (last form)))
+                  (setq form (car (last (cdr form))))
                   t)
-                 ((memq head '(let let* setq setcar setcdr))
+                 ((memq head '(let let*))
                   (setq form (car (last (cddr form))))
                   t)
                  ((memq head '( prog1 unwind-protect copy-sequence identity
                                 reverse nreverse sort))
                   (setq form (nth 1 form))
                   t)
-                 ((eq head 'mapc)
+                 ((memq head '(mapc setq setcar setcdr puthash))
                   (setq form (nth 2 form))
+                  t)
+                 ((memq head '(aset put function-put))
+                  (setq form (nth 3 form))
                   t))))
   form)
 
@@ -757,17 +760,18 @@ for speeding up processing.")
                            format format-message
                            substring substring-no-properties string-replace
                            replace-regexp-in-string symbol-name make-symbol
-                           compare-strings
+                           compare-strings string-distance
                            mapconcat
                            vector make-vector vconcat make-record record
                            regexp-quote regexp-opt
                            buffer-string buffer-substring
                            buffer-substring-no-properties
-                           current-buffer buffer-size
+                           current-buffer buffer-size get-buffer-create
                            point point-min point-max buffer-end count-lines
-                           following-char preceding-char max-char
+                           following-char preceding-char get-byte max-char
                            region-beginning region-end
                            line-beginning-position line-end-position
+                           pos-bol pos-eol
                            + - * / % 1+ 1- min max abs mod expt logb
                            logand logior logxor lognot ash logcount
                            floor ceiling round truncate
@@ -783,11 +787,13 @@ for speeding up processing.")
                            string-as-multibyte string-as-unibyte
                            string-to-multibyte string-to-unibyte
                            string-make-multibyte string-make-unibyte
+                           string-width char-width
                            make-hash-table hash-table-count
                            unibyte-char-to-multibyte multibyte-char-to-unibyte
                            sxhash sxhash-equal sxhash-eq sxhash-eql
                            sxhash-equal-including-properties
                            make-marker copy-marker point-marker mark-marker
+                           kbd key-description
                            always))
                   t)
                  ((eq head 'if)
@@ -1586,7 +1592,7 @@ See Info node `(elisp) Integer Basics'."
         keymap-parent
          lax-plist-get ldexp
          length length< length> length=
-         line-beginning-position line-end-position
+         line-beginning-position line-end-position pos-bol pos-eol
         local-variable-if-set-p local-variable-p locale-info
         log log10 logand logb logcount logior lognot logxor lsh
         make-byte-code make-list make-string make-symbol mark marker-buffer max
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 4a2860cd43..9a56ba0f7a 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -568,7 +568,6 @@ ACCESS-TYPE if non-nil should specify the kind of access 
that will trigger
        (purecopy (list current-name access-type when)))
   obsolete-name)
 
-
 (defmacro define-obsolete-variable-alias ( obsolete-name current-name when
                                            &optional docstring)
   "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 1115ce391d..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))))
                ""))
@@ -1355,16 +1356,22 @@ FORMAT and ARGS are as in `byte-compile-warn'."
   (let ((byte-compile-form-stack (cons arg byte-compile-form-stack)))
     (apply #'byte-compile-warn format args)))
 
-(defun byte-compile-warn-obsolete (symbol)
-  "Warn that SYMBOL (a variable or function) is obsolete."
+(defun byte-compile-warn-obsolete (symbol type)
+  "Warn that SYMBOL (a variable, function or generalized variable) is obsolete.
+TYPE is a string that say which one of these three types it is."
   (when (byte-compile-warning-enabled-p 'obsolete symbol)
-    (let* ((funcp (get symbol 'byte-obsolete-info))
-           (msg (macroexp--obsolete-warning
-                 symbol
-                 (or funcp (get symbol 'byte-obsolete-variable))
-                 (if funcp "function" "variable"))))
-      (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
-       (byte-compile-warn-x symbol "%s" msg)))))
+    (byte-compile-warn-x
+     symbol "%s"
+     (macroexp--obsolete-warning
+      symbol
+      (pcase type
+        ("function"
+         (get symbol 'byte-obsolete-info))
+        ("variable"
+         (get symbol 'byte-obsolete-variable))
+        ("generalized variable"
+         (get symbol 'byte-obsolete-generalized-variable)))
+      type))))
 
 (defun byte-compile-report-error (error-info &optional fill)
   "Report Lisp error in compilation.
@@ -1468,8 +1475,8 @@ when printing the error message."
 
 (defun byte-compile-function-warn (f nargs def)
   (when (and (get f 'byte-obsolete-info)
-             (byte-compile-warning-enabled-p 'obsolete f))
-    (byte-compile-warn-obsolete f))
+             (not (memq f byte-compile-not-obsolete-funcs)))
+    (byte-compile-warn-obsolete f "function"))
 
   ;; Check to see if the function will be available at runtime
   ;; and/or remember its arity if it's unknown.
@@ -3604,7 +3611,7 @@ lambda-expression."
                   ('set (not (eq access-type 'reference)))
                   ('get (eq access-type 'reference))
                   (_ t))))
-        (byte-compile-warn-obsolete var))))
+        (byte-compile-warn-obsolete var "variable"))))
 
 (defsubst byte-compile-dynamic-variable-op (base-op var)
   (let ((tmp (assq var byte-compile-variables)))
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index ac6cbb53a5..9ff893b75b 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -112,7 +112,7 @@ too much in text characters anyways.")
        (set-face-foreground nf "black")
        (if (and chart-face-use-pixmaps pl)
            (condition-case nil
-               (set-face-background-pixmap nf (car pl))
+               (set-face-stipple nf (car pl))
              (error (message "Cannot set background pixmap %s" (car pl)))))
        (push nf faces)
        (setq cl (cdr cl)
@@ -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/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 304ea8cc6c..e10443588e 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -347,11 +347,18 @@ Useful to hook into pass checkers.")
     (current-local-map (function () (or cons null)))
     (current-minor-mode-maps (function () (or cons null)))
     (current-time (function () cons))
-    (current-time-string (function (&optional string boolean) string))
-    (current-time-zone (function (&optional string boolean) cons))
+    (current-time-string (function (&optional (or number list)
+                                              (or symbol string cons integer))
+                                   string))
+    (current-time-zone (function (&optional (or number list)
+                                            (or symbol string cons integer))
+                                 cons))
     (custom-variable-p (function (symbol) boolean))
     (decode-char (function (cons t) (or fixnum null)))
-    (decode-time (function (&optional string symbol symbol) cons))
+    (decode-time (function (&optional (or number list)
+                                      (or symbol string cons integer)
+                                      symbol)
+                           cons))
     (default-boundp (function (symbol) boolean))
     (default-value (function (symbol) t))
     (degrees-to-radians (function (number) float))
@@ -383,12 +390,14 @@ Useful to hook into pass checkers.")
     (file-writable-p (function (string) boolean))
     (fixnump (function (t) boolean))
     (float (function (number) float))
-    (float-time (function (&optional cons) float))
+    (float-time (function (&optional (or number list)) float))
     (floatp (function (t) boolean))
     (floor (function (number &optional number) integer))
     (following-char (function () fixnum))
     (format (function (string &rest t) string))
-    (format-time-string (function (string &optional cons symbol) string))
+    (format-time-string (function (string &optional (or number list)
+                                          (or symbol string cons integer))
+                                  string))
     (frame-first-window (function ((or frame window)) window))
     (frame-root-window (function (&optional (or frame window)) window))
     (frame-selected-window (function (&optional (or frame window)) window))
@@ -542,7 +551,8 @@ Useful to hook into pass checkers.")
     (this-command-keys-vector (function () vector))
     (this-single-command-keys (function () vector))
     (this-single-command-raw-keys (function () vector))
-    (time-convert (function (t &optional (or boolean integer)) cons))
+    (time-convert (function ((or number list) &optional (or symbol integer))
+                            (or cons number)))
     (truncate (function (number &optional number) integer))
     (type-of (function (t) symbol))
     (unibyte-char-to-multibyte (function (fixnum) fixnum)) ;; byte is fixnum
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 43ce1872f9..41e3a197af 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -492,25 +492,11 @@ To implement dynamic menus, either call this from
 `menu-bar-update-hook' or use a menu filter."
   (easy-menu-add-item map path (easy-menu-create-menu name items) before))
 
-(defalias 'easy-menu-remove #'ignore
-  "Remove MENU from the current menu bar.
-Contrary to XEmacs, this is a nop on Emacs since menus are automatically
-\(de)activated when the corresponding keymap is (de)activated.
-
-\(fn MENU)")
+(defalias 'easy-menu-remove #'ignore)
 (make-obsolete 'easy-menu-remove "this was always a no-op in Emacs \
 and can be safely removed." "28.1")
 
-(defalias 'easy-menu-add #'ignore
-  "Add the menu to the menubar.
-On Emacs this is a nop, because menus are already automatically
-activated when the corresponding keymap is activated.  On XEmacs
-this is needed to actually add the menu to the current menubar.
-
-You should call this once the menu and keybindings are set up
-completely and menu filter functions can be expected to work.
-
-\(fn MENU &optional MAP)")
+(defalias 'easy-menu-add #'ignore)
 (make-obsolete 'easy-menu-add "this was always a no-op in Emacs \
 and can be safely removed." "28.1")
 
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 54ddc7ac75..770cdb3d4f 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -92,6 +92,9 @@ DO must return an Elisp expression."
    (t
     (let* ((head (car place))
            (gf (function-get head 'gv-expander 'autoload)))
+      (when (and (symbolp head)
+                 (get head 'byte-obsolete-generalized-variable))
+        (byte-compile-warn-obsolete head "generalized variable"))
       (if gf (apply gf do (cdr place))
         (let ((me (macroexpand-1 place
                                  ;; (append macroexpand-all-environment
@@ -166,6 +169,18 @@ arguments as NAME.  DO is a function as defined in 
`gv-get'."
         ;; (`(expand ,expander) `(gv-define-expand ,name ,expander))
         (_ (message "Unknown %s declaration %S" symbol handler) nil))))
 
+(defun make-obsolete-generalized-variable (obsolete-name current-name when)
+  "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete.
+The warning will say that CURRENT-NAME should be used instead.
+
+If CURRENT-NAME is a string, that is the `use instead' message.
+
+WHEN should be a string indicating when the variable was first
+made obsolete, for example a date or a release number."
+  (put obsolete-name 'byte-obsolete-generalized-variable
+       (purecopy (list current-name when)))
+  obsolete-name)
+
 ;; Additions for `declare'.  We specify the values as named aliases so
 ;; that `describe-variable' prints something useful; cf. Bug#40491.
 
@@ -392,6 +407,7 @@ The return value is the last VAL in the list.
 (gv-define-setter buffer-local-value (val var buf)
   (macroexp-let2 nil v val
     `(with-current-buffer ,buf (set (make-local-variable ,var) ,v))))
+(make-obsolete-generalized-variable 'buffer-local-value nil "29.1")
 
 (gv-define-expander alist-get
   (lambda (do key alist &optional default remove testfn)
@@ -618,71 +634,158 @@ REF must have been previously obtained with `gv-ref'."
 
 ;; Some Emacs-related place types.
 (gv-define-simple-setter buffer-file-name set-visited-file-name t)
+(make-obsolete-generalized-variable
+ 'buffer-file-name 'set-visited-file-name "29.1")
+
 (gv-define-setter buffer-modified-p (flag &optional buf)
   (macroexp-let2 nil buffer `(or ,buf (current-buffer))
     `(with-current-buffer ,buffer
        (set-buffer-modified-p ,flag))))
+(make-obsolete-generalized-variable
+ 'buffer-modified-p 'set-buffer-modified-p "29.1")
+
 (gv-define-simple-setter buffer-name rename-buffer t)
+(make-obsolete-generalized-variable 'buffer-name 'rename-buffer "29.1")
+
 (gv-define-setter buffer-string (store)
   `(insert (prog1 ,store (erase-buffer))))
+(make-obsolete-generalized-variable 'buffer-string nil "29.1")
+
 (gv-define-simple-setter buffer-substring cl--set-buffer-substring)
+(make-obsolete-generalized-variable 'buffer-substring nil "29.1")
+
 (gv-define-simple-setter current-buffer set-buffer)
+(make-obsolete-generalized-variable 'current-buffer 'set-buffer "29.1")
+
 (gv-define-simple-setter current-column move-to-column t)
+(make-obsolete-generalized-variable 'current-column 'move-to-column "29.1")
+
 (gv-define-simple-setter current-global-map use-global-map t)
+(make-obsolete-generalized-variable 'current-global-map 'use-global-map "29.1")
+
 (gv-define-setter current-input-mode (store)
   `(progn (apply #'set-input-mode ,store) ,store))
+(make-obsolete-generalized-variable 'current-input-mode nil "29.1")
+
 (gv-define-simple-setter current-local-map use-local-map t)
+(make-obsolete-generalized-variable 'current-local-map 'use-local-map "29.1")
+
 (gv-define-simple-setter current-window-configuration
                          set-window-configuration t)
+(make-obsolete-generalized-variable
+ 'current-window-configuration 'set-window-configuration "29.1")
+
 (gv-define-simple-setter default-file-modes set-default-file-modes t)
+(make-obsolete-generalized-variable
+ 'default-file-modes 'set-default-file-modes "29.1")
+
 (gv-define-simple-setter documentation-property put)
+(make-obsolete-generalized-variable 'documentation-property 'put "29.1")
+
 (gv-define-setter face-background (x f &optional s)
   `(set-face-background ,f ,x ,s))
 (gv-define-setter face-background-pixmap (x f &optional s)
-  `(set-face-background-pixmap ,f ,x ,s))
+  `(set-face-stipple ,f ,x ,s))
+(make-obsolete-generalized-variable 'face-background-pixmap 'face-stipple 
"29.1")
+(gv-define-setter face-stipple (x f &optional s)
+  `(set-face-stipple ,f ,x ,s))
 (gv-define-setter face-font (x f &optional s) `(set-face-font ,f ,x ,s))
 (gv-define-setter face-foreground (x f &optional s)
   `(set-face-foreground ,f ,x ,s))
 (gv-define-setter face-underline-p (x f &optional s)
   `(set-face-underline ,f ,x ,s))
 (gv-define-simple-setter file-modes set-file-modes t)
+
 (gv-define-setter frame-height (x &optional frame)
   `(set-frame-height (or ,frame (selected-frame)) ,x))
+(make-obsolete-generalized-variable 'frame-height 'set-frame-height "29.1")
+
 (gv-define-simple-setter frame-parameters modify-frame-parameters t)
 (gv-define-simple-setter frame-visible-p cl--set-frame-visible-p)
+(make-obsolete-generalized-variable 'frame-visible-p nil "29.1")
+
 (gv-define-setter frame-width (x &optional frame)
   `(set-frame-width (or ,frame (selected-frame)) ,x))
 (gv-define-simple-setter getenv setenv t)
 (gv-define-simple-setter get-register set-register)
+
 (gv-define-simple-setter global-key-binding global-set-key)
+(make-obsolete-generalized-variable 'global-key-binding 'global-set-key "29.1")
+
 (gv-define-simple-setter local-key-binding local-set-key)
+(make-obsolete-generalized-variable 'local-key-binding 'local-set-key "29.1")
+
 (gv-define-simple-setter mark set-mark t)
+(make-obsolete-generalized-variable 'mark 'set-mark "29.1")
+
 (gv-define-simple-setter mark-marker set-mark t)
+(make-obsolete-generalized-variable 'mark-marker 'set-mark "29.1")
+
 (gv-define-simple-setter marker-position set-marker t)
+(make-obsolete-generalized-variable 'marker-position 'set-marker "29.1")
+
 (gv-define-setter mouse-position (store scr)
   `(set-mouse-position ,scr (car ,store) (cadr ,store)
                        (cddr ,store)))
+(make-obsolete-generalized-variable 'mouse-position 'set-mouse-position "29.1")
+
 (gv-define-simple-setter point goto-char)
+(make-obsolete-generalized-variable 'point 'goto-char "29.1")
+
 (gv-define-simple-setter point-marker goto-char t)
+(make-obsolete-generalized-variable 'point-marker 'goto-char "29.1")
+
 (gv-define-setter point-max (store)
   `(progn (narrow-to-region (point-min) ,store) ,store))
+(make-obsolete-generalized-variable 'point-max 'narrow-to-region "29.1")
+
 (gv-define-setter point-min (store)
   `(progn (narrow-to-region ,store (point-max)) ,store))
+(make-obsolete-generalized-variable 'point-min 'narrow-to-region "29.1")
+
 (gv-define-setter read-mouse-position (store scr)
   `(set-mouse-position ,scr (car ,store) (cdr ,store)))
+(make-obsolete-generalized-variable
+ 'read-mouse-position 'set-mouse-position "29.1")
+
 (gv-define-simple-setter screen-height set-screen-height t)
+(make-obsolete-generalized-variable 'screen-height 'set-screen-height "29.1")
+
 (gv-define-simple-setter screen-width set-screen-width t)
+(make-obsolete-generalized-variable 'screen-width 'set-screen-width "29.1")
+
 (gv-define-simple-setter selected-window select-window)
+(make-obsolete-generalized-variable 'selected-window 'select-window "29.1")
+
 (gv-define-simple-setter selected-screen select-screen)
+(make-obsolete-generalized-variable 'selected-screen 'select-screen "29.1")
+
 (gv-define-simple-setter selected-frame select-frame)
+(make-obsolete-generalized-variable 'selected-frame 'select-frame "29.1")
+
 (gv-define-simple-setter standard-case-table set-standard-case-table)
+(make-obsolete-generalized-variable
+ 'standard-case-table 'set-standard-case-table "29.1")
+
 (gv-define-simple-setter syntax-table set-syntax-table)
+(make-obsolete-generalized-variable 'syntax-table 'set-syntax-table "29.1")
+
 (gv-define-simple-setter visited-file-modtime set-visited-file-modtime t)
+(make-obsolete-generalized-variable
+ 'visited-file-modtime 'set-visited-file-modtime "29.1")
+
 (gv-define-setter window-height (store)
   `(progn (enlarge-window (- ,store (window-height))) ,store))
+(make-obsolete-generalized-variable 'window-height 'enlarge-window "29.1")
+
 (gv-define-setter window-width (store)
   `(progn (enlarge-window (- ,store (window-width)) t) ,store))
+(make-obsolete-generalized-variable 'window-width 'enlarge-window "29.1")
+
 (gv-define-simple-setter x-get-secondary-selection x-own-secondary-selection t)
+(make-obsolete-generalized-variable
+ 'x-get-secondary-selection 'x-own-secondary-selection "29.1")
+
 
 ;; More complex setf-methods.
 
diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el
index 277b285c2e..93749a3451 100644
--- a/lisp/emacs-lisp/icons.el
+++ b/lisp/emacs-lisp/icons.el
@@ -189,8 +189,10 @@ present if the icon is represented by an image."
 (cl-defmethod icons--create ((_type (eql 'image)) icon keywords)
   (let ((file (if (file-name-absolute-p icon)
                   icon
-                (image-search-load-path icon))))
+                (and (fboundp 'image-search-load-path)
+                     (image-search-load-path icon)))))
     (and (display-images-p)
+         (fboundp 'image-supported-file-p)
          (image-supported-file-p file)
          (propertize
           " " 'display
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index c56a9660e7..c906ee6e31 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -728,67 +728,30 @@ font-lock keywords will not be case sensitive."
            len))))
 
 (defun lisp-current-defun-name ()
-  "Return the name of the defun at point.
-If there is no defun at point, return the first symbol from the
-top-level form.  If there is no top-level form, return nil.
-
-(\"defun\" here means \"form that defines something\", and is
-decided heuristically.)"
+  "Return the name of the defun at point, or nil."
   (save-excursion
-    (let ((location (point))
-          name)
+    (let ((location (point)))
       ;; If we are now precisely at the beginning of a defun, make sure
       ;; beginning-of-defun finds that one rather than the previous one.
-      (unless (eobp)
-        (forward-char 1))
+      (or (eobp) (forward-char 1))
       (beginning-of-defun)
       ;; Make sure we are really inside the defun found, not after it.
-      (when (and (looking-at "(")
-                (progn
-                   (end-of-defun)
-                  (< location (point)))
-                (progn
-                   (forward-sexp -1)
-                  (>= location (point))))
-       (when (looking-at "(")
-         (forward-char 1))
-       ;; Read the defining construct name, typically "defun" or
+      (when (and (looking-at "\\s(")
+                (progn (end-of-defun)
+                       (< location (point)))
+                (progn (forward-sexp -1)
+                       (>= location (point))))
+       (if (looking-at "\\s(")
+           (forward-char 1))
+       ;; Skip the defining construct name, typically "defun" or
        ;; "defvar".
-        (let ((symbol (ignore-errors (read (current-buffer)))))
-          (when (and symbol (not (symbolp symbol)))
-            (setq symbol nil))
-          ;; If there's an edebug spec, use that to determine what the
-          ;; name is.
-          (when symbol
-            (let ((spec (or (get symbol 'edebug-form-spec)
-                            (and (eq (get symbol 'lisp-indent-function) 'defun)
-                                 (get 'defun 'edebug-form-spec)))))
-              (save-excursion
-                (when (and (eq (car-safe spec) '&define)
-                           (memq 'name spec))
-                  (pop spec)
-                  (while (and spec (not name))
-                    (let ((candidate (ignore-errors (read (current-buffer)))))
-                      (when (eq (pop spec) 'name)
-                        (when (and (consp candidate)
-                                   (symbolp (car (delete 'quote candidate))))
-                          (setq candidate (car (delete 'quote candidate))))
-                        (setq name candidate
-                              spec nil))))))))
-          ;; We didn't have an edebug spec (or couldn't find the
-          ;; name).  If the symbol starts with \"def\", then it's
-          ;; likely that the next symbol is the name.
-          (when (and (not name)
-                     (string-match-p "\\(\\`\\|-\\)def" (symbol-name symbol)))
-            (when-let ((candidate (ignore-errors (read (current-buffer)))))
-              (cond
-               ((symbolp candidate)
-                (setq name candidate))
-               ((and (consp candidate)
-                     (symbolp (car (delete 'quote candidate))))
-                (setq name (car (delete 'quote candidate)))))))
-          (when-let ((result (or name symbol)))
-            (and (symbolp result) (symbol-name result))))))))
+       (forward-sexp 1)
+       ;; The second element is usually a symbol being defined.  If it
+       ;; is not, use the first symbol in it.
+       (skip-chars-forward " \t\n'(")
+       (buffer-substring-no-properties (point)
+                                       (progn (forward-sexp 1)
+                                              (point)))))))
 
 (defvar-keymap lisp-mode-shared-map
   :doc "Keymap for commands shared by all sorts of Lisp modes."
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 4b5363d8f6..e6e8bb202d 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -738,8 +738,7 @@ If SUBEXP is non-nil mark only the corresponding 
sub-expressions."
           (let ((face (get-text-property (1- (point)) 'face)))
             (when (or (and (listp face)
                            (memq 'font-lock-string-face face))
-                      (eq 'font-lock-string-face face)
-                      t)
+                      (eq 'font-lock-string-face face))
               (throw 'found t))))))))
 
 (defface reb-regexp-grouping-backslash
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index acf294ede1..990dabe351 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -941,10 +941,10 @@ A FUNC form can have any number of `:no-eval' (or 
`:no-value'),
    :eval (point-min))
   (point-max
    :eval (point-max))
-  (eol
-   :eval (eol))
-  (bol
-   :eval (bol))
+  (pos-bol
+   :eval (pos-bol))
+  (pos-eol
+   :eval (pos-eol))
   (bolp
    :eval (bolp))
   (eolp
@@ -984,8 +984,13 @@ A FUNC form can have any number of `:no-eval' (or 
`:no-value'),
   (following-char
    :no-eval (following-char)
    :eg-result 67)
+  (preceding-char
+   :no-eval (preceding-char)
+   :eg-result 38)
   (char-after
    :eval (char-after 45))
+  (char-before
+   :eval (char-before 13))
   (get-byte
    :no-eval (get-byte 45)
    :eg-result-string "#xff")
@@ -994,6 +999,8 @@ A FUNC form can have any number of `:no-eval' (or 
`:no-value'),
    :no-value (delete-region (point-min) (point-max)))
   (erase-buffer
    :no-value (erase-buffer))
+  (delete-line
+   :no-value (delete-line))
   (insert
    :no-value (insert "This string will be inserted in the buffer\n"))
   (subst-char-in-region
diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index 9868d8c4ec..c01f3fd4fe 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -465,7 +465,7 @@ changing `tabulated-list-sort-key'."
       (let* ((elt (car entries))
              (tabulated-list--near-rows
               (list
-               (or (tabulated-list-get-entry (point-at-bol 0)) (cadr elt))
+               (or (tabulated-list-get-entry (pos-bol 0)) (cadr elt))
                (cadr elt)
                (or (cadr (cadr entries)) (cadr elt))))
              (id (car elt)))
@@ -519,7 +519,7 @@ of column descriptors."
        (insert (make-string x ?\s)))
     (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506).
            (or (bound-and-true-p tabulated-list--near-rows)
-               (list (or (tabulated-list-get-entry (point-at-bol 0))
+               (list (or (tabulated-list-get-entry (pos-bol 0))
                          cols)
                      cols))))
       (dotimes (n ncols)
@@ -611,7 +611,7 @@ This function only changes the buffer contents; it does not 
alter
         (cols (tabulated-list-get-entry))
         (inhibit-read-only t))
     (when cols
-      (delete-region (line-beginning-position) (1+ (line-end-position)))
+      (delete-region (pos-bol) (1+ (pos-eol)))
       (list id cols))))
 
 (defun tabulated-list-set-col (col desc &optional change-entry-data)
@@ -625,8 +625,8 @@ by setting the appropriate slot of the vector originally 
used to
 print this entry.  If `tabulated-list-entries' has a list value,
 this is the vector stored within it."
   (let* ((opoint (point))
-        (eol    (line-end-position))
-        (pos    (line-beginning-position))
+         (eol    (pos-eol))
+         (pos    (pos-bol))
         (id     (tabulated-list-get-id pos))
         (entry  (tabulated-list-get-entry pos))
         (prop 'tabulated-list-column-name)
@@ -651,9 +651,9 @@ this is the vector stored within it."
       (goto-char pos)
       (let ((tabulated-list--near-rows
              (list
-              (tabulated-list-get-entry (point-at-bol 0))
+              (tabulated-list-get-entry (pos-bol 0))
               entry
-              (or (tabulated-list-get-entry (point-at-bol 2)) entry))))
+              (or (tabulated-list-get-entry (pos-bol 2)) entry))))
         (tabulated-list-print-col col desc (current-column)))
       (if change-entry-data
          (aset entry col desc))
@@ -785,7 +785,7 @@ If ARG is provided, move that many columns."
     (let ((prev (or (previous-single-property-change
                      (point) 'tabulated-list-column-name)
                     1)))
-      (unless (< prev (line-beginning-position))
+      (unless (< prev (pos-bol))
         (goto-char prev)))))
 
 ;;; The mode definition:
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/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 27703976f6..e5977c9580 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -501,7 +501,7 @@ Returns what was actually sent, or nil if nothing was sent."
     (condition-case nil
         (process-send-string target object)
       ;; If `process-send-string' raises an error, treat it as a broken pipe.
-      (error (signal 'eshell-pipe-broken target))))
+      (error (signal 'eshell-pipe-broken (list target)))))
 
    ((consp target)
     (apply (car target) object (cdr target))))
diff --git a/lisp/faces.el b/lisp/faces.el
index 390ddbf606..0246e038dd 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1,6 +1,6 @@
 ;;; faces.el --- Lisp faces -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992-1996, 1998-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -583,9 +583,6 @@ with the `default' face (which is always completely 
specified)."
                               nil))
 
 
-(defalias 'face-background-pixmap 'face-stipple)
-
-
 (defun face-underline-p (face &optional frame inherit)
  "Return non-nil if FACE specifies a non-nil underlining.
 If the optional argument FRAME is given, report on face FACE in that frame.
@@ -1053,9 +1050,6 @@ Use `set-face-attribute' to \"unspecify\" underlining."
   (set-face-attribute face frame :extend extend-p))
 
 
-(defalias 'set-face-background-pixmap 'set-face-stipple)
-
-
 (defun invert-face (face &optional frame)
   "Swap the foreground and background colors of FACE.
 If FRAME is omitted or nil, it means change face on all frames.
@@ -3179,6 +3173,9 @@ also the same size as FACE on FRAME, or fail."
   :group 'display)
 (make-obsolete-variable 'font-list-limit nil "24.3")
 
+(define-obsolete-function-alias 'face-background-pixmap #'face-stipple "29.1")
+(define-obsolete-function-alias 'set-face-background-pixmap #'set-face-stipple 
"29.1")
+
 (provide 'faces)
 
 ;;; faces.el ends here
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/files.el b/lisp/files.el
index 05a924a363..cf2a522193 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -396,19 +396,24 @@ add a final newline, whenever you save a file that really 
needs one."
      ;; transformed to "/2" on DOS/Windows.
      ,(concat temporary-file-directory "\\2") t))
   "Transforms to apply to buffer file name before making auto-save file name.
+
 Each transform is a list (REGEXP REPLACEMENT UNIQUIFY):
+
 REGEXP is a regular expression to match against the file name.
 If it matches, `replace-match' is used to replace the
 matching part with REPLACEMENT.
-If the optional element UNIQUIFY is non-nil, the auto-save file name is
-constructed by taking the directory part of the replaced file-name,
-concatenated with the buffer file name with all directory separators
-changed to `!' to prevent clashes.  This will not work
-correctly if your filesystem truncates the resulting name.
-If UNIQUIFY is one of the members of `secure-hash-algorithms',
-Emacs constructs the nondirectory part of the auto-save file name
-by applying that `secure-hash' to the buffer file name.  This
-avoids any risk of excessively long file names.
+
+If the optional element UNIQUIFY is nil, Emacs does not check for
+file name clashes, so using that is not recommended.  If UNIQUIFY
+is one of the members of `secure-hash-algorithms', Emacs
+constructs the nondirectory part of the auto-save file name by
+applying that `secure-hash' to the buffer file name.  This avoids
+any risk of excessively long file names.  Finally, if UNIQUIFY is
+any other value the auto-save file name is constructed by taking
+the directory part of the replaced file-name, concatenated with
+the buffer file name with all directory separators changed to `!'
+to prevent clashes.  This will not work correctly if your
+filesystem truncates the resulting name.
 
 All the transforms in the list are tried, in the order they are listed.
 When one transform applies, its result is final;
@@ -421,8 +426,13 @@ editing a remote file.
 On MS-DOS filesystems without long names this variable is always
 ignored."
   :group 'auto-save
-  :type '(repeat (list (regexp :tag "Regexp") (string :tag "Replacement")
-                                          (boolean :tag "Uniquify")))
+  :type `(repeat (list (regexp :tag "Regexp")
+                       (string :tag "Replacement")
+                       (choice
+                       (const :tag "Uniquify" t)
+                        ,@(mapcar (lambda (algo)
+                                    (list 'const algo))
+                                  (secure-hash-algorithms)))))
   :initialize 'custom-initialize-delay
   :version "21.1")
 
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 809592413d..614ff420f2 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -189,8 +189,19 @@ filename that EXTRACT returned."
 (defcustom ff-other-file-alist 'cc-other-file-alist
   "Alist of extensions to find given the current file's extension.
 
-This list should contain the most used extensions before the others,
-since the search algorithm searches sequentially through each
+The value could be an alist or a symbol whose value is an alist.
+Each element of the alist has the form
+
+   (REGEXP (EXTENSION...))
+or
+   (REGEXP FUNCTION)
+
+where REGEXP is the regular expression matching a file's extension,
+EXTENSIONs is the list of literal file-name extensions to search for,
+and FUNCTION is a function of one argument, the current file's name,
+that returns the list of extensions to search for.
+The list of extensions should contain the most used extensions before the
+others, since the search algorithm searches sequentially through each
 directory specified in `ff-search-directories'.  If a file is not found,
 a new one is created with the first matching extension (`.cc' yields `.hh').
 This alist should be set by the major mode."
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/help-fns.el b/lisp/help-fns.el
index 74e18285e6..1ccf9bb428 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1155,6 +1155,17 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED 
REAL-DEF)."
 (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode)
 (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro 100)
 
+(defun help-fns--generalized-variable (function)
+  (when (and (get function 'gv-expander)
+             ;; Don't mention obsolete generalized variables.
+             (not (get function 'byte-obsolete-generalized-variable)))
+    (insert (format-message "  `%s' is also a " function)
+            (buttonize "generalized variable"
+                       (lambda (_) (info "(elisp)Generalized Variables")))
+            ".\n")))
+(add-hook 'help-fns-describe-function-functions
+          #'help-fns--generalized-variable)
+
 
 ;; Variables
 
diff --git a/lisp/image.el b/lisp/image.el
index de2afdc2c7..9311125450 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -32,6 +32,8 @@
   :group 'multimedia)
 
 (declare-function image-flush "image.c" (spec &optional frame))
+(declare-function clear-image-cache "image.c"
+                  (&optional filter animation-cache))
 
 (defconst image-type-header-regexps
   `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 855f5a25b1..07dfc23a09 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -2714,6 +2714,11 @@ Normally you should let-bind `byte-compile-warnings' 
before calling this,
 else the global value will be modified.
 
 (fn WARNING)")
+(autoload 'byte-compile-warn-obsolete "bytecomp" "\
+Warn that SYMBOL (a variable, function or generalized variable) is obsolete.
+TYPE is a string that say which one of these three types it is.
+
+(fn SYMBOL TYPE)")
 (autoload 'byte-force-recompile "bytecomp" "\
 Recompile every `.el' file in DIRECTORY that already has a `.elc' file.
 Files in subdirectories of DIRECTORY are processed also.
@@ -5150,13 +5155,9 @@ PersistMoniker=file://Folder.htt
 (fn)" t)
 (autoload 'conf-javaprop-mode "conf-mode" "\
 Conf Mode starter for Java properties files.
-Comments start with `#' but are also recognized with `//' or
-between `/*' and `*/'.
-For details see `conf-mode'.  Example:
+Comments start with `#'.  Example:
 
 # Conf mode font-locks this right with \\[conf-javaprop-mode] (Java properties)
-// another kind of comment
-/* yet another */
 
 name:value
 name=value
@@ -14553,7 +14554,7 @@ simple PLACEs such as (symbol-function \\='foo) which 
will also work in dynamic
 binding mode.
 
 (fn PLACE)" nil t)
-(register-definition-prefixes "gv" '("gv-"))
+(register-definition-prefixes "gv" '("gv-" 
"make-obsolete-generalized-variable"))
 
 
 ;;; Generated autoloads from play/handwrite.el
@@ -17086,9 +17087,8 @@ Key bindings:
 (autoload 'image-minor-mode "image-mode" "\
 Toggle Image minor mode in this buffer.
 
-Image minor mode provides the key \\<image-mode-map>\\[image-toggle-display],
-to switch back to `image-mode' and display an image file as the
-actual image.
+Image minor mode provides the key \\<image-mode-map>\\[image-toggle-display], 
to switch back to
+`image-mode' and display an image file as the actual image.
 
 This is a minor mode.  If called interactively, toggle the `Image
 minor mode' mode.  If the prefix argument is positive, enable the
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 6cc99c2134..d72809b186 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -387,10 +387,12 @@ copy text to your preferred mail program.\n"
     (goto-char user-point)))
 
 (defun emacs-bug--system-description ()
-  (insert "\nIn " (emacs-version))
-  (if emacs-build-system
-      (insert " built on " emacs-build-system))
-  (insert "\n")
+  (let ((start (point)))
+    (insert "\nIn " (emacs-version))
+    (if emacs-build-system
+        (insert " built on " emacs-build-system))
+    (insert "\n")
+    (fill-region-as-paragraph start (point)))
 
   (if (stringp emacs-repository-version)
       (insert "Repository revision: " emacs-repository-version "\n"))
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/rmailmm.el b/lisp/mail/rmailmm.el
index 79f421bdcd..416f7d1ea8 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -796,8 +796,9 @@ directly."
      ((string-match "text/" content-type)
       (setq type 'text))
      ((string-match "image/\\(.*\\)" content-type)
-      (setq type (image-supported-file-p
-                 (concat "." (match-string 1 content-type))))
+      (setq type (and (fboundp 'image-supported-file-p)
+                      (image-supported-file-p
+                      (concat "." (match-string 1 content-type)))))
       (when (and type
                  rmail-mime-show-images
                 (not (eq rmail-mime-show-images 'button))
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/mouse.el b/lisp/mouse.el
index bee664dc56..e38a4f8a71 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -869,6 +869,9 @@ must be one of the symbols `header', `mode', or `vertical'."
               map)
             t (lambda () (setq track-mouse old-track-mouse)))))))
 
+;; In no-X builds, dnd.el isn't preloaded.
+(autoload 'dnd-begin-file-drag "dnd")
+
 (defun mouse-drag-mode-line (start-event)
   "Change the height of a window by dragging on its mode line.
 START-EVENT is the starting mouse event of the drag action.
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/eudcb-ldap.el b/lisp/net/eudcb-ldap.el
index 1201c84f2d..86fe99f9e7 100644
--- a/lisp/net/eudcb-ldap.el
+++ b/lisp/net/eudcb-ldap.el
@@ -38,14 +38,6 @@
 
 ;;{{{      Internal cooking
 
-(defalias 'eudc-ldap-get-host-parameter
-  (if (fboundp 'ldap-get-host-parameter)
-      #'ldap-get-host-parameter
-    (lambda (host parameter)
-      "Get the value of PARAMETER for HOST in `ldap-host-parameters-alist'."
-      (plist-get (cdr (assoc host ldap-host-parameters-alist))
-                parameter))))
-
 (defvar eudc-ldap-attributes-translation-alist
   '((name . sn)
     (firstname . givenname)
@@ -209,7 +201,7 @@ attribute names are returned.  Default to `person'."
 
 (defun eudc-ldap-check-base ()
   "Check if the current LDAP server has a configured search base."
-  (unless (or (eudc-ldap-get-host-parameter eudc-server 'base)
+  (unless (or (ldap-get-host-parameter eudc-server 'base)
              ldap-default-base
               (null (y-or-n-p "No search base defined.  Configure it now?")))
     ;; If the server is not in ldap-host-parameters-alist we add it for the
@@ -224,6 +216,8 @@ attribute names are returned.  Default to `person'."
 
 (eudc-register-protocol 'ldap)
 
+(define-obsolete-function-alias 'eudc-ldap-get-host-parameter 
#'ldap-get-host-parameter "29.1")
+
 (provide 'eudcb-ldap)
 
 ;;; eudcb-ldap.el ends here
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-julia.el b/lisp/org/ob-julia.el
index 50a44bcf44..de69f25fc3 100644
--- a/lisp/org/ob-julia.el
+++ b/lisp/org/ob-julia.el
@@ -26,6 +26,9 @@
 ;; Org-Babel support for evaluating julia code
 ;;
 ;; Based on ob-R.el by Eric Schulte and Dan Davison.
+;;
+;; Session support requires the installation of the DataFrames and CSV
+;; Julia packages.
 
 ;;; Code:
 (require 'cl-lib)
@@ -62,6 +65,7 @@
 (defvar ess-current-process-name) ; dynamically scoped
 (defvar ess-local-process-name)   ; dynamically scoped
 (defvar ess-eval-visibly-p)       ; dynamically scoped
+(defvar ess-local-customize-alist); dynamically scoped
 (defun org-babel-edit-prep:julia (info)
   (let ((session (cdr (assq :session (nth 2 info)))))
     (when (and session
@@ -281,7 +285,8 @@ last statement in BODY, as elisp."
     (value
      (with-temp-buffer
        (insert (org-babel-chomp body))
-       (let ((ess-local-process-name
+       (let ((ess-local-customize-alist t)
+             (ess-local-process-name
              (process-name (get-buffer-process session)))
             (ess-eval-visibly-p nil))
         (ess-eval-buffer nil)))
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/oc-basic.el b/lisp/org/oc-basic.el
index 8c76e200e4..398d2e2d3f 100644
--- a/lisp/org/oc-basic.el
+++ b/lisp/org/oc-basic.el
@@ -460,12 +460,13 @@ substitutes for the unknown key.  Finally, it may be the 
symbol
         (_
          (lambda ()
            (interactive)
-           (setf (buffer-substring beg end)
-                 (concat "@"
-                         (if (= 1 (length suggestions))
-                             (car suggestions)
-                           (completing-read "Did you mean: "
-                                            suggestions nil t))))))))
+           (goto-char beg)
+           (delete-region beg end)
+           (insert "@"
+                   (if (= 1 (length suggestions))
+                       (car suggestions)
+                     (completing-read "Did you mean: "
+                                      suggestions nil t)))))))
     (put-text-property beg end 'keymap km)))
 
 (defun org-cite-basic-activate (citation)
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-plot.el b/lisp/org/org-plot.el
index 831c84befc..1912f6762a 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -621,7 +621,8 @@ manner suitable for prepending to a user-specified script."
   "Find any overlays for IMG-FILE in the current Org buffer, and refresh them."
   (dolist (img-overlay org-inline-image-overlays)
     (when (string= img-file (plist-get (cdr (overlay-get img-overlay 
'display)) :file))
-      (when (file-exists-p img-file)
+      (when (and (file-exists-p img-file)
+                 (fboundp 'image-flush))
         (image-flush (overlay-get img-overlay 'display))))))
 
 ;;-----------------------------------------------------------------------------
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-version.el b/lisp/org/org-version.el
index 915c3f63c7..353d533c06 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
 (defun org-git-version ()
   "The Git version of Org mode.
 Inserted by installing Org or when a release is made."
-   (let ((org-git-version "release_9.5.4-17-g6e991f"))
+   (let ((org-git-version "release_9.5.4-19-g4dff42"))
      org-git-version))
 
 (provide 'org-version)
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/org/ox-icalendar.el b/lisp/org/ox-icalendar.el
index a3fe31d7b8..7a62145076 100644
--- a/lisp/org/ox-icalendar.el
+++ b/lisp/org/ox-icalendar.el
@@ -276,14 +276,14 @@ re-read the iCalendar file.")
 ;;; Define Back-End
 
 (org-export-define-derived-backend 'icalendar 'ascii
-  :translate-alist '((clock . ignore)
-                    (footnote-definition . ignore)
-                    (footnote-reference . ignore)
+  :translate-alist '((clock . nil)
+                    (footnote-definition . nil)
+                    (footnote-reference . nil)
                     (headline . org-icalendar-entry)
                      (inner-template . org-icalendar-inner-template)
-                    (inlinetask . ignore)
-                    (planning . ignore)
-                    (section . ignore)
+                    (inlinetask . nil)
+                    (planning . nil)
+                    (section . nil)
                     (template . org-icalendar-template))
   :options-alist
   '((:exclude-tags
diff --git a/lisp/paren.el b/lisp/paren.el
index 4c268dbf77..d7580de9a9 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -149,7 +149,8 @@ use `show-paren-local-mode'."
 ;;;###autoload
 (define-minor-mode show-paren-local-mode
   "Toggle `show-paren-mode' only in this buffer."
-  :variable (buffer-local-value 'show-paren-mode (current-buffer))
+  :variable ( show-paren-mode .
+              (lambda (val) (setq-local show-paren-mode val)))
   (cond
    ((eq show-paren-mode (default-value 'show-paren-mode))
     (unless show-paren-mode
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 6dba733b9c..167cb4fabe 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -570,11 +570,12 @@ the height of the current window."
                                  (window-header-line-height)
                                  (- max-y delta))))
          (point (posn-point posn))
-         (up-point (save-excursion
-                     (goto-char point)
-                     (vertical-motion (- (1+ scroll-margin)))
-                     (point))))
-    (when (> (point) up-point)
+         (up-point (and point
+                        (save-excursion
+                          (goto-char point)
+                          (vertical-motion (- (1+ scroll-margin)))
+                          (point)))))
+    (when (and point (> (point) up-point))
       (when (let ((pos-visible (pos-visible-in-window-p up-point nil t)))
               (or (eq (length pos-visible) 2)
                   (when-let* ((posn (posn-at-point up-point))
@@ -665,10 +666,11 @@ window being scrolled by DELTA pixels with an animation."
   "Scroll the current window up by DELTA pixels."
   (let ((max-height (- (window-text-height nil t)
                        (frame-char-height))))
-    (while (> delta max-height)
-      (pixel-scroll-precision-scroll-up-page max-height)
-      (setq delta (- delta max-height)))
-    (pixel-scroll-precision-scroll-up-page delta)))
+    (when (> max-height 0)
+      (while (> delta max-height)
+        (pixel-scroll-precision-scroll-up-page max-height)
+        (setq delta (- delta max-height)))
+      (pixel-scroll-precision-scroll-up-page delta))))
 
 ;; FIXME: This doesn't _always_ work when there's an image above the
 ;; current line that is taller than the window, and scrolling can
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/play/gamegrid.el b/lisp/play/gamegrid.el
index 7a850b07ee..8da4205af5 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -1,6 +1,6 @@
 ;;; gamegrid.el --- library for implementing grid-based games on Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997-1998, 2001-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2022 Free Software Foundation, Inc.
 
 ;; Author: Glynn Clements <glynn@sensei.co.uk>
 ;; Old-Version: 1.02
@@ -72,7 +72,7 @@ directory will be used.")
 (defvar gamegrid-mono-x-face nil)
 (defvar gamegrid-mono-tty-face nil)
 
-(defvar gamegrid-glyph-height-mm 7.0
+(defvar gamegrid-glyph-height-mm 5.0
   "Desired glyph height in mm.")
 
 ;; ;;;;;;;;;;;;; glyph generation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -80,12 +80,24 @@ directory will be used.")
 (defun gamegrid-calculate-glyph-size ()
   "Calculate appropriate glyph size in pixels based on display resolution.
 Return a multiple of 8 no less than 16."
-  (if (and (display-pixel-height) (display-mm-height))
-      (let* ((y-pitch (/ (display-pixel-height) (float (display-mm-height))))
-             (pixels (* y-pitch gamegrid-glyph-height-mm))
-             (rounded (* (floor (/ (+ pixels 4) 8)) 8)))
-        (max 16 rounded))
-    16))
+  (let (atts
+        y-pitch)
+    (dolist (mon (display-monitor-attributes-list))
+      (when-let ((frames (alist-get 'frames mon))
+                 (match (memq (selected-frame) frames)))
+        (setq atts mon)))
+    (setq y-pitch (cond
+                   (atts
+                    (/ (nth 4 (assq 'geometry atts))
+                       (nth 2 (assq 'mm-size atts))
+                       (or (cdr (assq 'scale-factor atts)) 1.0)))
+                   ((and (display-pixel-height) (display-mm-height))
+                    (/ (display-pixel-height) (float (display-mm-height))))))
+    (if y-pitch
+        (let* ((pixels (* y-pitch gamegrid-glyph-height-mm))
+               (rounded (* (floor (/ (+ pixels 4) 8)) 8)))
+          (max 16 rounded))
+      16)))
 
 ;; Example of glyph in XPM format:
 ;;
@@ -251,7 +263,7 @@ format."
   (set-face-foreground face color)
   (set-face-background face color)
   (gamegrid-set-font face)
-  (set-face-background-pixmap face nil))
+  (set-face-stipple face nil))
 
 (defun gamegrid-make-mono-tty-face ()
   (let ((face (make-face 'gamegrid-mono-tty-face)))
@@ -336,7 +348,8 @@ format."
 
 (defun gamegrid-make-glyph (data-spec-list color-spec-list)
   (let ((data (gamegrid-match-spec-list data-spec-list))
-       (color (gamegrid-match-spec-list color-spec-list)))
+       (color (gamegrid-match-spec-list color-spec-list))
+        (image-scaling-factor 1.0))
     (cond ((characterp data)
           (vector data))
          ((eq data 'colorize)
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..9dc67010aa 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -383,7 +383,9 @@ be used instead.
                      (setq sexp nil))
                     (`(lambda ,args . ,body)
                      (elisp--local-variables-1
-                      (append (remq '&optional (remq '&rest args)) vars)
+                      (let ((args (if (listp args) args)))
+                        ;; FIXME: Exit the loop if witness is in args.
+                        (append (remq '&optional (remq '&rest args)) vars))
                       (car (last body))))
                     (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e))
                     (`(condition-case ,v ,_ . ,catches)
@@ -1899,7 +1901,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/python.el b/lisp/progmodes/python.el
index a545240805..e1347754c4 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5897,6 +5897,7 @@ REPORT-FN is Flymake's callback function."
   (add-hook 'flymake-diagnostic-functions #'python-flymake nil t))
 
 ;;; Completion predicates for M-x
+;; Commands that only make sense when editing Python code
 (dolist (sym '(python-check
                python-fill-paragraph
                python-indent-dedent-line
@@ -5928,6 +5929,13 @@ REPORT-FN is Flymake's callback function."
                python-shell-send-statement))
   (put sym 'completion-predicate #'python--completion-predicate))
 
+(defun python-shell--completion-predicate (_ buffer)
+  (provided-mode-derived-p
+   (buffer-local-value 'major-mode buffer)
+   'python-mode 'inferior-python-mode))
+
+;; Commands that only make sense in the Python shell or when editing
+;; Python code.
 (dolist (sym '(python-describe-at-point
                python-eldoc-at-point
                python-shell-completion-native-toggle
@@ -5940,7 +5948,7 @@ REPORT-FN is Flymake's callback function."
                python-shell-font-lock-turn-on
                python-shell-package-enable
                python-shell-completion-complete-or-indent  ))
-  (put sym 'completion-predicate #'python--completion-predicate))
+  (put sym 'completion-predicate #'python-shell--completion-predicate))
 
 (provide 'python)
 
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 39c5eb453b..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)))))
 
@@ -14958,8 +14958,8 @@ otherwise use cached data."
 
 (defun vhdl-speedbar-insert-hierarchy ( ent-alist-arg conf-alist-arg
                                         package-alist ent-inst-list depth)
-  "Insert hierarchy of ENT-ALIST, CONF-ALIST, and PACKAGE-ALIST."
-  (if (not (or ent-alist conf-alist package-alist))
+  "Insert hierarchy of ENT-ALIST-ARG, CONF-ALIST-ARG, and PACKAGE-ALIST."
+  (if (not (or ent-alist-arg conf-alist-arg package-alist))
       (vhdl-speedbar-make-title-line "No VHDL design units!" depth)
     (let ((ent-alist ent-alist-arg)
           (conf-alist conf-alist-arg)
@@ -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/server.el b/lisp/server.el
index a06f2f952f..dd7bccaf33 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -544,7 +544,8 @@ Creates the directory if necessary and makes sure:
   (setq dir (directory-file-name dir))
   (let ((attrs (file-attributes dir 'integer)))
     (unless attrs
-      (cl-letf (((default-file-modes) ?\700)) (make-directory dir t))
+      (with-file-modes ?\700
+        (make-directory dir t))
       (setq attrs (file-attributes dir 'integer)))
 
     ;; Check that it's safe for use.
@@ -691,7 +692,7 @@ server or call `\\[server-force-delete]' to forcibly 
disconnect it."))
        (server-ensure-safe-dir server-dir)
        (when server-process
          (server-log (message "Restarting server")))
-       (cl-letf (((default-file-modes) ?\700))
+        (with-file-modes ?\700
          (add-hook 'suspend-tty-functions #'server-handle-suspend-tty)
          (add-hook 'delete-frame-functions #'server-handle-delete-frame)
          (add-hook 'kill-emacs-query-functions
diff --git a/lisp/simple.el b/lisp/simple.el
index d862c0e9a8..460aff8bd8 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7299,7 +7299,7 @@ or \"mark.*active\" at the prompt."
 
 (define-minor-mode indent-tabs-mode
   "Toggle whether indentation can insert TAB characters."
-  :global t :group 'indent :variable indent-tabs-mode)
+  :group 'indent)
 
 (defvar widen-automatically t
   "Non-nil means it is ok for commands to call `widen' when they want to.
diff --git a/lisp/subr.el b/lisp/subr.el
index fed3185fcc..16eb84caa6 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
@@ -6921,10 +6920,7 @@ OBJECT if it is readable."
 
 (defun delete-line ()
   "Delete the current line."
-  (delete-region (line-beginning-position)
-                 (progn
-                   (forward-line 1)
-                   (point))))
+  (delete-region (pos-bol) (pos-bol 2)))
 
 (defun ensure-empty-lines (&optional lines)
   "Ensure that there are LINES number of empty lines before point.
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 f85d0aba9c..8e63368809 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1062,12 +1062,14 @@ calls it only when invoked interactively."
   (cl-pushnew (list dict '()) ispell-dictionary-alist :test #'equal)
   (ispell-hunspell-fill-dictionary-entry dict))
 
-(defun ispell-find-hunspell-dictionaries ()
+(defun ispell-find-hunspell-dictionaries (&optional dictionary)
   "Look for installed Hunspell dictionaries.
 Will initialize `ispell-hunspell-dictionary-alist' according
 to dictionaries found, and will remove aliases from the list
 in `ispell-dicts-name2locale-equivs-alist' if an explicit
-dictionary from that list was found."
+dictionary from that list was found.
+
+If DICTIONARY, check for that dictionary explicitly."
   (let ((hunspell-found-dicts
          (seq-filter
           (lambda (str)
@@ -1081,23 +1083,20 @@ dictionary from that list was found."
             (file-name-absolute-p str))
           (split-string
            (with-temp-buffer
-             (ispell-call-process ispell-program-name
-                            nil
-                            t
-                            nil
-                            "-D"
-                            ;; Use -a to prevent Hunspell from
-                            ;; trying to initialize its
-                            ;; curses/termcap UI, which causes it
-                            ;; to crash or fail to start in some
-                            ;; MS-Windows ports.
-                            "-a"
-                            ;; Hunspell 1.7.0 (and later?) won't
-                            ;; show LOADED DICTIONARY unless
-                            ;; there's at least one file argument
-                            ;; on the command line.  So we feed
-                            ;; it with the null device.
-                            null-device)
+             (apply #'ispell-call-process
+                    ispell-program-name nil t nil
+                    `("-D"
+                      ,@(and dictionary (list "-d" dictionary))
+                      ;; Use -a to prevent Hunspell from trying to
+                      ;; initialize its curses/termcap UI, which
+                      ;; causes it to crash or fail to start in some
+                      ;; MS-Windows ports.
+                      "-a"
+                      ;; Hunspell 1.7.0 (and later?) won't show LOADED
+                      ;; DICTIONARY unless there's at least one file
+                      ;; argument on the command line.  So we feed it
+                      ;; with the null device.
+                      ,null-device))
              (buffer-string))
            "[\n\r]+"
            t)))
@@ -1164,12 +1163,20 @@ dictionary from that list was found."
     ;; Parse and set values for default dictionary.
     (setq hunspell-default-dict (or hunspell-multi-dict
                                    (car hunspell-default-dict)))
+    ;; If we didn't find a dictionary based on the environment (i.e.,
+    ;; the locale and the DICTIONARY variable), try again if
+    ;; `ispell-dictionary' is set.
+    (when (and (not hunspell-default-dict)
+               (not dictionary)
+               ispell-dictionary)
+      (setq hunspell-default-dict
+            (ispell-find-hunspell-dictionaries ispell-dictionary)))
     ;; If hunspell-default-dict is nil, ispell-parse-hunspell-affix-file
     ;; will barf with an error message that doesn't help users figure
     ;; out what is wrong.  Produce an error message that points to the
     ;; root cause of the problem.
-    (or hunspell-default-dict
-        (error "Can't find Hunspell dictionary with a .aff affix file"))
+    (unless hunspell-default-dict
+      (error "Can't find Hunspell dictionary with a .aff affix file"))
     (setq hunspell-default-dict-entry
          (ispell-parse-hunspell-affix-file hunspell-default-dict))
     ;; Create an alist of found dicts with only names, except for default dict.
@@ -1179,7 +1186,8 @@ dictionary from that list was found."
       (cl-pushnew (if (string= dict hunspell-default-dict)
                       hunspell-default-dict-entry
                     (list dict))
-                  ispell-hunspell-dictionary-alist :test #'equal))))
+                  ispell-hunspell-dictionary-alist :test #'equal))
+    hunspell-default-dict))
 
 ;; Make ispell.el work better with enchant.
 
@@ -3146,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
@@ -3159,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
@@ -4096,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)
@@ -4132,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))))))
@@ -4140,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)))))))
@@ -4169,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/thumbs.el b/lisp/thumbs.el
index 3b31f1d809..0b3d36d6e3 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -294,6 +294,7 @@ smaller according to whether INCREMENT is 1 or -1."
     tn))
 
 (declare-function image-size "image.c" (spec &optional pixels frame))
+(declare-function image-supported-file-p "image" (file))
 
 (defun thumbs-file-size (img)
   (let ((i (image-size
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/ediff-init.el b/lisp/vc/ediff-init.el
index a3e77200dd..c956cdd2ee 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -765,7 +765,7 @@ Ediff needs to find fine differences."
   "Set stipple pixmap of FACE to PIXMAP on a monochrome display."
   (if (and (display-graphic-p) (not (display-color-p)))
       (condition-case nil
-         (set-face-background-pixmap face pixmap)
+          (set-face-stipple face pixmap)
        (error
         (message "Pixmap not found for %S: %s" (face-name face) pixmap)
         (sit-for 1)))))
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/wdired.el b/lisp/wdired.el
index 106d57174d..09f5b069f4 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -537,15 +537,28 @@ non-nil means return old filename."
     (wdired-change-to-dired-mode)
     (if changes
        (progn
-         ;; If we are displaying a single file (rather than the
-         ;; contents of a directory), change dired-directory if that
-         ;; file was renamed.  (This ought to be generalized to
-         ;; handle the multiple files case, but that's less trivial).
-         (when (and (stringp dired-directory)
-                    (not (file-directory-p dired-directory))
-                    (null some-file-names-unchanged)
-                    (= (length files-renamed) 1))
-           (setq dired-directory (cdr (car files-renamed))))
+         (cond
+           ((and (stringp dired-directory)
+                 (not (file-directory-p dired-directory))
+                 (null some-file-names-unchanged)
+                 (= (length files-renamed) 1))
+            ;; If we are displaying a single file (rather than the
+           ;; contents of a directory), change dired-directory if that
+           ;; file was renamed.
+            (setq dired-directory (cdr (car files-renamed))))
+           ((and (consp dired-directory)
+                 (cdr dired-directory)
+                 files-renamed)
+            ;; Fix dired buffers created with
+            ;; (dired '(foo f1 f2 f3)).
+            (setq dired-directory
+                  (cons (car dired-directory)
+                        ;; Replace in `dired-directory' files that have
+                        ;; been modified with their new name keeping
+                        ;; the ones that are unmodified at the same place.
+                        (cl-loop for f in (cdr dired-directory)
+                                 collect (or (assoc-default f files-renamed)
+                                             f))))))
          ;; Re-sort the buffer.
          (revert-buffer)
          (let ((inhibit-read-only t))
diff --git a/lisp/winner.el b/lisp/winner.el
index 38ab5f5101..89f337170c 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -217,8 +217,7 @@ You may want to include buffer names such as *Help*, 
*Apropos*,
      ((window-minibuffer-p) (other-window 1)))
     (when (/= minisize (window-height miniwin))
       (with-selected-window miniwin
-        (setf (window-height) minisize)))))
-
+        (enlarge-window (- minisize (window-height)))))))
 
 
 (defvar winner-point-alist nil)
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)))))
diff --git a/src/buffer.c b/src/buffer.c
index 4fd5b2be3e..d4a0c37bed 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -597,6 +597,7 @@ even if it is dead.  The return value is never nil.  */)
   set_buffer_intervals (b, NULL);
   BUF_UNCHANGED_MODIFIED (b) = 1;
   BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
+  BUF_CHARS_UNCHANGED_MODIFIED (b) = 1;
   BUF_END_UNCHANGED (b) = 0;
   BUF_BEG_UNCHANGED (b) = 0;
   *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'.  */
diff --git a/src/buffer.h b/src/buffer.h
index 47b4bdf749..77f9ea20af 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -149,12 +149,18 @@ enum { BEG = 1, BEG_BYTE = BEG };
 #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged)
 #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged)
 
+#define BUF_CHARS_UNCHANGED_MODIFIED(buf) \
+  ((buf)->text->chars_unchanged_modified)
+
 #define UNCHANGED_MODIFIED \
   BUF_UNCHANGED_MODIFIED (current_buffer)
 #define OVERLAY_UNCHANGED_MODIFIED \
   BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer)
 #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer)
 #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer)
+
+#define CHARS_UNCHANGED_MODIFIED \
+  BUF_CHARS_UNCHANGED_MODIFIED (current_buffer)
 
 /* Functions to set PT in the current buffer, or another buffer.  */
 
@@ -268,6 +274,9 @@ struct buffer_text
        end_unchanged contain no useful information.  */
     modiff_count overlay_unchanged_modified;
 
+    /* CHARS_MODIFF as of last redisplay that finished.  */
+    modiff_count chars_unchanged_modified;
+
     /* Properties of this buffer's text.  */
     INTERVAL intervals;
 
diff --git a/src/editfns.c b/src/editfns.c
index d7a62d914b..8018065568 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -729,7 +729,7 @@ bol (Lisp_Object n, ptrdiff_t *out_count)
   return charpos;
 }
 
-DEFUN ("bol", Fbol, Sbol, 0, 1, 0,
+DEFUN ("pos-bol", Fpos_bol, Spos_bol, 0, 1, 0,
        doc: /* Return the position of the first character on the current line.
 With optional argument N, scan forward N - 1 lines first.
 If the scan reaches the end of the buffer, return that position.
@@ -748,7 +748,7 @@ This function does not move point.  Also see 
`line-beginning-position'.  */)
 DEFUN ("line-beginning-position",
        Fline_beginning_position, Sline_beginning_position, 0, 1, 0,
        doc: /* Return the position of the first character in the current 
line/field.
-This function is like `bol' (which see), but respects fields.
+This function is like `pos-bol' (which see), but respects fields.
 
 This function constrains the returned position to the current field
 unless that position would be on a different line from the original,
@@ -784,7 +784,7 @@ eol (Lisp_Object n)
                                   NULL);
 }
 
-DEFUN ("eol", Feol, Seol, 0, 1, 0,
+DEFUN ("pos-eol", Fpos_eol, Spos_eol, 0, 1, 0,
        doc: /* Return the position of the last character on the current line.
 With argument N not nil or 1, move forward N - 1 lines first.
 If scan reaches end of buffer, return that position.
@@ -804,7 +804,7 @@ DEFUN ("line-end-position", Fline_end_position, 
Sline_end_position, 0, 1, 0,
 With argument N not nil or 1, move forward N - 1 lines first.
 If scan reaches end of buffer, return that position.
 
-This function is like `eol' (which see), but respects fields.
+This function is like `pos-eol' (which see), but respects fields.
 
 This function constrains the returned position to the current field
 unless that would be on a different line from the original,
@@ -4693,8 +4693,8 @@ it to be non-nil.  */);
 
   defsubr (&Sline_beginning_position);
   defsubr (&Sline_end_position);
-  defsubr (&Sbol);
-  defsubr (&Seol);
+  defsubr (&Spos_bol);
+  defsubr (&Spos_eol);
 
   defsubr (&Ssave_excursion);
   defsubr (&Ssave_current_buffer);
diff --git a/src/pdumper.c b/src/pdumper.c
index fb70df994a..903298f17d 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2764,6 +2764,7 @@ dump_buffer (struct dump_context *ctx, const struct 
buffer *in_buffer)
       DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged);
       DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified);
       DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified);
+      DUMP_FIELD_COPY (out, buffer, own_text.chars_unchanged_modified);
       if (buffer->own_text.intervals)
         dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals);
       dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers,
@@ -2911,7 +2912,7 @@ dump_native_comp_unit (struct dump_context *ctx,
                       struct Lisp_Native_Comp_Unit *comp_u)
 {
   if (!CONSP (comp_u->file))
-    error ("Trying to dump non fixed-up eln file\n");
+    error ("Trying to dump non fixed-up eln file");
 
   /* Have function documentation always lazy loaded to optimize load-time.  */
   comp_u->data_fdoc_v = Qnil;
diff --git a/src/xdisp.c b/src/xdisp.c
index 2ee02684dc..7ca726b2cd 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17358,6 +17358,7 @@ mark_window_display_accurate_1 (struct window *w, bool 
accurate_p)
 
       BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b);
       BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b);
+      BUF_CHARS_UNCHANGED_MODIFIED (b) = BUF_CHARS_MODIFF (b);
       BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b);
       BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b);
 
@@ -19620,7 +19621,7 @@ redisplay_window (Lisp_Object window, bool 
just_this_one_p)
   /* Check whether the buffer to be displayed contains long lines.  */
   if (!NILP (Vlong_line_threshold)
       && !current_buffer->long_line_optimizations_p
-      && MODIFF - UNCHANGED_MODIFIED > 8)
+      && CHARS_MODIFF - CHARS_UNCHANGED_MODIFIED > 8)
     {
       ptrdiff_t cur, next, found, max = 0, threshold;
       threshold = XFIXNUM (Vlong_line_threshold);
diff --git a/src/xfns.c b/src/xfns.c
index a275e3e11a..0b1f707e9f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -965,7 +965,7 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, 
Lisp_Object old_valu
        }
 #endif
 
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
       /* Frame synchronization can't be used in child frames since
         they are not directly managed by the compositing manager.
         Re-enabling vsync in former child frames also leads to
@@ -2421,7 +2421,7 @@ static void
 x_set_use_frame_synchronization (struct frame *f, Lisp_Object arg,
                                 Lisp_Object oldval)
 {
-#if !defined USE_GTK && defined HAVE_XSYNC
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
   struct x_display_info *dpyinfo;
 
   dpyinfo = FRAME_DISPLAY_INFO (f);
@@ -5156,7 +5156,8 @@ This function is an internal primitive--use `make-frame' 
instead.  */)
                       ((STRINGP (value)
                         && !strcmp (SSDATA (value), "extended")) ? 2 : 1));
 
-#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK
+#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \
+  && defined HAVE_CLOCK_GETTIME
       x_sync_init_fences (f);
 #endif
 #endif
diff --git a/src/xml.c b/src/xml.c
index 522efd224c..2cccff1233 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -186,6 +186,12 @@ parse_region (Lisp_Object start, Lisp_Object end, 
Lisp_Object base_url,
 
   xmlCheckVersion (LIBXML_VERSION);
 
+  if (NILP (start))
+    start = Fpoint_min ();
+
+  if (NILP (end))
+    end = Fpoint_max ();
+
   validate_region (&start, &end);
 
   istart = XFIXNUM (start);
@@ -269,8 +275,11 @@ xml_cleanup_parser (void)
 
 DEFUN ("libxml-parse-html-region", Flibxml_parse_html_region,
        Slibxml_parse_html_region,
-       2, 4, 0,
+       0, 4, 0,
        doc: /* Parse the region as an HTML document and return the parse tree.
+If START is nil, it defaults to `point-min'.  If END is nil, it
+defaults to `point-max'.
+
 If BASE-URL is non-nil, it is used to expand relative URLs.
 
 If you want comments to be stripped, use the `xml-remove-comments'
@@ -284,8 +293,11 @@ function to strip comments before calling this function.  
*/)
 
 DEFUN ("libxml-parse-xml-region", Flibxml_parse_xml_region,
        Slibxml_parse_xml_region,
-       2, 4, 0,
+       0, 4, 0,
        doc: /* Parse the region as an XML document and return the parse tree.
+If START is nil, it defaults to `point-min'.  If END is nil, it
+defaults to `point-max'.
+
 If BASE-URL is non-nil, it is used to expand relative URLs.
 
 If you want comments to be stripped, use the `xml-remove-comments'
diff --git a/src/xterm.c b/src/xterm.c
index 39e5a8e186..3dfa908f1e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6655,7 +6655,7 @@ x_set_frame_alpha (struct frame *f)
                    Starting and ending an update
  ***********************************************************************/
 
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
 
 /* Wait for an event matching PREDICATE to show up in the event
    queue, or TIMEOUT to elapse.
@@ -7029,7 +7029,7 @@ x_sync_handle_frame_drawn (struct x_display_info *dpyinfo,
 static void
 x_update_begin (struct frame *f)
 {
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
   /* If F is double-buffered, we can make the entire frame center
      around XdbeSwapBuffers.  */
 #ifdef HAVE_XDBE
@@ -7138,7 +7138,7 @@ show_back_buffer (struct frame *f)
 
   if (FRAME_X_DOUBLE_BUFFERED_P (f))
     {
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
       /* Wait for drawing of the previous frame to complete before
         displaying this new frame.  */
       x_sync_wait_for_frame_drawn_event (f);
@@ -7157,7 +7157,7 @@ show_back_buffer (struct frame *f)
       swap_info.swap_action = XdbeCopied;
       XdbeSwapBuffers (FRAME_X_DISPLAY (f), &swap_info, 1);
 
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
       /* Finish the frame here.  */
       x_sync_update_finish (f);
 #endif
@@ -7211,7 +7211,7 @@ x_update_end (struct frame *f)
   /* If double buffering is disabled, finish the update here.
      Otherwise, finish the update when the back buffer is next
      displayed.  */
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
 #ifdef HAVE_XDBE
   if (!FRAME_X_DOUBLE_BUFFERED_P (f))
 #endif
@@ -7600,7 +7600,7 @@ x_display_set_last_user_time (struct x_display_info 
*dpyinfo, Time time,
 #ifndef USE_GTK
   struct frame *focus_frame;
   Time old_time;
-#if defined HAVE_XSYNC
+#if defined HAVE_XSYNC && defined HAVE_CLOCK_GETTIME
   uint64_t monotonic_time;
 #endif
 
@@ -7615,7 +7615,7 @@ x_display_set_last_user_time (struct x_display_info 
*dpyinfo, Time time,
   if (!send_event || time > dpyinfo->last_user_time)
     dpyinfo->last_user_time = time;
 
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
   if (!send_event)
     {
       /* See if the current CLOCK_MONOTONIC time is reasonably close
@@ -13442,10 +13442,20 @@ x_query_pointer_1 (struct x_display_info *dpyinfo,
       x_uncatch_errors_after_check ();
 
       if (had_errors)
-       rc = XQueryPointer (dpyinfo->display, w, root_return,
-                           child_return, root_x_return,
-                           root_y_return, win_x_return,
-                           win_y_return, mask_return);
+       {
+         /* If the specified client pointer is the display's client
+            pointer, clear it now.  A new client pointer might not be
+            found before the next call to x_query_pointer_1 and
+            waiting for the error leads to excessive syncing.  */
+
+         if (client_pointer_device == dpyinfo->client_pointer_device)
+           dpyinfo->client_pointer_device = -1;
+
+         rc = XQueryPointer (dpyinfo->display, w, root_return,
+                             child_return, root_x_return,
+                             root_y_return, win_x_return,
+                             win_y_return, mask_return);
+       }
       else
        {
          state = 0;
@@ -17985,7 +17995,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
             goto done;
           }
 
-#if defined HAVE_XSYNC && !defined USE_GTK
+#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
        /* These messages are sent by the compositing manager after a
           frame is drawn under extended synchronization.  */
        if (event->xclient.message_type
@@ -20260,7 +20270,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              {
                block_input ();
                XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
-                               RevertToParent, CurrentTime);
+                               RevertToParent, event->xbutton.time);
                if (FRAME_PARENT_FRAME (f))
                  XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
                unblock_input ();
@@ -21524,7 +21534,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      else
                        {
                          dpyinfo->grabbed &= ~(1 << xev->detail);
-                         device->grab &= ~(1 << xev->detail);
+                         if (device)
+                           device->grab &= ~(1 << xev->detail);
                        }
 #ifdef XIPointerEmulated
                    }
@@ -21841,8 +21852,26 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                  if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, 
hf)))
                    {
                      block_input ();
+#if defined HAVE_GTK3 || (!defined USE_GTK && !defined USE_X_TOOLKIT)
+                     if (device)
+                       {
+                         /* This can generate XI_BadDevice if the
+                            device's attachment was destroyed
+                            server-side.  */
+                         x_ignore_errors_for_next_request (dpyinfo);
+                         XISetFocus (dpyinfo->display, device->attachment,
+                                     /* Note that the input extension
+                                        only supports RevertToParent-type
+                                        behavior.  */
+                                     FRAME_OUTER_WINDOW (f), xev->time);
+                         x_stop_ignoring_errors (dpyinfo);
+                       }
+#else
+                     /* Non-no toolkit builds without GTK 3 use core
+                        events to handle focus.  */
                      XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW 
(f),
-                                     RevertToParent, CurrentTime);
+                                     RevertToParent, xev->time);
+#endif
                      if (FRAME_PARENT_FRAME (f))
                        XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW 
(f));
                      unblock_input ();
@@ -26995,7 +27024,7 @@ x_free_frame_resources (struct frame *f)
        XFreeCursor (FRAME_X_DISPLAY (f), 
f->output_data.x->bottom_left_corner_cursor);
 
       /* Free sync fences.  */
-#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK
+#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined 
HAVE_CLOCK_GETTIME
       x_sync_free_fences (f);
 #endif
     }
@@ -27708,6 +27737,42 @@ xi_select_hierarchy_events (struct x_display_info 
*dpyinfo)
 
 #endif
 
+#if defined HAVE_XINPUT2 && defined HAVE_GTK3
+
+/* Look up whether or not GTK already initialized the X input
+   extension.
+
+   Value is 0 if GTK was not built with the input extension, or if it
+   was explictly disabled, 1 if GTK enabled the input extension and
+   the version was successfully determined, and 2 if that information
+   could not be determined.  */
+
+static int
+xi_check_toolkit (Display *display)
+{
+  GdkDisplay *gdpy;
+  GdkDeviceManager *manager;
+
+  gdpy = gdk_x11_lookup_xdisplay (display);
+  eassume (gdpy);
+  manager = gdk_display_get_device_manager (gdpy);
+
+  if (!strcmp (G_OBJECT_TYPE_NAME (manager),
+              "GdkX11DeviceManagerXI2"))
+    return 1;
+
+  if (!strcmp (G_OBJECT_TYPE_NAME (manager),
+              "GdkX11DeviceManagerCore"))
+    return 0;
+
+  /* Something changed in GDK so this information is no longer
+     available.  */
+
+  return 2;
+}
+
+#endif
+
 /* Open a connection to X display DISPLAY_NAME, and return
    the structure that describes the open display.
    If we cannot contact the display, return null.  */
@@ -28252,6 +28317,17 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
 
   dpyinfo->client_pointer_device = -1;
 
+#ifdef HAVE_GTK3
+  /* GTK gets a chance to request use of the input extension first.
+     If we later try to enable it if GDK did not, then GTK will not
+     get the resulting extension events.  */
+
+  rc = xi_check_toolkit (dpyinfo->display);
+
+  if (!rc)
+    goto skip_xi_setup;
+#endif
+
   if (XQueryExtension (dpyinfo->display, "XInputExtension",
                       &dpyinfo->xi2_opcode, &xi_first_event,
                       &xi_first_error))
@@ -28348,9 +28424,7 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
     }
 
   dpyinfo->xi2_version = minor;
-#ifndef HAVE_GTK3
  skip_xi_setup:
-#endif
   ;
 #endif
 
diff --git a/src/xterm.h b/src/xterm.h
index e97f3d4c83..8500ec2771 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1119,7 +1119,7 @@ struct x_output
      frame.  */
   bool_bf waiting_for_frame_p : 1;
 
-#ifndef USE_GTK
+#if !defined USE_GTK && defined HAVE_CLOCK_GETTIME
   /* Whether or not Emacs should wait for the compositing manager to
      draw frames before starting a new frame.  */
   bool_bf use_vsync_p : 1;
@@ -1577,7 +1577,8 @@ extern void x_make_frame_invisible (struct frame *);
 extern void x_iconify_frame (struct frame *);
 extern void x_free_frame_resources (struct frame *);
 extern void x_wm_set_size_hint (struct frame *, long, bool);
-#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK
+#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \
+  && defined HAVE_CLOCK_GETTIME
 extern void x_sync_init_fences (struct frame *);
 #endif
 
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index 54b1a16b5d..4bbff6d057 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -105,7 +105,7 @@ This expects `auto-revert--messages' to be bound by
                    (auto-revert--timeout))
                 (null (string-match
                        (format-message
-                        "Reverting buffer `%s'\\." (buffer-name buffer))
+                        "Reverting buffer `%s'" (buffer-name buffer))
                        (or auto-revert--messages ""))))
       (if (and (or file-notify--library
                    (file-remote-p temporary-file-directory))
diff --git a/test/lisp/calendar/todo-mode-tests.el 
b/test/lisp/calendar/todo-mode-tests.el
index 0102b62c10..95855d1e63 100644
--- a/test/lisp/calendar/todo-mode-tests.el
+++ b/test/lisp/calendar/todo-mode-tests.el
@@ -459,7 +459,7 @@ the top done item should be the first done item."
                                  todo-date-pattern
                                 "\\( " diary-time-regexp "\\)?"
                                 (regexp-quote todo-nondiary-end) "?")
-                        (line-end-position) t)
+                         (pos-eol) t)
                         (forward-char)
                         (point)))
           (start1 (save-excursion (funcall find-start)))
@@ -854,7 +854,7 @@ item's date should be adjusted accordingly."
    (let ((current-prefix-arg t)         ; For todo-edit-item--header.
          (get-date (lambda ()
                      (save-excursion
-                       (todo-date-string-matcher (line-end-position))
+                       (todo-date-string-matcher (pos-eol))
                        (buffer-substring-no-properties (match-beginning 1)
                                                        (match-end 0))))))
      (should (equal (funcall get-date) "Jan 1, 2020"))
@@ -903,7 +903,7 @@ tab character."
      (todo-test--insert-item item 1)
      (re-search-forward (concat todo-date-string-start todo-date-pattern
                                (regexp-quote todo-nondiary-end) " ")
-                       (line-end-position) t)
+                       (pos-eol) t)
      (should (looking-at (regexp-quote (concat item0 "\n\t" item1)))))))
 
 (ert-deftest todo-test-multiline-item-indentation-2 () ; bug#43068
@@ -917,7 +917,7 @@ begin with a tab character."
      (todo-edit-item--text 'multiline)
      (insert (concat "\n" item1))
      (todo-edit-quit)
-     (goto-char (line-beginning-position))
+     (goto-char (pos-bol))
      (should (looking-at (regexp-quote (concat item0 "\n\t" item1)))))))
 
 (ert-deftest todo-test-multiline-item-indentation-3 ()
@@ -930,7 +930,7 @@ since all non-initial item lines must begin with 
whitespace."
           (item1 "Second line."))
      (todo-edit-file)
      (should (looking-at (regexp-quote item0)))
-     (goto-char (line-end-position))
+     (goto-char (pos-eol))
      (insert (concat "\n" item1))
      (should-error (todo-edit-quit) :type 'user-error))))
 
diff --git a/test/lisp/cedet/semantic-utest-ia.el 
b/test/lisp/cedet/semantic-utest-ia.el
index caf20fa8e0..fa3b3185ed 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -194,7 +194,7 @@
 
        (goto-char a)
 
-       (let ((bss (buffer-substring-no-properties (point) (point-at-eol))))
+        (let ((bss (buffer-substring-no-properties (point) (pos-eol))))
          (condition-case nil
              (setq desired (read bss))
            (error (setq desired (format "  FAILED TO PARSE: %S"
@@ -215,8 +215,8 @@
                        )
                       fail)))
 
-      (setq p nil a nil)
-      (setq idx (1+ idx)))
+        (setq p nil a nil)
+        (setq idx (1+ idx)))
       )
 
     (when fail
@@ -353,7 +353,7 @@
               (when (re-search-forward regex-p nil t)
                 (setq tag (semantic-current-tag))
                 (goto-char (match-end 0))
-                (setq desired (read (buffer-substring (point) (point-at-eol))))
+                 (setq desired (read (buffer-substring (point) (pos-eol))))
                 ))
             tag)
 
@@ -451,7 +451,7 @@ tag that contains point, and return that."
               (when (re-search-forward regex-p nil t)
                 (goto-char (match-end 0))
                 (skip-syntax-backward "w")
-                (setq desired (read (buffer-substring (point) (point-at-eol))))
+                 (setq desired (read (buffer-substring (point) (pos-eol))))
                 (setq start (match-beginning 0))
                 (goto-char start)
                 (setq actual (semantic-symref-test-count-hits-in-tag))
@@ -463,7 +463,7 @@ tag that contains point, and return that."
                         (list
                         (format
                          "Symref id %d: No results." idx))
-                         fail))
+                        fail))
 
            )
 
diff --git a/test/lisp/cedet/semantic-utest.el 
b/test/lisp/cedet/semantic-utest.el
index 78bbbbf459..24a467474b 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -736,8 +736,8 @@ JAVE this thing would need to be recursive to handle java 
and csharp"
   (beginning-of-line)
   (setq semantic-utest-last-kill-pos (point))
   (setq semantic-utest-last-kill-text
-       (buffer-substring (point) (point-at-eol)))
-  (delete-region (point) (point-at-eol))
+        (buffer-substring (point) (pos-eol)))
+  (delete-region (point) (pos-eol))
   (insert insertme)
   (sit-for 0)
 )
@@ -745,7 +745,7 @@ JAVE this thing would need to be recursive to handle java 
and csharp"
 (defun semantic-utest-unkill-indicator ()
   "Unkill the last indicator."
   (goto-char semantic-utest-last-kill-pos)
-  (delete-region (point) (point-at-eol))
+  (delete-region (point) (pos-eol))
   (insert semantic-utest-last-kill-text)
   (sit-for 0)
   )
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 0e89325907..9cf0151905 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -313,7 +313,7 @@
                             (save-excursion
                               (goto-char 1)
                               (forward-line 1)
-                              (- (point-at-eol) (point)))))
+                              (- (pos-eol) (point)))))
            orig-len len diff pos line-nb)
       (make-directory subdir 'parents)
       (with-current-buffer (dired-noselect subdir)
@@ -331,7 +331,7 @@
           (forward-line 1)
           (let ((inhibit-read-only t)
                 (new-header "  test-bug27968"))
-            (delete-region (point) (point-at-eol))
+            (delete-region (point) (pos-eol))
             (when (= orig-len (length new-header))
               ;; Wow lucky guy! I must buy lottery today.
               (setq new-header (concat new-header " :-)")))
diff --git a/test/lisp/emacs-lisp/backtrace-tests.el 
b/test/lisp/emacs-lisp/backtrace-tests.el
index b08695a22b..b42de06776 100644
--- a/test/lisp/emacs-lisp/backtrace-tests.el
+++ b/test/lisp/emacs-lisp/backtrace-tests.el
@@ -274,16 +274,16 @@ line contains the strings \"lambda\" and \"number\"."
   ;; Verify the form now spans multiple lines.
   (let ((pos (point)))
     (search-forward "number")
-    (should-not (= pos (point-at-bol))))
+    (should-not (= pos (pos-bol))))
   ;; Collapse the form.
   (backtrace-single-line)
   ;; Verify that the form is now back on one line,
   ;; and that point is at the same place.
   (should (string= (backtrace-tests--get-substring
                     (- (point) 6) (point)) "number"))
-  (should-not (= (point) (point-at-bol)))
+  (should-not (= (point) (pos-bol)))
   (should (string= (backtrace-tests--get-substring
-                    (point-at-bol) (1+ (point-at-eol)))
+                    (pos-bol) (1+ (pos-eol)))
                    line)))
 
 (ert-deftest backtrace-tests--print-circle ()
diff --git a/test/lisp/emacs-lisp/find-func-tests.el 
b/test/lisp/emacs-lisp/find-func-tests.el
index 420c61acb5..d18a9dc1a9 100644
--- a/test/lisp/emacs-lisp/find-func-tests.el
+++ b/test/lisp/emacs-lisp/find-func-tests.el
@@ -109,9 +109,7 @@ expected function symbol and function library, 
respectively."
       (skip-chars-backward "\n")
       (should (string-match-p
                ".join-line. is an alias for .delete-indentation."
-               (buffer-substring
-                (line-beginning-position)
-                (point)))))))
+               (buffer-substring (pos-bol) (point)))))))
 
 ;; Avoid a byte-compilation warning that may confuse people reading
 ;; the result of the following test.
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el 
b/test/lisp/emacs-lisp/lisp-mode-tests.el
index d3e78aa1d7..996ea201fb 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -342,16 +342,18 @@ Expected initialization file: `%s'\"
     (insert "(define-flabbergast-test zot ()\n'bar)\n")
     (goto-char 5)
     (should (equal (lisp-current-defun-name) "zot")))
-  (with-temp-buffer
-    (emacs-lisp-mode)
-    (insert "(progn\n ;; comment\n ;; about that\n (define-key ...)\n )")
-    (goto-char 5)
-    (should (equal (lisp-current-defun-name) "progn")))
-  (with-temp-buffer
-    (emacs-lisp-mode)
-    (insert "(defblarg \"a\" 'b)")
-    (goto-char 5)
-    (should (equal (lisp-current-defun-name) "defblarg"))))
+  ;; These tests should probably work after bug#49592 has been fixed.
+  ;; (with-temp-buffer
+  ;;   (emacs-lisp-mode)
+  ;;   (insert "(progn\n ;; comment\n ;; about that\n (define-key ...)\n )")
+  ;;   (goto-char 5)
+  ;;   (should (equal (lisp-current-defun-name) "progn")))
+  ;; (with-temp-buffer
+  ;;   (emacs-lisp-mode)
+  ;;   (insert "(defblarg \"a\" 'b)")
+  ;;   (goto-char 5)
+  ;;   (should (equal (lisp-current-defun-name) "defblarg")))
+  )
 
 (provide 'lisp-mode-tests)
 ;;; lisp-mode-tests.el ends here
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 0f222edacf..55efe2fd2d 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -522,7 +522,7 @@
         (erc-send-current-line)
         (should (ring-p erc-input-ring))
         (should (zerop (ring-member erc-input-ring "/one"))) ; equal
-        (should (save-excursion (forward-line -1) (goto-char (point-at-bol))
+        (should (save-excursion (forward-line -1) (goto-char (pos-bol))
                                 (looking-at-p "[*]+ echo: one")))
         (should-not erc-input-ring-index)
         (erc-bol)
@@ -575,15 +575,15 @@
     (goto-char (point-min))
     (search-forward "Version")
     (search-forward "\r\n\r\n")
-    (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position))
+    (search-forward "myproxy.localhost:6667 >> PASS" (pos-eol))
     (forward-line)
-    (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position))
+    (search-forward "irc.gnu.org << :irc.gnu.org 001" (pos-eol))
     (forward-line)
-    (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position))
+    (search-forward "irc.gnu.org << :irc.gnu.org 002" (pos-eol))
     (forward-line)
-    (search-forward "FooNet << :irc.gnu.org 422" (line-end-position))
+    (search-forward "FooNet << :irc.gnu.org 422" (pos-eol))
     (forward-line)
-    (search-forward "BarNet << :irc.gnu.org 221" (line-end-position)))
+    (search-forward "BarNet << :irc.gnu.org 221" (pos-eol)))
   (when noninteractive
     (kill-buffer "*erc-protocol*")
     (should-not erc-debug-irc-protocol)))
diff --git a/test/lisp/eshell/esh-proc-tests.el 
b/test/lisp/eshell/esh-proc-tests.el
index 2369bb5cc0..62e784e8f6 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -74,6 +74,8 @@
 (ert-deftest esh-proc-test/pipeline-connection-type/middle ()
   "Test that all streams are pipes when a command is in the middle of a
 pipeline."
+  ;; Repeated unreproducible errors.
+  :tags '(:unstable)
   (skip-unless (and (executable-find "sh")
                     (executable-find "cat")))
   (eshell-command-result-equal
@@ -82,6 +84,8 @@ pipeline."
 
 (ert-deftest esh-proc-test/pipeline-connection-type/last ()
   "Test that only output streams are PTYs when a command ends a pipeline."
+  ;; Repeated unreproducible errors.
+  :tags '(:unstable)
   (skip-unless (executable-find "sh"))
   (eshell-command-result-equal
    (concat "echo | " esh-proc-test--detect-pty-cmd)
diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el
index 8f3c1250a9..a724428ecb 100644
--- a/test/lisp/gnus/message-tests.el
+++ b/test/lisp/gnus/message-tests.el
@@ -47,14 +47,10 @@
           (setq-local parse-sexp-lookup-properties t)
           (backward-sexp)
           (should (string= "here's an opener "
-                           (buffer-substring-no-properties
-                            (line-beginning-position)
-                            (point))))
+                           (buffer-substring-no-properties (pos-bol) (point))))
           (forward-sexp)
           (should (string= "and here's a closer )"
-                           (buffer-substring-no-properties
-                            (line-beginning-position)
-                            (point)))))
+                           (buffer-substring-no-properties (pos-bol) 
(point)))))
       (set-buffer-modified-p nil))))
 
 
diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el
index acfd6e82f1..117170ba33 100644
--- a/test/lisp/info-xref-tests.el
+++ b/test/lisp/info-xref-tests.el
@@ -161,8 +161,7 @@ text.
       (should (search-backward "done" nil t))
       (should (string-match-p
                " [0-9]\\{3,\\} good, 0 bad"
-               (buffer-substring-no-properties (line-beginning-position)
-                                               (line-end-position)))))))
+               (buffer-substring-no-properties (pos-bol) (pos-eol)))))))
 
 
 ;;; info-xref-tests.el ends here
diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el
index e33b59bc41..f3a35e3dfc 100644
--- a/test/lisp/mail/footnote-tests.el
+++ b/test/lisp/mail/footnote-tests.el
@@ -40,7 +40,7 @@
     (footnote-back-to-message)
     (should (equal (buffer-substring (point-min) (point))
                    "hello[1]"))
-    (should (equal (buffer-substring (point-min) (line-end-position))
+    (should (equal (buffer-substring (point-min) (pos-eol))
                    "hello[1][2] world"))))
 
 (provide 'footnote-tests)
diff --git a/test/lisp/progmodes/elisp-mode-tests.el 
b/test/lisp/progmodes/elisp-mode-tests.el
index 8e4dfa8bb8..8074d8d706 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -1084,7 +1084,7 @@ evaluation of BODY."
       (insert "f-test-compl")
       (completion-at-point)
       (goto-char (point-min))
-      (should (search-forward "f-test-complete-me" (line-end-position) t))
+      (should (search-forward "f-test-complete-me" (pos-eol) t))
       (goto-char (point-min))
       (should (string= (symbol-name (read (current-buffer)))
                        "elisp--foo-test-complete-me"))
diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el
index 3fe5eecd1b..b857a25bf2 100644
--- a/test/lisp/progmodes/f90-tests.el
+++ b/test/lisp/progmodes/f90-tests.el
@@ -285,14 +285,14 @@ real :: x
 end")
     (f90-indent-line)
     (should (equal " function foo"
-                   (buffer-substring (point) (line-end-position))))
+                   (buffer-substring (point) (pos-eol))))
     (goto-char (point-max))
     (insert "\nmodule subroutine bar(x)
 real :: x
 end")
     (f90-indent-line)
     (should (equal " subroutine bar"
-                   (buffer-substring (point) (line-end-position))))))
+                   (buffer-substring (point) (pos-eol))))))
 
 
 ;;; f90-tests.el ends here
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index a11716a7b5..12ac871fdf 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1639,7 +1639,7 @@ a = (
 "
    (python-tests-look-at "- bar")
    (should (eq (car (python-indent-context)) :inside-string))
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ",")
    (should (= (current-indentation) 0))))
 
@@ -1654,7 +1654,7 @@ a = (
 "
    (python-tests-look-at "- bar'''")
    (should (eq (car (python-indent-context)) :inside-string))
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ",")
    (should (= (current-indentation) 0))))
 
@@ -1668,7 +1668,7 @@ def a():
 def b()
 "
    (python-tests-look-at "def b()")
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ":")
    (should (= (current-indentation) 0))))
 
@@ -1682,7 +1682,7 @@ if do:
 outside
 "
    (python-tests-look-at "else")
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ":")
    (should (= (current-indentation) 0))
    (python-tests-look-at "outside")
@@ -1699,7 +1699,7 @@ if do:
           that)
 "
    (python-tests-look-at "that)")
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ":")
    (python-tests-look-at "elif" -1)
    (should (= (current-indentation) 0))
@@ -1724,7 +1724,7 @@ def f():
 else
 "
    (python-tests-look-at "else")
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (python-tests-self-insert ":")
    (python-tests-look-at "else" -1)
    (should (= (current-indentation) 4))))
@@ -1984,7 +1984,7 @@ class C:
          (expected-mark-beginning-position
           (progn
             (python-tests-look-at "def __init__(self):")
-            (1- (line-beginning-position))))
+            (1- (pos-bol))))
          (expected-mark-end-position-1
           (save-excursion
             (python-tests-look-at "self.b = 'b'")
@@ -2041,7 +2041,7 @@ class C:
           (progn
             (python-tests-look-at "def fun(self):")
             (python-tests-look-at "(self):")
-            (1- (line-beginning-position))))
+            (1- (pos-bol))))
          (expected-mark-end-position
           (save-excursion
             (python-tests-look-at "return self.b")
@@ -2066,7 +2066,7 @@ def foo(x):
    (let ((expected-mark-beginning-position
           (progn
             (python-tests-look-at "def foo(x):")
-            (1- (line-beginning-position))))
+            (1- (pos-bol))))
          (expected-mark-end-position (point-max)))
      (python-tests-look-at "return bar")
      (python-mark-defun 1)
@@ -2086,7 +2086,7 @@ def \\
          (expected-mark-beginning-position
           (progn
             (python-tests-look-at "def ")
-            (1- (line-beginning-position))))
+            (1- (pos-bol))))
          (expected-mark-end-position
           (save-excursion
             (python-tests-look-at "return x")
@@ -2438,21 +2438,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
                 (point))
               (save-excursion
                 (python-tests-look-at "return wwrap")
-                (line-beginning-position))))
+                (pos-bol))))
    (should (= (save-excursion
                 (python-tests-look-at "def wrapped_f(*args):")
                 (python-nav-end-of-defun)
                 (point))
               (save-excursion
                 (python-tests-look-at "return wrapped_f")
-                (line-beginning-position))))
+                (pos-bol))))
    (should (= (save-excursion
                 (python-tests-look-at "f(*args)")
                 (python-nav-end-of-defun)
                 (point))
               (save-excursion
                 (python-tests-look-at "return wrapped_f")
-                (line-beginning-position))))))
+                (pos-bol))))))
 
 (ert-deftest python-nav-end-of-defun-3 ()
   (python-tests-with-temp-buffer
@@ -2765,14 +2765,14 @@ string
                 (point))
               (save-excursion
                 (python-tests-look-at "789")
-                (line-end-position))))
+                (pos-eol))))
    (python-tests-look-at "v2 =")
    (should (= (save-excursion
                 (python-nav-end-of-statement)
                 (point))
               (save-excursion
                 (python-tests-look-at "value4)")
-                (line-end-position))))
+                (pos-eol))))
    (python-tests-look-at "v3 =")
    (should (= (save-excursion
                 (python-nav-end-of-statement)
@@ -2780,7 +2780,7 @@ string
               (save-excursion
                 (python-tests-look-at
                  "'continue previous line')")
-                (line-end-position))))
+                (pos-eol))))
    (python-tests-look-at "v4 =")
    (should (= (save-excursion
                 (python-nav-end-of-statement)
@@ -3004,21 +3004,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
                 (point))
               (save-excursion
                 (python-tests-look-at "return wrapped_f")
-                (line-end-position))))
+                (pos-eol))))
    (end-of-line)
    (should (= (save-excursion
                 (python-nav-end-of-block)
                 (point))
               (save-excursion
                 (python-tests-look-at "return wrapped_f")
-                (line-end-position))))
+                (pos-eol))))
    (python-tests-look-at "f(*args)")
    (should (= (save-excursion
                 (python-nav-end-of-block)
                 (point))
               (save-excursion
                 (python-tests-look-at "print 'After f(*args)'")
-                (line-end-position))))))
+                (pos-eol))))))
 
 (ert-deftest python-nav-end-of-block-2 ()
   "Ensure that `python-nav-end-of-block' does not enter an infinite loop."
@@ -3308,11 +3308,11 @@ if x:
 \tabcdefg
 "
      (python-tests-look-at "abcdefg")
-     (goto-char (line-end-position))
+     (goto-char (pos-eol))
      (call-interactively #'python-indent-dedent-line-backspace)
      (should
       (string= (buffer-substring-no-properties
-                (line-beginning-position) (line-end-position))
+                (pos-bol) (pos-eol))
                "\tabcdef")))))
 
 (ert-deftest python-indent-dedent-line-backspace-3 ()
@@ -3325,27 +3325,27 @@ if x:
 \t abcdefg
 "
      (python-tests-look-at "abcdefg")
-     (goto-char (line-end-position))
+     (goto-char (pos-eol))
      (call-interactively #'python-indent-dedent-line-backspace)
      (should
       (string= (buffer-substring-no-properties
-                (line-beginning-position) (line-end-position))
+                (pos-bol) (pos-eol))
                "\t abcdef"))
      (back-to-indentation)
      (call-interactively #'python-indent-dedent-line-backspace)
      (should
       (string= (buffer-substring-no-properties
-                (line-beginning-position) (line-end-position))
+                (pos-bol) (pos-eol))
                "\tabcdef"))
      (call-interactively #'python-indent-dedent-line-backspace)
      (should
       (string= (buffer-substring-no-properties
-                (line-beginning-position) (line-end-position))
+                (pos-bol) (pos-eol))
                "    abcdef"))
      (call-interactively #'python-indent-dedent-line-backspace)
      (should
       (string= (buffer-substring-no-properties
-                (line-beginning-position) (line-end-position))
+                (pos-bol) (pos-eol))
                "abcdef")))))
 
 (ert-deftest python-bob-infloop-avoid ()
@@ -4358,11 +4358,11 @@ map(codecs.open('somefile'
 "
    (python-tests-look-at "ap(xx")
    (should (string= (python-eldoc--get-symbol-at-point) "map"))
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (should (string= (python-eldoc--get-symbol-at-point) "map"))
    (python-tests-look-at "('somefile'")
    (should (string= (python-eldoc--get-symbol-at-point) "map"))
-   (goto-char (line-end-position))
+   (goto-char (pos-eol))
    (should (string= (python-eldoc--get-symbol-at-point) "codecs.open"))))
 
 (ert-deftest python-eldoc--get-symbol-at-point-2 ()
@@ -4875,7 +4875,7 @@ def long_function_name(
    (should (not (python-info-beginning-of-statement-p)))
    (python-tests-look-at "print (var_one)")
    (should (python-info-beginning-of-statement-p))
-   (goto-char (line-beginning-position))
+   (goto-char (pos-bol))
    (should (not (python-info-beginning-of-statement-p)))))
 
 (ert-deftest python-info-beginning-of-statement-p-2 ()
@@ -4895,7 +4895,7 @@ if width == 0 and height == 0 and \\
    (should (not (python-info-beginning-of-statement-p)))
    (python-tests-look-at "raise ValueError(")
    (should (python-info-beginning-of-statement-p))
-   (goto-char (line-beginning-position))
+   (goto-char (pos-bol))
    (should (not (python-info-beginning-of-statement-p)))))
 
 (ert-deftest python-info-end-of-statement-p-1 ()
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index ef1e5c3eaf..23ec24840f 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -378,7 +378,7 @@ Each element has the format:
               (goto-char (point-min))
               (should (string-match "\\`2 matches for \"and\" in buffer: "
                                     (buffer-substring-no-properties
-                                     (point) (line-end-position)))))))
+                                     (point) (pos-eol)))))))
       (and (buffer-name temp-buffer)
            (kill-buffer temp-buffer)))))
 
@@ -401,7 +401,7 @@ Each element has the format:
               (goto-char (point-min))
               (should (string-match "\\`2 matches for \"and\" in buffer: "
                                     (buffer-substring-no-properties
-                                     (point) (line-end-position)))))))
+                                     (point) (pos-eol)))))))
       (and (buffer-name temp-buffer)
            (kill-buffer temp-buffer)))))
 
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index b4576889dc..97f425f6f4 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -321,7 +321,7 @@ See bug#35036."
     ;; Stay at BOB.
     (forward-line -1)
     (save-restriction
-      (narrow-to-region (point) (line-end-position))
+      (narrow-to-region (point) (pos-eol))
       (should-not (delete-indentation))
       (should (equal (simple-test--buffer-substrings)
                      '("" . " second ")))
@@ -344,27 +344,23 @@ See bug#35036."
     (should (equal (simple-test--buffer-substrings)
                    '(" first " . "")))
     ;; Single line.
-    (should-not (delete-indentation
-                 nil (line-beginning-position) (1- (point))))
+    (should-not (delete-indentation nil (pos-bol) (1- (point))))
     (should (equal (simple-test--buffer-substrings)
                    '("" . " first ")))
-    (should-not (delete-indentation nil (1+ (point)) (line-end-position)))
+    (should-not (delete-indentation nil (1+ (point)) (pos-eol)))
     (should (equal (simple-test--buffer-substrings)
                    '(" " . "first ")))
-    (should-not (delete-indentation
-                 nil (line-beginning-position) (line-end-position)))
+    (should-not (delete-indentation nil (pos-bol) (pos-eol)))
     (should (equal (simple-test--buffer-substrings)
                    '("" . " first ")))
     ;; Multiple lines.
     (goto-char (point-max))
     (insert "\n second \n third \n fourth ")
     (goto-char (point-min))
-    (should-not (delete-indentation
-                 nil (line-end-position) (line-beginning-position 2)))
+    (should-not (delete-indentation nil (pos-eol) (pos-bol 2)))
     (should (equal (simple-test--buffer-substrings)
                    '(" first" . " second \n third \n fourth ")))
-    (should-not (delete-indentation
-                 nil (point) (1+ (line-beginning-position 2))))
+    (should-not (delete-indentation nil (point) (1+ (pos-bol 2))))
     (should (equal (simple-test--buffer-substrings)
                    '(" first second" . " third \n fourth ")))
     ;; Prefix argument overrides region.
@@ -808,7 +804,7 @@ See Bug#21722."
       (insert "a\nb\nc\nd\n")
       (goto-char (point-min))
       (forward-line (1- target-line))
-      (narrow-to-region (line-beginning-position) (line-end-position))
+      (narrow-to-region (pos-bol) (pos-eol))
       (should (equal (line-number-at-pos) 1))
       (should (equal (line-number-at-pos nil t) target-line)))))
 
@@ -817,7 +813,7 @@ See Bug#21722."
     (insert "a\nb\nc\nd\n")
     (goto-char (point-min))
     (forward-line 2)
-    (narrow-to-region (line-beginning-position) (line-end-position))
+    (narrow-to-region (pos-bol) (pos-eol))
     (should (equal (line-number-at-pos) 1))
     (line-number-at-pos nil t)
     (should (equal (line-number-at-pos) 1))))
diff --git a/test/lisp/textmodes/css-mode-tests.el 
b/test/lisp/textmodes/css-mode-tests.el
index a746edf894..1d2d556992 100644
--- a/test/lisp/textmodes/css-mode-tests.el
+++ b/test/lisp/textmodes/css-mode-tests.el
@@ -435,7 +435,7 @@
                       'css-selector)
             (should-not (format "Didn't recognize %s as a selector"
                                 (buffer-substring-no-properties
-                                 (point) (line-end-position)))))))
+                                 (point) (pos-eol)))))))
       ;; Test many selectors.
       (dolist (selector selectors)
         (with-temp-buffer
@@ -451,7 +451,7 @@
                       'css-selector)
             (should-not (format "Didn't recognize %s as a selector"
                                 (buffer-substring-no-properties
-                                 (point) (line-end-position)))))))
+                                 (point) (pos-eol)))))))
       ;; Test wrong separators.
       (dolist (selector selectors)
         (with-temp-buffer
@@ -467,7 +467,7 @@
                     'css-selector)
             (should-not (format "Recognized %s as a selector"
                                 (buffer-substring-no-properties
-                                 (point) (line-end-position))))))))))
+                                 (point) (pos-eol))))))))))
 
 (ert-deftest scss-mode-test-selectors ()
   (let ((selectors
@@ -485,7 +485,7 @@
                       'css-selector)
             (should-not (format "Didn't recognize %s as a selector"
                                 (buffer-substring-no-properties
-                                 (point) (line-end-position))))))))))
+                                 (point) (pos-eol))))))))))
 
 
 (provide 'css-mode-tests)
diff --git a/test/lisp/textmodes/fill-tests.el 
b/test/lisp/textmodes/fill-tests.el
index b730de5a69..f2a0daf812 100644
--- a/test/lisp/textmodes/fill-tests.el
+++ b/test/lisp/textmodes/fill-tests.el
@@ -53,8 +53,8 @@
       (goto-char (point-min))
       (search-forward "b")
       (let* ((pos (point))
-             (beg (line-beginning-position))
-             (end (line-end-position))
+             (beg (pos-bol))
+             (end (pos-eol))
              (fill-prefix (make-string (- pos beg) ?\s))
              ;; `fill-column' is too small to accommodate the current line
              (fill-column (- end beg 10)))
@@ -68,8 +68,8 @@
       (goto-char (point-min))
       (search-forward "b")
       (let* ((pos (point))
-             (beg (line-beginning-position))
-             (end (line-end-position))
+             (beg (pos-bol))
+             (end (pos-eol))
              (fill-prefix (make-string (- pos beg) ?\s))
              ;; `fill-column' is too small to accommodate the current line
              (fill-column (- end beg 10)))
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index 8361d58b55..55e37b71d8 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -147,13 +147,11 @@
                                     (string-to-number line-limit1))))
                 (goto-char (point-min))
                 (if (> limit-number 0)
-                    (should (= search-limit (line-beginning-position
-                                             (1+ limit-number))))
+                    (should (= search-limit (pos-bol (1+ limit-number))))
                   (should (= search-limit (point-max))))
                 (goto-char (point-max))
                 (if (< limit-number 0)
-                    (should (= start (line-beginning-position
-                                      (1+ limit-number))))
+                    (should (= start (pos-bol (1+ limit-number))))
                   (should (= start (point-min)))))
               (if (equal start1 "")
                   (should (equal ts-start time-stamp-start))
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index 2f25de4cc3..57143dd81e 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -128,7 +128,7 @@
     (save-excursion
       (goto-char (point-max))
       (skip-chars-backward "\n")
-      (buffer-substring (line-beginning-position) (point)))))
+      (buffer-substring (pos-bol) (point)))))
 
 (ert-deftest lread-tests--unescaped-char-literals ()
   "Check that loading warns about unescaped character
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index db8a504478..6e1e148332 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -160,8 +160,7 @@ process to complete."
                         (setq count (1+ count))))))))
       (set-process-query-on-exit-flag proc nil)
       (send-string proc "one\n")
-      (while (not (equal (buffer-substring
-                          (line-beginning-position) (point-max))
+      (while (not (equal (buffer-substring (pos-bol) (point-max))
                          "1> "))
         (accept-process-output proc))   ; Read "one".
       (should (equal (buffer-string) "0> one\n1> "))
@@ -171,8 +170,7 @@ process to complete."
        (accept-process-output proc 1))  ; Can't read "two" yet.
       (should (equal (buffer-string) "0> one\n1> "))
       (set-process-filter proc nil)     ; Resume reading from proc.
-      (while (not (equal (buffer-substring
-                          (line-beginning-position) (point-max))
+      (while (not (equal (buffer-substring (pos-bol) (point-max))
                          "2> "))
         (accept-process-output proc))   ; Read "Two".
       (should (equal (buffer-string) "0> one\n1> two\n2> "))))))
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index c84ed74f0b..cb0822fb1b 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -460,11 +460,10 @@ Demonstrates bug 25599."
                  (delete-overlay ov))))))
       (save-excursion
         (goto-char (point-min))
-        (let ((ov (make-overlay (line-beginning-position 2)
-                                (line-end-position 2))))
+        (let ((ov (make-overlay (pos-bol 2) (pos-eol 2))))
           (overlay-put ov 'insert-in-front-hooks
                        (list overlay-modified)))))
-    (kill-region (point-min) (line-beginning-position 2))
+    (kill-region (point-min) (pos-bol 2))
     (undo-boundary)
     (undo)))
 



reply via email to

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