emacs-diffs
[Top][All Lists]
Advanced

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

master 084007a 2/2: Merge branch 'master' of git.sv.gnu.org:/srv/git/ema


From: Michael Albinus
Subject: master 084007a 2/2: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Date: Fri, 25 Oct 2019 10:52:31 -0400 (EDT)

branch: master
commit 084007a5947980f3b61f52496d89560f9aa5bbf1
Merge: 4bcf3a5 d56e844
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
 build-aux/update-copyright               |  16 +-
 doc/lispref/display.texi                 |  12 +-
 etc/NEWS                                 |  10 +-
 lib/intprops.h                           |  22 +--
 lib/inttypes.in.h                        |   6 +-
 lib/nstrftime.c                          |  19 +-
 lib/verify.h                             |  37 ++--
 lisp/cedet/mode-local.el                 |  96 ++++++----
 lisp/cedet/semantic/bovine/c.el          |   8 +-
 lisp/cedet/semantic/bovine/el.el         |   9 +-
 lisp/cedet/semantic/bovine/grammar.el    |   4 +-
 lisp/cedet/semantic/fw.el                |   9 +-
 lisp/cedet/semantic/grammar-wy.el        |   2 +-
 lisp/cedet/semantic/html.el              |   8 +-
 lisp/cedet/semantic/lex-spp.el           |   2 +-
 lisp/cedet/semantic/texi.el              |   8 +-
 lisp/cedet/semantic/wisent/grammar.el    |   6 +-
 lisp/cedet/semantic/wisent/javascript.el |  15 +-
 lisp/cedet/semantic/wisent/python.el     |   5 -
 lisp/cedet/srecode/map.el                |   4 +-
 lisp/emacs-lisp/rx.el                    |  97 +++++-----
 lisp/gnus/gnus-sum.el                    |   2 +-
 lisp/windmove.el                         | 295 +++++++++----------------------
 23 files changed, 289 insertions(+), 403 deletions(-)

diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index b3f6b29..e4809f6 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -98,7 +98,7 @@
 #   6. Blank lines, even if preceded by the prefix, do not appear
 #      within the FSF copyright statement.
 #   7. Each copyright year is 2 or 4 digits, and years are separated by
-#      commas or dashes.  Whitespace may appear after commas.
+#      commas, "-", or "--".  Whitespace may appear after commas.
 #
 # Environment variables:
 #
@@ -192,7 +192,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
     $holder_re =~ s/\s/$ws_re/g;
     my $stmt_remainder_re =
       "(?:$ws_re$circle_c_re)?"
-      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
+      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*"
       . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
     if (/\G$stmt_remainder_re/)
       {
@@ -231,26 +231,28 @@ if (defined $stmt_re)
         # Make the use of intervals consistent.
         if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
           {
-            $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+            $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg;
           }
         else
           {
+            my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
+
             $stmt =~
               s/
                 (\d{4})
                 (?:
-                  (,\ |-)
+                  (,\ |--?)
                   ((??{
-                    if    ($2 eq '-') { '\d{4}'; }
+                    if   ($2 ne ', ') { '\d{4}'; }
                     elsif (!$3)       { $1 + 1;  }
                     else              { $3 + 1;  }
                   }))
                 )+
-              /$1-$3/gx;
+              /$1$ndash$3/gx;
 
             # When it's 2, emit a single range encompassing all year numbers.
             $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
-              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
+              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/;
           }
 
         # Format within margin.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index d7a1182..6290c89 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -828,7 +828,13 @@ that warning is not logged.
 
 Sometimes, you may wish to avoid showing a warning while a command is
 running, and only show it only after the end of the command.  You can
-use the variable @code{delayed-warnings-list} for this.
+use the function @code{delay-warning} for this.
+
+@defun delay-warning type message &optional level buffer-name
+This function is the delayed counterpart to @code{display-warning}
+(@pxref{Warning Basics}), and it is called with the same arguments.
+The warning message is queued into @code{delayed-warnings-list}.
+@end defun
 
 @defvar delayed-warnings-list
 The value of this variable is a list of warnings to be displayed after
@@ -840,8 +846,8 @@ the current command has finished.  Each element must be a 
list
 
 @noindent
 with the same form, and the same meanings, as the argument list of
-@code{display-warning} (@pxref{Warning Basics}).  Immediately after
-running @code{post-command-hook} (@pxref{Command Overview}), the Emacs
+@code{display-warning}.  Immediately after running
+@code{post-command-hook} (@pxref{Command Overview}), the Emacs
 command loop displays all the warnings specified by this variable,
 then resets it to @code{nil}.
 @end defvar
diff --git a/etc/NEWS b/etc/NEWS
index 01fdf39..56127ba 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -750,6 +750,13 @@ that was in the specified direction.
 to the commands that swap the states of the selected window with the
 window in the specified direction.
 
+*** Windmove code no longer used is now obsolete.  That includes the
+user option 'windmove-window-distance-delta' and the functions
+'windmove-coord-add', 'windmove-constrain-to-range',
+'windmove-constrain-around-range', 'windmove-frame-edges',
+'windmove-constrain-loc-for-movement', 'windmove-wrap-loc-for-movement',
+'windmove-reference-loc' and 'windmove-other-window-loc'.
+
 ** Octave mode
 The mode is automatically enabled in files that start with the
 'function' keyword.
@@ -2170,7 +2177,8 @@ if you set 'time-stamp-format' or 'time-stamp-pattern' 
with a
 file-local variable, you may need to update the value.
 
 ** mode-local
-*** 'define-overload' is declared obsolete.
+*** Declare 'define-overload' and 'define-child-mode' as obsolete
+*** Rename several internal functions to use a ''mode-local-' prefix
 
 
 * New Modes and Packages in Emacs 27.1
diff --git a/lib/intprops.h b/lib/intprops.h
index 36c6359..bf561ad0 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -22,18 +22,6 @@
 
 #include <limits.h>
 
-/* If the compiler lacks __has_builtin, define it well enough for this
-   source file only.  */
-#ifndef __has_builtin
-# define __has_builtin(x) _GL_HAS_##x
-# if 5 <= __GNUC__ && !defined __ICC
-#  define _GL_HAS___builtin_add_overflow 1
-# else
-#  define _GL_HAS___builtin_add_overflow 0
-# endif
-# define _GL_TEMPDEF___has_builtin
-#endif
-
 /* Return a value with the common real type of E and V and the value of V.
    Do not evaluate E.  */
 #define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
@@ -234,8 +222,10 @@
 
 /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
    (A, B, P) work when P is non-null.  */
-#if __has_builtin (__builtin_add_overflow)
+#if 5 <= __GNUC__ && !defined __ICC
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
 #else
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
 #endif
@@ -586,10 +576,4 @@
          : (tmin) / (a) < (b)) \
       : (tmax) / (b) < (a)))
 
-#ifdef _GL_TEMPDEF___has_builtin
-# undef __has_builtin
-# undef _GL_HAS___builtin_add_overflow
-# undef _GL_TEMPDEF___has_builtin
-#endif
-
 #endif /* _GL_INTPROPS_H */
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index 31e40c5..49bcbc1 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -49,15 +49,15 @@
 #ifndef __GLIBC__
 # include <stdint.h>
 #endif
-/* Get CHAR_BIT.  */
+/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc.  */
 #include <limits.h>
 /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
 #if defined _WIN32 && ! defined __CYGWIN__
 # include <stdio.h>
 #endif
 
-#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
-# error "This file assumes that 'int' has exactly 32 bits. Please report your 
platform and compiler to <address@hidden>."
+#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
+# error "This file assumes that 'int' is 32-bit two's complement. Please 
report your platform and compiler to <address@hidden>."
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index bc84da5..461dadb 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -68,6 +68,8 @@ extern char *tzname[];
 #include <string.h>
 #include <stdbool.h>
 
+#include <intprops.h>
+
 #ifndef FALLTHROUGH
 # if __GNUC__ < 7
 #  define FALLTHROUGH ((void) 0)
@@ -113,13 +115,6 @@ extern char *tzname[];
    ? (a) >> (b)         \
    : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))
 
-/* Bound on length of the string representing an integer type or expression T.
-   Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485;
-   add 1 for integer division truncation; add 1 more for a minus sign
-   if needed.  */
-#define INT_STRLEN_BOUND(t) \
-  ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2)
-
 #define TM_YEAR_BASE 1900
 
 #ifndef __isleap
@@ -704,15 +699,9 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG 
(size_t maxsize)
           width = 0;
           do
             {
-              if (width > INT_MAX / 10
-                  || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10))
-                /* Avoid overflow.  */
+              if (INT_MULTIPLY_WRAPV (width, 10, &width)
+                  || INT_ADD_WRAPV (width, *f - L_('0'), &width))
                 width = INT_MAX;
-              else
-                {
-                  width *= 10;
-                  width += *f - L_('0');
-                }
               ++f;
             }
           while (ISDIGIT (*f));
diff --git a/lib/verify.h b/lib/verify.h
index 06e975e..a58005c 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -56,16 +56,6 @@
 # undef _Static_assert
 #endif
 
-/* If the compiler lacks __has_builtin, define it well enough for this
-   source file only.  */
-#ifndef __has_builtin
-# define __has_builtin(x) _GL_HAS_##x
-# define _GL_HAS___builtin_unreachable (4 < __GNUC__ + (5 <= __GNUC_MINOR__))
-# define _GL_HAS___builtin_trap \
-    (3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))
-# define _GL_TEMPDEF___has_builtin
-#endif
-
 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike
    assert (R), there is no run-time overhead.
@@ -243,6 +233,22 @@ template <int w>
 
 /* @assert.h omit start@  */
 
+#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+# define _GL_HAS_BUILTIN_TRAP 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
+#else
+# define _GL_HAS_BUILTIN_TRAP 0
+#endif
+
+#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+#else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#endif
+
 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike
    assert (R), there is no run-time overhead.
@@ -276,11 +282,11 @@ template <int w>
    can suffer if R uses hard-to-optimize features such as function
    calls not inlined by the compiler.  */
 
-#if __has_builtin (__builtin_unreachable)
+#if _GL_HAS_BUILTIN_UNREACHABLE
 # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
 #elif 1200 <= _MSC_VER
 # define assume(R) __assume (R)
-#elif (defined GCC_LINT || defined lint) && __has_builtin (__builtin_trap)
+#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
   /* Doing it this way helps various packages when configured with
      --enable-gcc-warnings, which compiles with -Dlint.  It's nicer
      when 'assume' silences warnings even with older GCCs.  */
@@ -290,13 +296,6 @@ template <int w>
 # define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
 #endif
 
-#ifdef _GL_TEMPDEF___has_builtin
-# undef __has_builtin
-# undef _GL_HAS___builtin_unreachable
-# undef _GL_HAS___builtin_trap
-# undef _GL_TEMPDEF___has_builtin
-#endif
-
 /* @assert.h omit end@  */
 
 #endif
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 602961c..c4e5280 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -126,7 +126,7 @@ after changing the major mode."
     (mode-local-map-file-buffers
      (lambda ()
        ;; Make sure variables are set up for this mode.
-       (activate-mode-local-bindings)
+       (mode-local--activate-bindings)
        (run-hooks 'mode-local-init-hook))
      (lambda ()
        (not (mode-local-initialized-p)))
@@ -139,7 +139,9 @@ after changing the major mode."
 
 ;;; Mode lineage
 ;;
-(defsubst set-mode-local-parent (mode parent)
+(define-obsolete-function-alias 'set-mode-local-parent
+  #'mode-local--set-parent "27.1")
+(defsubst mode-local--set-parent (mode parent)
   "Set parent of major mode MODE to PARENT mode.
 To work properly, this function should be called after PARENT mode
 local variables have been defined."
@@ -147,14 +149,15 @@ local variables have been defined."
   ;; Refresh mode bindings to get mode local variables inherited from
   ;; PARENT. To work properly, the following should be called after
   ;; PARENT mode local variables have been defined.
-  (mode-local-map-mode-buffers #'activate-mode-local-bindings mode))
+  (mode-local-map-mode-buffers #'mode-local--activate-bindings mode))
 
 (defmacro define-child-mode (mode parent &optional _docstring)
   "Make major mode MODE inherit behavior from PARENT mode.
 DOCSTRING is optional and not used.
 To work properly, this should be put after PARENT mode local variables
 definition."
-  `(set-mode-local-parent ',mode ',parent))
+  (declare (obsolete define-derived-mode "27.1"))
+  `(mode-local--set-parent ',mode ',parent))
 
 (defun mode-local-use-bindings-p (this-mode desired-mode)
   "Return non-nil if THIS-MODE can use bindings of DESIRED-MODE."
@@ -176,9 +179,11 @@ behaviors.  Use the function `mode-local-bind' to define 
new bindings.")
 (defvar mode-local-active-mode nil
   "Major mode in which bindings are active.")
 
-(defsubst new-mode-local-bindings ()
+(define-obsolete-function-alias 'new-mode-local-bindings
+  #'mode-local--new-bindings "27.1")
+(defsubst mode-local--new-bindings ()
   "Return a new empty mode bindings symbol table."
-  (make-vector 13 0))
+  (obarray-make 13))
 
 (defun mode-local-bind (bindings &optional plist mode)
   "Define BINDINGS in the specified environment.
@@ -208,7 +213,7 @@ hook."
           ;; Install in given MODE symbol table.  Create a new one if
           ;; needed.
           (setq table (or (get mode 'mode-local-symbol-table)
-                          (new-mode-local-bindings)))
+                          (mode-local--new-bindings)))
           (put mode 'mode-local-symbol-table table))
       ;; Fail if trying to bind mode variables in local context!
       (if (plist-get plist 'mode-variable-flag)
@@ -217,7 +222,7 @@ hook."
       ;; needed.
       (setq table (or mode-local-symbol-table
                       (setq mode-local-symbol-table
-                            (new-mode-local-bindings)))))
+                            (mode-local--new-bindings)))))
     (while bindings
       (setq binding  (car bindings)
             bindings (cdr bindings)
@@ -286,7 +291,9 @@ doesn't have PROPERTY set."
 
 ;;; Mode local variables
 ;;
-(defun activate-mode-local-bindings (&optional mode)
+(define-obsolete-function-alias 'activate-mode-local-bindings
+  #'mode-local--activate-bindings "27.1")
+(defun mode-local--activate-bindings (&optional mode)
   "Activate variables defined locally in MODE and its parents.
 That is, copy mode local bindings into corresponding buffer local
 variables.
@@ -328,7 +335,9 @@ Elements are (SYMBOL . PREVIOUS-VALUE), describing one 
variable."
           table)))
       old-locals)))
 
-(defun deactivate-mode-local-bindings (&optional mode)
+(define-obsolete-function-alias 'deactivate-mode-local-bindings
+  #'mode-local--deactivate-bindings "27.1")
+(defun mode-local--deactivate-bindings (&optional mode)
   "Deactivate variables defined locally in MODE and its parents.
 That is, kill buffer local variables set from the corresponding mode
 local bindings.
@@ -364,19 +373,19 @@ To use the symbol MODE (quoted), use `with-mode-local'."
           )
        (unwind-protect
            (progn
-             (deactivate-mode-local-bindings ,old-mode)
+             (mode-local--deactivate-bindings ,old-mode)
              (setq mode-local-active-mode ,new-mode)
              ;; Save the previous value of buffer-local variables
-             ;; changed by `activate-mode-local-bindings'.
-             (setq ,old-locals (activate-mode-local-bindings ,new-mode))
+             ;; changed by `mode-local--activate-bindings'.
+             (setq ,old-locals (mode-local--activate-bindings ,new-mode))
              ,@body)
-         (deactivate-mode-local-bindings ,new-mode)
+         (mode-local--deactivate-bindings ,new-mode)
          ;; Restore the previous value of buffer-local variables.
          (dolist (,local ,old-locals)
            (set (car ,local) (cdr ,local)))
          ;; Restore the mode local variables.
          (setq mode-local-active-mode ,old-mode)
-         (activate-mode-local-bindings ,old-mode)))))
+         (mode-local--activate-bindings ,old-mode)))))
 
 (defmacro with-mode-local (mode &rest body)
   "With the local bindings of MODE, evaluate BODY.
@@ -453,20 +462,24 @@ DOCSTRING is optional."
 (defun make-obsolete-overload (old new when)
   "Mark OLD overload as obsoleted by NEW overload.
 WHEN is a string describing the first release where it was made obsolete."
-  (put old 'overload-obsoleted-by new)
-  (put old 'overload-obsoleted-since when)
+  (put old 'mode-local--overload-obsoleted-by new)
+  (put old 'mode-local--overload-obsoleted-since when)
   (put old 'mode-local-overload t)
-  (put new 'overload-obsolete old))
+  (put new 'mode-local--overload-obsolete old))
 
-(defsubst overload-obsoleted-by (overload)
+(define-obsolete-function-alias 'overload-obsoleted-by
+  #'mode-local--overload-obsoleted-by "27.1")
+(defsubst mode-local--overload-obsoleted-by (overload)
   "Get the overload symbol obsoleted by OVERLOAD.
 Return the obsolete symbol or nil if not found."
-  (get overload 'overload-obsolete))
+  (get overload 'mode-local--overload-obsolete))
 
-(defsubst overload-that-obsolete (overload)
+(define-obsolete-function-alias 'overload-that-obsolete
+  #'mode-local--overload-that-obsolete "27.1")
+(defsubst mode-local--overload-that-obsolete (overload)
   "Return the overload symbol that obsoletes OVERLOAD.
 Return the symbol found or nil if OVERLOAD is not obsolete."
-  (get overload 'overload-obsoleted-by))
+  (get overload 'mode-local--overload-obsoleted-by))
 
 (defsubst fetch-overload (overload)
   "Return the current OVERLOAD function, or nil if not found.
@@ -474,9 +487,9 @@ First, lookup for OVERLOAD into locally bound mode local 
symbols, then
 in those bound in current `major-mode' and its parents."
   (or (mode-local-symbol-value overload nil 'override-flag)
       ;; If an obsolete overload symbol exists, try it.
-      (and (overload-obsoleted-by overload)
+      (and (mode-local--overload-obsoleted-by overload)
            (mode-local-symbol-value
-            (overload-obsoleted-by overload) nil 'override-flag))))
+            (mode-local--overload-obsoleted-by overload) nil 'override-flag))))
 
 (defun mode-local--override (name args body)
   "Return the form that handles overloading of function NAME.
@@ -566,7 +579,9 @@ OVERARGS is a list of arguments passed to the override and
 (define-obsolete-function-alias 'define-overload
   'define-overloadable-function "27.1")
 
-(defsubst function-overload-p (symbol)
+(define-obsolete-function-alias 'function-overload-p
+  #'mode-local--function-overload-p "27.1")
+(defsubst mode-local--function-overload-p (symbol)
   "Return non-nil if SYMBOL is a function which can be overloaded."
   (and symbol (symbolp symbol) (get symbol 'mode-local-overload)))
 
@@ -601,22 +616,27 @@ BODY is the implementation of this function."
 (defun mode-local-read-function (prompt &optional initial hist default)
   "Interactively read in the name of a mode-local function.
 PROMPT, INITIAL, HIST, and DEFAULT are the same as for `completing-read'."
-  (completing-read prompt obarray 'function-overload-p t initial hist default))
+  (declare (obsolete nil "27.1"))
+  (completing-read prompt obarray #'mode-local--function-overload-p t initial 
hist default))
 
 ;;; Help support
 ;;
-(defun overload-docstring-extension (overload)
+(define-obsolete-function-alias 'overload-docstring-extension
+  #'mode-local--overload-docstring-extension "27.1")
+(defun mode-local--overload-docstring-extension (overload)
   "Return the doc string that augments the description of OVERLOAD."
   (let ((doc "\nThis function can be overloaded\
  with `define-mode-local-override'.")
-        (sym (overload-obsoleted-by overload)))
+        (sym (mode-local--overload-obsoleted-by overload)))
     (when sym
       (setq doc (format "%s\nIt has made the overload `%s' obsolete since %s."
-                        doc sym (get sym 'overload-obsoleted-since))))
-    (setq sym (overload-that-obsolete overload))
+                        doc sym
+                        (get sym 'mode-local--overload-obsoleted-since))))
+    (setq sym (mode-local--overload-that-obsolete overload))
     (when sym
-      (setq doc (format "%s\nThis overload is obsolete since %s;\nUse `%s' 
instead."
-                        doc (get overload 'overload-obsoleted-since) sym)))
+      (setq doc (format
+                 "%s\nThis overload is obsolete since %s;\nUse `%s' instead."
+                 doc (get overload 'mode-local--overload-obsoleted-since) 
sym)))
     doc))
 
 (defun mode-local-augment-function-help (symbol)
@@ -630,7 +650,7 @@ SYMBOL is a function that can be overridden."
       (beginning-of-line)
       (forward-line -1))
     (let ((inhibit-read-only t))
-      (insert (substitute-command-keys (overload-docstring-extension symbol))
+      (insert (substitute-command-keys 
(mode-local--overload-docstring-extension symbol))
               "\n")
       ;; NOTE TO SELF:
       ;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE
@@ -639,16 +659,16 @@ SYMBOL is a function that can be overridden."
 ;; We are called from describe-function in help-fns.el, where this is defined.
 (defvar describe-function-orig-buffer)
 
-(defun describe-mode-local-overload (symbol)
+(defun mode-local--describe-overload (symbol)
   "For `help-fns-describe-function-functions'; add overloads for SYMBOL."
-  (when (function-overload-p symbol)
+  (when (mode-local--function-overload-p symbol)
     (let ((default (or (intern-soft (format "%s-default" (symbol-name symbol)))
                       symbol))
          (override (with-current-buffer describe-function-orig-buffer
                       (fetch-overload symbol)))
           modes)
 
-      (insert (substitute-command-keys (overload-docstring-extension symbol))
+      (insert (substitute-command-keys 
(mode-local--overload-docstring-extension symbol))
               "\n\n")
       (insert (format-message "default function: `%s'\n" default))
       (if override
@@ -671,7 +691,7 @@ SYMBOL is a function that can be overridden."
             )))
       )))
 
-(add-hook 'help-fns-describe-function-functions #'describe-mode-local-overload)
+(add-hook 'help-fns-describe-function-functions 
#'mode-local--describe-overload)
 
 (declare-function xref-item-location "xref" (xref) t)
 
@@ -687,7 +707,7 @@ SYMBOL is a function that can be overridden."
 (defun xref-mode-local-overload (symbol)
   "For `elisp-xref-find-def-functions'; add overloads for SYMBOL."
   ;; Current buffer is the buffer where xref-find-definitions was invoked.
-  (when (function-overload-p symbol)
+  (when (mode-local--function-overload-p symbol)
     (let* ((symbol-file (find-lisp-object-file-name
                         symbol (symbol-function symbol)))
           (default (intern-soft (format "%s-default" (symbol-name symbol))))
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index b05082c..862969d 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -69,8 +69,10 @@ This function does not do any hidden buffer changes."
   )
 
 ;;; Code:
-(define-child-mode c++-mode c-mode
-  "`c++-mode' uses the same parser as `c-mode'.")
+(with-suppressed-warnings ((obsolete define-child-mode))
+  ;; FIXME: We should handle this some other way!
+  (define-child-mode c++-mode c-mode
+  "`c++-mode' uses the same parser as `c-mode'."))
 
 
 ;;; Include Paths
@@ -930,7 +932,7 @@ the regular parser."
            )                           ; save match data
 
          ;; Hack in mode-local
-         (activate-mode-local-bindings)
+         (mode-local--activate-bindings)
          ;; Setup C parser
          (semantic-default-c-setup)
          ;; CHEATER!  The following 3 lines are from
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index dd21f50..590256c 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -496,7 +496,8 @@ used to perform the override."
   (if (and (eq (semantic-tag-class tag) 'function)
           (semantic-tag-get-attribute tag :overloadable))
       ;; Calc the doc to use for the overloadable symbols.
-      (overload-docstring-extension (intern (semantic-tag-name tag)))
+      (mode-local--overload-docstring-extension
+       (intern (semantic-tag-name tag)))
     ""))
 
 (defun semantic-emacs-lisp-obsoleted-doc (tag)
@@ -944,8 +945,10 @@ See `semantic-format-tag-prototype' for Emacs Lisp for 
more details."
   "Add variables.
 ELisp variables can be pretty long, so track this one too.")
 
-(define-child-mode lisp-mode emacs-lisp-mode
-  "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.")
+(with-suppressed-warnings ((obsolete define-child-mode))
+  ;; FIXME: We should handle this some other way!
+  (define-child-mode lisp-mode emacs-lisp-mode
+    "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'."))
 
 ;;;###autoload
 (defun semantic-default-elisp-setup ()
diff --git a/lisp/cedet/semantic/bovine/grammar.el 
b/lisp/cedet/semantic/bovine/grammar.el
index 7c25b79..4d7b008 100644
--- a/lisp/cedet/semantic/bovine/grammar.el
+++ b/lisp/cedet/semantic/bovine/grammar.el
@@ -438,8 +438,8 @@ Menu items are appended to the common grammar menu.")
   "Major mode for editing Bovine grammars."
   (semantic-grammar-setup-menu bovine-grammar-menu)
   (semantic-install-function-overrides
-   '((grammar-parsetable-builder . bovine-grammar-parsetable-builder)
-     (grammar-setupcode-builder  . bovine-grammar-setupcode-builder))))
+   '((semantic-grammar-parsetable-builder . bovine-grammar-parsetable-builder)
+     (semantic-grammar-setupcode-builder  . 
bovine-grammar-setupcode-builder))))
 
 (add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode))
 
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index e07f090..202dec3 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -186,8 +186,8 @@ Mark OLDFNALIAS as obsolete, such that the byte compiler
 will throw a warning when it encounters this symbol."
   (defalias oldfnalias newfn)
   (make-obsolete oldfnalias newfn when)
-  (when (and (function-overload-p newfn)
-             (not (overload-obsoleted-by newfn))
+  (when (and (mode-local--function-overload-p newfn)
+             (not (mode-local--overload-obsoleted-by newfn))
              ;; Only throw this warning when byte compiling things.
              (boundp 'byte-compile-current-file)
              byte-compile-current-file
@@ -261,7 +261,7 @@ FUNCTION does not have arguments.  When FUNCTION is entered
 (semantic-alias-obsolete 'define-mode-overload-implementation
                          'define-mode-local-override "23.2")
 
-(defun semantic-install-function-overrides (overrides &optional transient mode)
+(defun semantic-install-function-overrides (overrides &optional transient)
   "Install the function OVERRIDES in the specified environment.
 OVERRIDES must be an alist ((OVERLOAD .  FUNCTION) ...) where OVERLOAD
 is a symbol identifying an overloadable entry, and FUNCTION is the
@@ -282,8 +282,7 @@ later installation should be done in MODE hook."
             (cons (intern (format "semantic-%s" name)) (cdr e)))))
     overrides)
    (list 'constant-flag (not transient)
-         'override-flag t)
-   mode))
+         'override-flag t)))
 
 ;;; User Interrupt handling
 ;;
diff --git a/lisp/cedet/semantic/grammar-wy.el 
b/lisp/cedet/semantic/grammar-wy.el
index 3b99469..1da5786 100644
--- a/lisp/cedet/semantic/grammar-wy.el
+++ b/lisp/cedet/semantic/grammar-wy.el
@@ -421,7 +421,7 @@
 (defun semantic-grammar-wy--install-parser ()
   "Setup the Semantic Parser."
   (semantic-install-function-overrides
-   '((parse-stream . wisent-parse-stream)))
+   '((semantic-parse-stream . wisent-parse-stream)))
   (setq semantic-parser-name "LALR"
        semantic--parse-table semantic-grammar-wy--parse-table
        semantic-debug-parser-source "grammar.wy"
diff --git a/lisp/cedet/semantic/html.el b/lisp/cedet/semantic/html.el
index 3a8165c..f70fec2 100644
--- a/lisp/cedet/semantic/html.el
+++ b/lisp/cedet/semantic/html.el
@@ -247,13 +247,15 @@ tag with greater section value than LEVEL is found."
        semantic-stickyfunc-sticky-classes '(section)
        )
   (semantic-install-function-overrides
-   '((tag-components . semantic-html-components)
+   '((semantic-tag-components . semantic-html-components)
      )
    t)
   )
 
-(define-child-mode html-helper-mode html-mode
-  "`html-helper-mode' needs the same semantic support as `html-mode'.")
+;; `html-helper-mode' hasn't been updated since 2004, so it's not very
+;; relevant nowadays.
+;;(define-child-mode html-helper-mode html-mode
+;;  "`html-helper-mode' needs the same semantic support as `html-mode'.")
 
 (provide 'semantic/html)
 
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index d07dc80..a81b23c 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -1071,7 +1071,7 @@ and variable state from the current buffer."
              (error nil))
 
            ;; Hack in mode-local
-           (activate-mode-local-bindings)
+           (mode-local--activate-bindings)
 
            ;; Call the major mode's setup function
            (let ((entry (assq major-mode semantic-new-buffer-setup-functions)))
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index 3a0050b..73f0e73 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -63,9 +63,9 @@ Each tag returned is of the form:
 or
  (\"NAME\" def)
 
-It is an override of 'parse-region and must be installed by the
+It is an override of `semantic-parse-region' and must be installed by the
 function `semantic-install-function-overrides'."
-  (mapcar 'semantic-texi-expand-tag
+  (mapcar #'semantic-texi-expand-tag
           (semantic-texi-parse-headings)))
 
 (defun semantic-texi-parse-changes ()
@@ -451,8 +451,8 @@ that start with that symbol."
   "Set up a buffer for parsing of Texinfo files."
   ;; This will use our parser.
   (semantic-install-function-overrides
-   '((parse-region . semantic-texi-parse-region)
-     (parse-changes . semantic-texi-parse-changes)))
+   '((semantic-parse-region . semantic-texi-parse-region)
+     (semantic-parse-changes . semantic-texi-parse-changes)))
   (setq semantic-parser-name "TEXI"
         ;; Setup a dummy parser table to enable parsing!
         semantic--parse-table t
diff --git a/lisp/cedet/semantic/wisent/grammar.el 
b/lisp/cedet/semantic/wisent/grammar.el
index e6b389b..1254f99 100644
--- a/lisp/cedet/semantic/wisent/grammar.el
+++ b/lisp/cedet/semantic/wisent/grammar.el
@@ -297,7 +297,7 @@ Return the expanded expression."
   "Return the parser setup code."
   (format
    "(semantic-install-function-overrides\n\
-      '((parse-stream . wisent-parse-stream)))\n\
+      '((semantic-parse-stream . wisent-parse-stream)))\n\
     (setq semantic-parser-name \"LALR\"\n\
           semantic--parse-table %s\n\
           semantic-debug-parser-source %S\n\
@@ -326,8 +326,8 @@ Menu items are appended to the common grammar menu.")
   "Major mode for editing Wisent grammars."
   (semantic-grammar-setup-menu wisent-grammar-menu)
   (semantic-install-function-overrides
-   '((grammar-parsetable-builder . wisent-grammar-parsetable-builder)
-     (grammar-setupcode-builder  . wisent-grammar-setupcode-builder))))
+   '((semantic-grammar-parsetable-builder . wisent-grammar-parsetable-builder)
+     (semantic-grammar-setupcode-builder  . 
wisent-grammar-setupcode-builder))))
 
 (defvar-mode-local wisent-grammar-mode semantic-grammar-macros
   '(
diff --git a/lisp/cedet/semantic/wisent/javascript.el 
b/lisp/cedet/semantic/wisent/javascript.el
index 7722c95..4c93c0d 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -64,13 +64,13 @@ to this variable NAME."
 ;; the tags created by the javascript parser.
 ;; Local context
 (define-mode-local-override semantic-get-local-variables
-  javascript-mode ()
+  js-mode ()
   "Get local values from a specific context.
 This function overrides `get-local-variables'."
   ;; Does javascript have identifiable local variables?
   nil)
 
-(define-mode-local-override semantic-tag-protection javascript-mode (tag 
&optional parent)
+(define-mode-local-override semantic-tag-protection js-mode (tag &optional 
parent)
   "Return protection information about TAG with optional PARENT.
 This function returns on of the following symbols:
    nil         - No special protection.  Language dependent.
@@ -85,14 +85,14 @@ The default behavior (if not overridden with 
`tag-protection'
 is to return a symbol based on type modifiers."
   nil)
 
-(define-mode-local-override semantic-analyze-scope-calculate-access 
javascript-mode (type scope)
+(define-mode-local-override semantic-analyze-scope-calculate-access js-mode 
(type scope)
   "Calculate the access class for TYPE as defined by the current SCOPE.
 Access is related to the :parents in SCOPE.  If type is a member of SCOPE
 then access would be 'private.  If TYPE is inherited by a member of SCOPE,
 the access would be 'protected.  Otherwise, access is 'public."
   nil)
 
-(define-mode-local-override semantic-ctxt-current-symbol javascript-mode 
(&optional point)
+(define-mode-local-override semantic-ctxt-current-symbol js-mode (&optional 
point)
   "Return the current symbol the cursor is on at POINT in a list.
 This is a very simple implementation for Javascript symbols.  It
 will at maximum do one split, so that the first part is seen as
@@ -117,13 +117,6 @@ This is currently needed for the mozrepl omniscient 
database."
 
 ;;; Setup Function
 ;;
-;; Since javascript-mode is an alias for js-mode, let it inherit all
-;; the overrides.
-(define-child-mode js-mode javascript-mode)
-
-;; Since javascript-mode is an alias for js-mode, let it inherit all
-;; the overrides.
-(define-child-mode js-mode javascript-mode)
 
 ;; In semantic-imenu.el, not part of Emacs.
 (defvar semantic-imenu-summary-function)
diff --git a/lisp/cedet/semantic/wisent/python.el 
b/lisp/cedet/semantic/wisent/python.el
index f0e294e..540c59b 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -530,11 +530,6 @@ Shortens `code' tags, but passes through for others."
                                      (code . "Code")))
    )
 
-;; Make sure the newer python modes pull in the same python
-;; mode overrides.
-(define-child-mode python-2-mode python-mode "Python 2 mode")
-(define-child-mode python-3-mode python-mode "Python 3 mode")
-
 
 ;;; Utility functions
 ;;
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index 08ff0e6..343cc91 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -346,8 +346,8 @@ if that file is NEW, otherwise assume the mode has not 
changed."
 Argument FAST implies that the file should not be reparsed if there
 is already an entry for it.
 Return non-nil if the map changed."
-  (when (or (not fast)
-           (not (srecode-map-entry-for-file-anywhere srecode-current-map 
file)))
+  (unless (and fast
+               (srecode-map-entry-for-file-anywhere srecode-current-map file))
     (let ((buff-orig (get-file-buffer file))
          (dirty nil))
       (save-excursion
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 2370948..d7677f1 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -122,9 +122,27 @@ Each entry is:
                     as the rx form DEF (which can contain members of ARGS).")
 
 (defsubst rx--lookup-def (name)
+  "Current definition of NAME: (DEF) or (ARGS DEF), or nil if none."
   (or (cdr (assq name rx--local-definitions))
       (get name 'rx-definition)))
 
+(defun rx--expand-def (form)
+  "FORM expanded (once) if a user-defined construct; otherwise nil."
+  (cond ((symbolp form)
+         (let ((def (rx--lookup-def form)))
+           (and def
+                (if (cdr def)
+                    (error "Not an `rx' symbol definition: %s" form)
+                  (car def)))))
+        ((consp form)
+         (let* ((op (car form))
+                (def (rx--lookup-def op)))
+           (and def
+                (if (cdr def)
+                    (rx--expand-template
+                     op (cdr form) (nth 0 def) (nth 1 def))
+                  (error "Not an `rx' form definition: %s" op)))))))
+
 ;; TODO: Additions to consider:
 ;; - A construct like `or' but without the match order guarantee,
 ;;   maybe `unordered-or'.  Useful for composition or generation of
@@ -155,11 +173,8 @@ Each entry is:
       ((let ((class (cdr (assq sym rx--char-classes))))
          (and class (cons (list (concat "[[:" (symbol-name class) ":]]")) t))))
 
-      ((let ((definition (rx--lookup-def sym)))
-         (and definition
-              (if (cdr definition)
-                  (error "Not an `rx' symbol definition: %s" sym)
-                (rx--translate (nth 0 definition))))))
+      ((let ((expanded (rx--expand-def sym)))
+         (and expanded (rx--translate expanded))))
 
       ;; For compatibility with old rx.
       ((let ((entry (assq sym rx-constituents)))
@@ -446,21 +461,23 @@ If NEGATED, negate the sense (thus making it positive)."
     (error "rx `not' form takes exactly one argument"))
   (let ((arg (car body)))
     (cond
-     ((consp arg)
-      (pcase (car arg)
-        ((or 'any 'in 'char) (rx--translate-any      (not negated) (cdr arg)))
-        ('syntax             (rx--translate-syntax   (not negated) (cdr arg)))
-        ('category           (rx--translate-category (not negated) (cdr arg)))
-        ('not                (rx--translate-not      (not negated) (cdr arg)))
-        (_ (error "Illegal argument to rx `not': %S" arg))))
+     ((and (consp arg)
+           (pcase (car arg)
+             ((or 'any 'in 'char)
+              (rx--translate-any      (not negated) (cdr arg)))
+             ('syntax
+              (rx--translate-syntax   (not negated) (cdr arg)))
+             ('category
+              (rx--translate-category (not negated) (cdr arg)))
+             ('not
+              (rx--translate-not      (not negated) (cdr arg))))))
+     ((let ((class (cdr (assq arg rx--char-classes))))
+        (and class
+             (rx--translate-any (not negated) (list class)))))
      ((eq arg 'word-boundary)
       (rx--translate-symbol
        (if negated 'word-boundary 'not-word-boundary)))
-     (t
-      (let ((class (cdr (assq arg rx--char-classes))))
-        (if class
-            (rx--translate-any (not negated) (list class))
-          (error "Illegal argument to rx `not': %s" arg)))))))
+     (t (error "Illegal argument to rx `not': %S" arg)))))
 
 (defun rx--atomic-regexp (item)
   "ITEM is (REGEXP . PRECEDENCE); return a regexp of precedence t."
@@ -874,30 +891,28 @@ can expand to any number of values."
       ((or 'regexp 'regex)      (rx--translate-regexp body))
 
       (op
-       (unless (symbolp op)
-         (error "Bad rx operator `%S'" op))
-       (let ((definition (rx--lookup-def op)))
-         (if definition
-             (if (cdr definition)
-                 (rx--translate
-                  (rx--expand-template
-                   op body (nth 0 definition) (nth 1 definition)))
-               (error "Not an `rx' form definition: %s" op))
-
-           ;; For compatibility with old rx.
-           (let ((entry (assq op rx-constituents)))
-             (if (progn
-                   (while (and entry (not (consp (cdr entry))))
-                     (setq entry
-                           (if (symbolp (cdr entry))
-                               ;; Alias for another entry.
-                               (assq (cdr entry) rx-constituents)
-                             ;; Wrong type, try further down the list.
-                             (assq (car entry)
-                                   (cdr (memq entry rx-constituents))))))
-                   entry)
-                 (rx--translate-compat-form (cdr entry) form)
-               (error "Unknown rx form `%s'" op)))))))))
+       (cond
+        ((not (symbolp op)) (error "Bad rx operator `%S'" op))
+
+        ((let ((expanded (rx--expand-def form)))
+           (and expanded
+                (rx--translate expanded))))
+
+        ;; For compatibility with old rx.
+        ((let ((entry (assq op rx-constituents)))
+           (and (progn
+                  (while (and entry (not (consp (cdr entry))))
+                    (setq entry
+                          (if (symbolp (cdr entry))
+                              ;; Alias for another entry.
+                              (assq (cdr entry) rx-constituents)
+                            ;; Wrong type, try further down the list.
+                            (assq (car entry)
+                                  (cdr (memq entry rx-constituents))))))
+                  entry)
+                (rx--translate-compat-form (cdr entry) form))))
+
+        (t (error "Unknown rx form `%s'" op)))))))
 
 (defconst rx--builtin-forms
   '(seq sequence : and or | any in char not-char not
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b5d7448..f21bc75 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -334,7 +334,7 @@ If threads are hidden, you have to run the command
   :group 'gnus-thread
   :type '(radio (sexp :format "Non-nil\n"
                      :match (lambda (widget value)
-                              (not (or (consp value) (functionp value))))
+                              (and value (not (functionp value))))
                      :value t)
                (const nil)
                (sexp :tag "Predicate specifier")))
diff --git a/lisp/windmove.el b/lisp/windmove.el
index f5f5148..16a5ca8 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -109,14 +109,6 @@
 ;;
 ;;    (setq windmove-wrap-around t)
 ;;
-;;
-;; Note: If you have an Emacs that manifests a bug that sometimes
-;; causes the occasional creation of a "lost column" between windows,
-;; so that two adjacent windows do not actually touch, you may want to
-;; increase the value of `windmove-window-distance-delta' to 2 or 3:
-;;
-;;     (setq windmove-window-distance-delta 2)
-;;
 
 ;; Acknowledgments:
 ;;
@@ -167,150 +159,41 @@ to a value larger than 1 may be useful in getting around 
window-
 placement bugs in old versions of Emacs."
   :type 'number
   :group 'windmove)
+(make-obsolete-variable 'windmove-window-distance-delta
+                        "no longer used." "27.1")
 
 
-;; Implementation overview:
-;;
-;; The conceptual framework behind this code is all fairly simple.  We
-;; are on one window; we wish to move to another.  The correct window
-;; to move to is determined by the position of point in the current
-;; window as well as the overall window setup.
-;;
-;; Early on, I made the decision to base my implementation around the
-;; built-in function `window-at'.  This function takes a frame-based
-;; coordinate, and returns the window that contains it.  Using this
-;; function, the job of the various top-level windmove functions can
-;; be decomposed: first, find the current frame-based location of
-;; point; second, manipulate it in some way to give a new location,
-;; that hopefully falls in the window immediately at left (or right,
-;; etc.); third, use `window-at' and `select-window' to select the
-;; window at that new location.
-;;
-;; This is probably not the only possible architecture, and it turns
-;; out to have some inherent cruftiness.  (Well, okay, the third step
-;; is pretty clean....)  We will consider each step in turn.
-;;
-;; A quick digression about coordinate frames: most of the functions
-;; in the windmove package deal with screen coordinates in one way or
-;; another.  These coordinates are always relative to some reference
-;; points.  Window-based coordinates have their reference point in the
-;; upper-left-hand corner of whatever window is being talked about;
-;; frame-based coordinates have their reference point in the
-;; upper-left-hand corner of the entire frame (of which the current
-;; window is a component).
-;;
-;; All coordinates are zero-based, which simply means that the
-;; reference point (whatever it is) is assigned the value (x=0, y=0).
-;; X-coordinates grow down the screen, and Y-coordinates grow towards
-;; the right of the screen.
-;;
-;; Okay, back to work.  The first step is to gather information about
-;; the frame-based coordinates of point, or rather, the reference
-;; location.  The reference location can be point, or the upper-left,
-;; or the lower-right corner of the window; the particular one used is
-;; controlled by the prefix argument to `windmove-left' and all the
-;; rest.
-;;
-;; This work is done by `windmove-reference-loc'.  It can figure out
-;; the locations of the corners by calling `window-edges' combined
-;; with the result of `posn-at-point'.
-;;
-;; The second step is more messy.  Conceptually, it is fairly simple:
-;; if we know the reference location, and the coordinates of the
-;; current window, we can "throw" our reference point just over the
-;; appropriate edge of the window, and see what other window is
-;; there.  More explicitly, consider this example from the user
-;; documentation above.
-;;
-;;                    -------------
-;;                    |      | A  |
-;;                    |      |    |
-;;                    |      |-----
-;;                    | *    |    |    (* is point in the currently
-;;                    |      | B  |     selected window)
-;;                    |      |    |
-;;                    -------------
-;;
-;; The asterisk marks the reference point; we wish to move right.
-;; Since we are moving horizontally, the Y coordinate of the new
-;; location will be the same.  The X coordinate can be such that it is
-;; just past the edge of the present window.  Obviously, the new point
-;; will be inside window B.  This in itself is fairly simple: using
-;; the result of `windmove-reference-loc' and `window-edges', all the
-;; necessary math can be performed.  (Having said that, there is a
-;; good deal of room for off-by-one errors, and Emacs 19.34, at least,
-;; sometimes manifests a bug where two windows don't actually touch,
-;; so a larger skip is required.)  The actual math here is done by
-;; `windmove-other-window-loc'.
-;;
-;; But we can't just pass the result of `windmove-other-window-loc' to
-;; `window-at' directly.  Why not?  Suppose a move would take us off
-;; the edge of the screen, say to the left.  We want to give a
-;; descriptive error message to the user.  Or, suppose that a move
-;; would place us in the minibuffer.  What if the minibuffer is
-;; inactive?
-;;
-;; Actually, the whole subject of the minibuffer edge of the frame is
-;; rather messy.  It turns out that with a sufficiently large delta,
-;; we can fly off the bottom edge of the frame and miss the minibuffer
-;; altogether.  This, I think, is never right: if there's a minibuffer
-;; and you're not in it, and you move down, the minibuffer should be
-;; in your way.
-;;
-;; (By the way, I'm not totally sure that the code does the right
-;; thing in really weird cases, like a frame with no minibuffer.)
-;;
-;; So, what we need is some ways to do constraining and such.  The
-;; early versions of windmove took a fairly simplistic approach to all
-;; this.  When I added the wrap-around option, those internals had to
-;; be rewritten.  After a *lot* of futzing around, I came up with a
-;; two-step process that I think is general enough to cover the
-;; relevant cases.  (I'm not totally happy with having to pass the
-;; window variable as deep as I do, but we can't have everything.)
-;;
-;; In the first phase, we make sure that the new location is sane.
-;; "Sane" means that we can only fall of the edge of the frame in the
-;; direction we're moving in, and that we don't miss the minibuffer if
-;; we're moving down and not already in the minibuffer.  The function
-;; `windmove-constrain-loc-for-movement' takes care of all this.
+;; Note:
 ;;
-;; Then, we handle the wraparound, if it's enabled.  The function
-;; `windmove-wrap-loc-for-movement' takes coordinate values (both X
-;; and Y) that fall off the edge of the frame, and replaces them with
-;; values on the other side of the frame.  It also has special
-;; minibuffer-handling code again, because we want to wrap through the
-;; minibuffer if it's not enabled.
-;;
-;; So, that's it.  Seems to work.  All of this work is done by the fun
-;; function `windmove-find-other-window'.
-;;
-;; So, now we have a window to move to (or nil if something's gone
-;; wrong).  The function `windmove-do-window-select' is the main
-;; driver function: it actually does the `select-window'.  It is
-;; called by four little convenience wrappers, `windmove-left',
-;; `windmove-up', `windmove-right', and `windmove-down', which make
-;; for convenient keybinding.
-
+;; The functions that follow were used in the implementation of
+;; `windmove-find-other-window', but they are known to be unreliable
+;; after the window and frame rework done in 2013, so they are no
+;; longer used or maintained; their functionality is subsumed in the
+;; new function `window-in-direction'.  They are kept only for
+;; compatibility and will be removed in the future.  Please consider
+;; using the new window interfaces documented in "(elisp)Windows".
 
 ;; Quick & dirty utility function to add two (x . y) coords.
 (defun windmove-coord-add (coord1 coord2)
   "Add the two coordinates.
 Both COORD1 and COORD2 are coordinate cons pairs, (HPOS . VPOS).  The
 result is another coordinate cons pair."
+  (declare (obsolete "no longer used." "27.1"))
   (cons (+ (car coord1) (car coord2))
         (+ (cdr coord1) (cdr coord2))))
 
-
 (defun windmove-constrain-to-range (n min-n max-n)
   "Ensure that N is between MIN-N and MAX-N inclusive by constraining.
 If N is less than MIN-N, return MIN-N; if greater than MAX-N, return
 MAX-N."
+  (declare (obsolete "no longer used." "27.1"))
   (max min-n (min n max-n)))
 
 (defun windmove-constrain-around-range (n min-n max-n)
   "Ensure that N is between MIN-N and MAX-N inclusive by wrapping.
 If N is less than MIN-N, return MAX-N; if greater than MAX-N, return
 MIN-N."
+  (declare (obsolete "no longer used." "27.1"))
   (cond
    ((< n min-n) max-n)
    ((> n max-n) min-n)
@@ -324,26 +207,9 @@ of the frame; (X-MAX, Y-MAX) is the zero-based coordinate 
of the
 bottom-right corner of the frame.
 For example, if a frame has 76 rows and 181 columns, the return value
 from `windmove-frame-edges' will be the list (0 0 180 75)."
-  (let* ((frame (if window
-                   (window-frame window)
-                 (selected-frame)))
-        (top-left (window-edges (frame-first-window frame)))
-        (x-min (nth 0 top-left))
-        (y-min (nth 1 top-left))
-        (x-max (1- (frame-width frame))) ; 1- for last row & col
-        (y-max (1- (frame-height frame))))
-    (list x-min y-min x-max y-max)))
-
-;; it turns out that constraining is always a good thing, even when
-;; wrapping is going to happen.  this is because:
-;; first, since we disallow exotic diagonal-around-a-corner type
-;; movements, so we can always fix the unimportant direction (the one
-;; we're not moving in).
-;; second, if we're moving down and we're not in the minibuffer, then
-;; constraining the y coordinate to max-y is okay, because if that
-;; falls in the minibuffer and the minibuffer isn't active, that y
-;; coordinate will still be off the bottom of the frame as the
-;; wrapping function sees it and so will get wrapped around anyway.
+  (declare (obsolete "no longer used." "27.1"))
+  (window-edges (frame-root-window window)))
+
 (defun windmove-constrain-loc-for-movement (coord window dir)
   "Constrain COORD so that it is reasonable for the given movement.
 This involves two things: first, make sure that the \"off\" coordinate
@@ -355,59 +221,56 @@ accidentally.  WINDOW is the window that movement is 
relative to; DIR
 is the direction of the movement, one of `left', `up', `right',
 or `down'.
 Returns the constrained coordinate."
-  (let ((frame-edges (windmove-frame-edges window))
-        (in-minibuffer (window-minibuffer-p window)))
-    (let ((min-x (nth 0 frame-edges))
-          (min-y (nth 1 frame-edges))
-          (max-x (nth 2 frame-edges))
-          (max-y (nth 3 frame-edges)))
-      (let ((new-x
-             (if (memq dir '(up down))    ; vertical movement
-                 (windmove-constrain-to-range (car coord) min-x max-x)
-               (car coord)))
-            (new-y
-             (if (or (memq dir '(left right)) ; horizontal movement
-                     (and (eq dir 'down)
-                          (not in-minibuffer))) ; don't miss minibuffer
-                 ;; (technically, we shouldn't constrain on min-y in the
-                 ;; second case, but this shouldn't do any harm on a
-                 ;; down movement.)
-                 (windmove-constrain-to-range (cdr coord) min-y max-y)
-               (cdr coord))))
-        (cons new-x new-y)))))
-
-;; having constrained in the limited sense of windmove-constrain-loc-
-;; for-movement, the wrapping code is actually much simpler than it
-;; otherwise would be.  the only complication is that we need to check
-;; if the minibuffer is active, and, if not, pretend that it's not
-;; even part of the frame.
+  (declare (obsolete "no longer used." "27.1"))
+  (with-suppressed-warnings ((obsolete windmove-frame-edges
+                                       windmove-constrain-to-range))
+    (let ((frame-edges (windmove-frame-edges window))
+          (in-minibuffer (window-minibuffer-p window)))
+      (let ((min-x (nth 0 frame-edges))
+            (min-y (nth 1 frame-edges))
+            (max-x (nth 2 frame-edges))
+            (max-y (nth 3 frame-edges)))
+        (let ((new-x
+               (if (memq dir '(up down)) ; vertical movement
+                   (windmove-constrain-to-range (car coord) min-x max-x)
+                 (car coord)))
+              (new-y
+               (if (or (memq dir '(left right)) ; horizontal movement
+                       (and (eq dir 'down)
+                            (not in-minibuffer))) ; don't miss minibuffer
+                   ;; (technically, we shouldn't constrain on min-y in the
+                   ;; second case, but this shouldn't do any harm on a
+                   ;; down movement.)
+                   (windmove-constrain-to-range (cdr coord) min-y max-y)
+                 (cdr coord))))
+          (cons new-x new-y))))))
+
 (defun windmove-wrap-loc-for-movement (coord window)
   "Takes the constrained COORD and wraps it around for the movement.
 This makes an out-of-range x or y coordinate and wraps it around the
 frame, giving a coordinate (hopefully) in the window on the other edge
 of the frame.  WINDOW is the window that movement is relative to (nil
 means the currently selected window).  Returns the wrapped coordinate."
-  (let* ((frame-edges (windmove-frame-edges window))
-         (frame-minibuffer (minibuffer-window (if window
-                                                  (window-frame window)
-                                                (selected-frame))))
-         (minibuffer-active (minibuffer-window-active-p
+  (declare (obsolete "no longer used." "27.1"))
+  (with-suppressed-warnings ((obsolete windmove-frame-edges
+                                       windmove-constrain-around-range))
+    (let* ((frame-edges (windmove-frame-edges window))
+           (frame-minibuffer (minibuffer-window (if window
+                                                    (window-frame window)
+                                                  (selected-frame))))
+           (minibuffer-active (minibuffer-window-active-p
                                frame-minibuffer)))
-    (let ((min-x (nth 0 frame-edges))
-          (min-y (nth 1 frame-edges))
-          (max-x (nth 2 frame-edges))
-          (max-y (if (not minibuffer-active)
-                     (- (nth 3 frame-edges)
-                        (window-height frame-minibuffer))
-                   (nth 3 frame-edges))))
-      (cons
-       (windmove-constrain-around-range (car coord) min-x max-x)
-       (windmove-constrain-around-range (cdr coord) min-y max-y)))))
-
-
-;; This calculates the reference location in the current window: the
-;; frame-based (x . y) of either point, the top-left, or the
-;; bottom-right of the window, depending on ARG.
+      (let ((min-x (nth 0 frame-edges))
+            (min-y (nth 1 frame-edges))
+            (max-x (nth 2 frame-edges))
+            (max-y (if (not minibuffer-active)
+                       (- (nth 3 frame-edges)
+                          (window-height frame-minibuffer))
+                     (nth 3 frame-edges))))
+        (cons
+         (windmove-constrain-around-range (car coord) min-x max-x)
+         (windmove-constrain-around-range (cdr coord) min-y max-y))))))
+
 (defun windmove-reference-loc (&optional arg window)
   "Return the reference location for directional window selection.
 Return a coordinate (HPOS . VPOS) that is frame-based.  If ARG is nil
@@ -415,6 +278,7 @@ or not supplied, the reference point is the buffer's point 
in the
 currently-selected window, or WINDOW if supplied; otherwise, it is the
 top-left or bottom-right corner of the selected window, or WINDOW if
 supplied, if ARG is greater or smaller than zero, respectively."
+  (declare (obsolete "no longer used." "27.1"))
   (let ((effective-arg (if (null arg) 0 (prefix-numeric-value arg)))
         (edges (window-inside-edges window)))
     (let ((top-left (cons (nth 0 edges)
@@ -429,25 +293,26 @@ supplied, if ARG is greater or smaller than zero, 
respectively."
        ((< effective-arg 0)
        bottom-right)
        ((= effective-arg 0)
-       (windmove-coord-add
-        top-left
-        ;; Don't care whether window is horizontally scrolled -
-        ;; `posn-at-point' handles that already.  See also:
-        ;; https://lists.gnu.org/r/emacs-devel/2012-01/msg00638.html
-        (posn-col-row
-         (posn-at-point (window-point window) window))))))))
-
-;; This uses the reference location in the current window (calculated
-;; by `windmove-reference-loc' above) to find a reference location
-;; that will hopefully be in the window we want to move to.
+        (with-suppressed-warnings ((obsolete windmove-coord-add))
+         (windmove-coord-add
+          top-left
+          ;; Don't care whether window is horizontally scrolled -
+          ;; `posn-at-point' handles that already.  See also:
+          ;; https://lists.gnu.org/r/emacs-devel/2012-01/msg00638.html
+          (posn-col-row
+           (posn-at-point (window-point window) window)))))))))
+
 (defun windmove-other-window-loc (dir &optional arg window)
   "Return a location in the window to be moved to.
 Return value is a frame-based (HPOS . VPOS) value that should be moved
 to.  DIR is one of `left', `up', `right', or `down'; an optional ARG
 is handled as by `windmove-reference-loc'; WINDOW is the window that
 movement is relative to."
+  (declare (obsolete "no longer used." "27.1"))
   (let ((edges (window-edges window))   ; edges: (x0, y0, x1, y1)
-        (refpoint (windmove-reference-loc arg window))) ; (x . y)
+        (refpoint (with-suppressed-warnings
+                      ((obsolete windmove-reference-loc))
+                    (windmove-reference-loc arg window)))) ; (x . y)
     (cond
      ((eq dir 'left)
       (cons (- (nth 0 edges)
@@ -471,15 +336,19 @@ movement is relative to."
 ;; Rewritten on 2013-12-13 using `window-in-direction'.  After the
 ;; pixelwise change the old approach didn't work any more.  martin
 (defun windmove-find-other-window (dir &optional arg window)
-  "Return the window object in direction DIR.
-DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'."
+  "Return the window object in direction DIR as seen from WINDOW.
+DIR is one of `left', `up', `right', or `down'.
+WINDOW must be a live window and defaults to the selected one.
+Optional ARG, if negative, means to use the right or bottom edge of
+WINDOW as reference position, instead of `window-point'; if positive,
+use the left or top edge of WINDOW as reference point."
   (window-in-direction dir window nil arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
-;; `windmove-other-window-loc', or screams if there's no window there.
+;; `windmove-find-other-window', or screams if there's no window there.
 (defun windmove-do-window-select (dir &optional arg window)
-  "Move to the window at direction DIR.
-DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'.
+  "Move to the window at direction DIR as seen from WINDOW.
+DIR, ARG, and WINDOW are handled as by `windmove-find-other-window'.
 If no window is at direction DIR, an error is signaled.
 If `windmove-create-window' is non-nil, try to create a new window
 in direction DIR instead."



reply via email to

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