emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/compat 1169ae8490 5/5: compat-macs: Rename :prefix to :


From: ELPA Syncer
Subject: [elpa] externals/compat 1169ae8490 5/5: compat-macs: Rename :prefix to :explicit
Date: Tue, 3 Jan 2023 14:57:29 -0500 (EST)

branch: externals/compat
commit 1169ae8490f91dc5ed2321febda4d90c8b021047
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    compat-macs: Rename :prefix to :explicit
---
 compat-24.el    | 12 ++++++------
 compat-25.el    |  2 +-
 compat-26.el    | 16 ++++++++--------
 compat-27.el    | 16 ++++++++--------
 compat-28.el    | 16 ++++++++--------
 compat-29.el    | 10 +++++-----
 compat-macs.el  | 19 +++++++++----------
 compat-tests.el |  2 +-
 8 files changed, 46 insertions(+), 47 deletions(-)

diff --git a/compat-24.el b/compat-24.el
index 46bc069ebb..0934bf024c 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -54,7 +54,7 @@ See `compat-function' for the compatibility function 
resolution."
 
 (compat-defun = (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :prefix t
+  :explicit t
   (catch 'fail
     (while numbers-or-markers
       (unless (= number-or-marker (car numbers-or-markers))
@@ -64,7 +64,7 @@ See `compat-function' for the compatibility function 
resolution."
 
 (compat-defun < (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :prefix t
+  :explicit t
   (catch 'fail
     (while numbers-or-markers
       (unless (< number-or-marker (car numbers-or-markers))
@@ -74,7 +74,7 @@ See `compat-function' for the compatibility function 
resolution."
 
 (compat-defun > (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :prefix t
+  :explicit t
   (catch 'fail
     (while numbers-or-markers
       (unless (> number-or-marker (car numbers-or-markers))
@@ -84,7 +84,7 @@ See `compat-function' for the compatibility function 
resolution."
 
 (compat-defun <= (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :prefix t
+  :explicit t
   (catch 'fail
     (while numbers-or-markers
       (unless (<= number-or-marker (car numbers-or-markers))
@@ -94,7 +94,7 @@ See `compat-function' for the compatibility function 
resolution."
 
 (compat-defun >= (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :prefix t
+  :explicit t
   (catch 'fail
     (while numbers-or-markers
       (unless (>= number-or-marker (pop numbers-or-markers))
@@ -292,7 +292,7 @@ attention to case differences."
   "Extend `split-string' by a TRIM argument.
 The remaining arguments STRING, SEPARATORS and OMIT-NULLS are
 handled just as with `split-string'."
-  :prefix t
+  :explicit t
   (let* ((token (split-string string separators omit-nulls))
          (trimmed (if trim
                       (mapcar
diff --git a/compat-25.el b/compat-25.el
index 997eb119bb..a8f7c4e22d 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -50,7 +50,7 @@ usage: (bool-vector &rest OBJECTS)"
 
 (compat-defun sort (seq predicate)
   "Extend `sort' to sort SEQ as a vector."
-  :prefix t
+  :explicit t
   (cond
    ((listp seq)
     (sort seq predicate))
diff --git a/compat-26.el b/compat-26.el
index 2a3b942c96..5dfa05412c 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -116,7 +116,7 @@ Equality is defined by the function TESTFN, defaulting to
 `equal'.  TESTFN is called with 2 arguments: a car of an alist
 element and KEY.  With no optional argument, the function behaves
 just like `assoc'."
-  :prefix t
+  :explicit t
   (if testfn
       (catch 'found
         (dolist (ent alist)
@@ -138,7 +138,7 @@ If the buffer is narrowed, the return value by default 
counts the lines
 from the beginning of the accessible portion of the buffer.  But if the
 second optional argument ABSOLUTE is non-nil, the value counts the lines
 from the absolute start of the buffer, disregarding the narrowing."
-  :prefix t
+  :explicit t
   (if absolute
       (save-restriction
         (widen)
@@ -150,7 +150,7 @@ from the absolute start of the buffer, disregarding the 
narrowing."
 (declare-function alist-get nil (key alist &optional default remove))
 (compat-defun alist-get (key alist &optional default remove testfn)
   "Handle TESTFN manually."
-  :prefix t
+  :explicit t
   (if testfn
       (compat--alist-get-full-elisp key alist default remove testfn)
     (alist-get key alist default remove)))
@@ -191,7 +191,7 @@ from the absolute start of the buffer, disregarding the 
narrowing."
 
 REGEXP defaults to \"[ \\t\\n\\r]+\"."
   :realname compat--internal-string-trim-left
-  :prefix t
+  :explicit t
   (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string)
       (substring string (match-end 0))
     string))
@@ -201,7 +201,7 @@ REGEXP defaults to \"[ \\t\\n\\r]+\"."
 
 REGEXP defaults to  \"[ \\t\\n\\r]+\"."
   :realname compat--internal-string-trim-right
-  :prefix t
+  :explicit t
   (let ((i (string-match-p
             (concat "\\(?:" (or regexp "[ \t\n\r]+") "\\)\\'")
             string)))
@@ -211,7 +211,7 @@ REGEXP defaults to  \"[ \\t\\n\\r]+\"."
   "Trim STRING of leading with and trailing matching TRIM-LEFT and TRIM-RIGHT.
 
 TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
-  :prefix t
+  :explicit t
   ;; `string-trim-left' and `string-trim-right' were moved from subr-x
   ;; to subr in Emacs 27, so to avoid loading subr-x we use the
   ;; compatibility function here:
@@ -448,7 +448,7 @@ The returned file name can be used directly as argument of
 (compat-defun file-name-quoted-p (name &optional top)
   "Whether NAME is quoted with prefix \"/:\".
 If NAME is a remote file name and TOP is nil, check the local part of NAME."
-  :prefix t
+  :explicit t
   :realname compat--file-name-quoted-p-with-top
   (let ((file-name-handler-alist (unless top file-name-handler-alist)))
     (string-prefix-p "/:" (file-local-name name))))
@@ -458,7 +458,7 @@ If NAME is a remote file name and TOP is nil, check the 
local part of NAME."
 If NAME is a remote file name and TOP is nil, the local part of
 NAME is quoted.  If NAME is already a quoted file name, NAME is
 returned unchanged."
-  :prefix t
+  :explicit t
   (let ((file-name-handler-alist (unless top file-name-handler-alist)))
     (if (compat--file-name-quoted-p-with-top name top)
         name
diff --git a/compat-27.el b/compat-27.el
index f38c65c5a5..35d83c44cd 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -108,7 +108,7 @@ Letter-case is significant, but text properties are 
ignored."
 
 (compat-defun recenter (&optional arg redisplay)
   "Handle optional argument REDISPLAY."
-  :prefix t
+  :explicit t
   (recenter arg)
   (when (and redisplay recenter-redisplay)
     (redisplay)))
@@ -117,7 +117,7 @@ Letter-case is significant, but text properties are 
ignored."
 
 (compat-defun lookup-key (keymap key &optional accept-default)
   "Allow for KEYMAP to be a list of keymaps."
-  :prefix t
+  :explicit t
   (cond
    ((keymapp keymap)
     (lookup-key keymap key accept-default))
@@ -377,7 +377,7 @@ where USER is a valid login name."
 
 (compat-defmacro setq-local (&rest pairs)
   "Handle multiple assignments."
-  :prefix t
+  :explicit t
   (unless (zerop (mod (length pairs) 2))
     (error "PAIRS must have an even number of variable/value members"))
   (let (body)
@@ -485,7 +485,7 @@ return nil."
 Compare keys with TEST.  Defaults to `equal'.
 Return the modified alist.
 Elements of ALIST that are not conses are ignored."
-  :prefix t
+  :explicit t
   (unless test (setq test #'equal))
   (while (and (consp (car alist))
               (funcall test (caar alist) key))
@@ -571,7 +571,7 @@ position.
 Optional fourth argument UNIT is the unit to use.  It defaults to \"B\"
 when FLAVOR is `iec' and the empty string otherwise.  We recommend \"B\"
 in all cases, since that is the standard symbol for byte."
-  :prefix t
+  :explicit t
   (let ((power (if (or (null flavor) (eq flavor 'iec))
                    1024.0
                  1000.0))
@@ -633,7 +633,7 @@ the value of the variable `exec-path'."
 Return nil if COMMAND is not found anywhere in `exec-path'.  If
 REMOTE is non-nil, search on the remote host indicated by
 `default-directory' instead."
-  :prefix t
+  :explicit t
   (if (and remote (file-remote-p default-directory))
       (let ((res (locate-file
                   command
@@ -666,7 +666,7 @@ Optional arg PARENTS, if non-nil then creates parent dirs 
as needed."
 
 (compat-defun regexp-opt (strings &optional paren)
   "Handle an empty list of strings."
-  :prefix t
+  :explicit t
   (if (null strings)
       (let ((re "\\`a\\`"))
         (cond ((null paren)
@@ -731,7 +731,7 @@ The return value is a string (or nil in case we can’t find 
it)."
     (&optional localp arg filter distinguish-one-marked error)
   "Return the marked files’ names as list of strings."
   :feature 'dired
-  :prefix t
+  :explicit t
   (let ((result (dired-get-marked-files localp arg filter 
distinguish-one-marked)))
     (if (and (null result) error)
         (user-error (if (stringp error) error "No files specified"))
diff --git a/compat-28.el b/compat-28.el
index 7a66d6c5d8..53d0a79e13 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -137,7 +137,7 @@ NOTE: For releases of Emacs before version 28, this 
function will do nothing."
 
 Handles file system errors by calling ‘display-warning’ and
 continuing as if the error did not occur."
-  :prefix t
+  :explicit t
   (condition-case error
       (unlock-buffer)
     (file-error
@@ -153,7 +153,7 @@ continuing as if the error did not occur."
 
 Optional arguments FROM and TO specify the substring of STRING to
 consider, and are interpreted as in `substring'."
-  :prefix t
+  :explicit t
   (let* ((len (length string))
          (from (or from 0))
          (to (or to len)))
@@ -169,7 +169,7 @@ consider, and are interpreted as in `substring'."
 
 If COUNT is non-nil and a natural number, the function will
  return COUNT number of file names (if so many are present)."
-  :prefix t
+  :explicit t
   (let ((files (directory-files directory full match nosort)))
     (when (natnump count)
       (setf (nthcdr count files) nil))
@@ -184,7 +184,7 @@ If COUNT is non-nil and a natural number, the function will
 
 (compat-defun json-serialize (object &rest args)
   "Handle top-level JSON values."
-  :prefix t
+  :explicit t
   :min-version "27"
   (if (or (listp object) (vectorp object))
       (apply #'json-serialize object args)
@@ -192,7 +192,7 @@ If COUNT is non-nil and a natural number, the function will
 
 (compat-defun json-insert (object &rest args)
   "Handle top-level JSON values."
-  :prefix t
+  :explicit t
   :min-version "27"
   (if (or (listp object) (vectorp object))
       (apply #'json-insert object args)
@@ -205,7 +205,7 @@ If COUNT is non-nil and a natural number, the function will
 
 (compat-defun json-parse-string (string &rest args)
   "Handle top-level JSON values."
-  :prefix t
+  :explicit t
   :min-version "27"
   (if (string-match-p "\\`[[:space:]]*[[{]" string)
       (apply #'json-parse-string string args)
@@ -216,7 +216,7 @@ If COUNT is non-nil and a natural number, the function will
 
 (compat-defun json-parse-buffer (&rest args)
   "Handle top-level JSON values."
-  :prefix t
+  :explicit t
   :min-version "27"
   (if (looking-at-p "[[:space:]]*[[{]")
       (apply #'json-parse-buffer args)
@@ -754,7 +754,7 @@ is included in the return value."
 
 If ALL-FRAMES is non-nil, count the windows in all frames instead
 just the selected frame."
-  :prefix t
+  :explicit t
   (if all-frames
       (let ((sum 0))
         (dolist (frame (frame-list))
diff --git a/compat-29.el b/compat-29.el
index 068904f96c..32278e6277 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -125,7 +125,7 @@ nil if PROP is not one of the properties on the list.  The 
comparison
 with PROP is done using PREDICATE, which defaults to `eq'.
 
 This function doesn't signal an error if PLIST is invalid."
-  :prefix t
+  :explicit t
   (if (or (null predicate) (eq predicate 'eq))
       (plist-get plist prop)
     (catch 'found
@@ -145,7 +145,7 @@ If PROP is already a property on the list, its value is set 
to VAL,
 otherwise the new PROP VAL pair is added.  The new plist is returned;
 use `(setq x (plist-put x prop val))' to be sure to use the new value.
 The PLIST is modified by side effects."
-  :prefix t
+  :explicit t
   (if (or (null predicate) (eq predicate 'eq))
       (plist-put plist prop val)
     (catch 'found
@@ -168,7 +168,7 @@ The comparison with PROP is done using PREDICATE, which 
defaults to
 Unlike `plist-get', this allows you to distinguish between a missing
 property and a property with the value nil.
 The value is actually the tail of PLIST whose car is PROP."
-  :prefix t
+  :explicit t
   (if (or (null predicate) (eq predicate 'eq))
       (plist-member plist prop)
     (catch 'found
@@ -220,7 +220,7 @@ If KEYMAP is a sparse keymap with a binding for KEY, the 
existing
 binding is altered.  If there is no binding for KEY, the new pair
 binding KEY to DEF is added at the front of KEYMAP."
   :realname compat--define-key-with-remove
-  :prefix t
+  :explicit t
   (if remove
       (let ((prev (lookup-key keymap key))
             (parent (memq 'key (cdr keymap)))
@@ -950,7 +950,7 @@ pairs.  Available keywords are:
 :name      If non-nil, this should be a string to use as the menu for
              the keymap in case you use it as a menu with `x-popup-menu'.
 
-:prefix    If non-nil, this should be a symbol to be used as a prefix
+:explicit    If non-nil, this should be a symbol to be used as a prefix
              command (see `define-prefix-command').  If this is the case,
              this symbol is returned instead of the map itself.
 
diff --git a/compat-macs.el b/compat-macs.el
index 0fe1b6be84..354e3abc74 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -71,7 +71,7 @@ ignored:
 - :realname :: Manual specification of a \"realname\" to use for
   the compatibility definition (symbol).
 
-- :prefix :: Add a `compat-' prefix to the name, and define the
+- :explicit :: Add a `compat-' prefix to the name, and define the
   compatibility code unconditionally.")
 
 (defun compat--generate-default (name def-fn install-fn check-fn attr)
@@ -92,7 +92,7 @@ DEF-FN, INSTALL-FN, CHECK-FN and ATTR."
                       (and max-version
                            (version< max-version emacs-version)))
                   nil)
-                 ((plist-get attr :prefix)
+                 ((plist-get attr :explicit)
                   '(progn))
                  ((and version (version<= version emacs-version) (not cond))
                   nil)
@@ -101,7 +101,7 @@ DEF-FN, INSTALL-FN, CHECK-FN and ATTR."
     (when (eq name realname)
       (error "%S: Name is equal to realname" name))
     (cond
-     ((and (plist-get attr :prefix)
+     ((and (plist-get attr :explicit)
            (let ((actual-name (intern (substring (symbol-name name)
                                                  (length "compat-")))))
              (when (and (version<= version emacs-version)
@@ -142,7 +142,7 @@ attributes (see `compat--generate-function')."
                (string= (plist-get rest :realname) (format "compat--%s" name)))
       (error "%s: :realname must not be the same as compat--<name>" name))
     ;; Check if we want an explicitly prefixed function
-    (when (plist-get rest :prefix)
+    (when (plist-get rest :explicit)
       (setq name (intern (format "compat-%s" name))))
     (funcall compat--generate-function
      name
@@ -152,7 +152,7 @@ attributes (see `compat--generate-function')."
              ((eq type 'function) 'defun)
              ((eq type 'macro) 'defmacro)
              ((error "Unknown type")))
-           ,(if (plist-get rest :prefix)
+           ,(if (plist-get rest :explicit)
                 (intern (format "compat--explicit-%s" oldname))
               realname)
            ,arglist
@@ -177,8 +177,7 @@ If this is not documented on yourself system, you can check 
\
                 (fill-region (point-min) (point-max)))
               (buffer-string))
            ,@body)
-          ,@(and (plist-get rest :prefix)
-                 (message "COMPAT realname=%S name=%S oldname=%S" realname 
name oldname)
+          ,@(and (plist-get rest :explicit)
                  (if (string= realname name)
                      `((defalias ',name ',(intern (format 
"compat--explicit-%s" oldname)))
                        (make-obsolete
@@ -189,7 +188,7 @@ If this is not documented on yourself system, you can check 
\
      (lambda (realname _version)
        ;; Functions and macros are installed by aliasing the name of the
        ;; compatible function to the name of the compatibility function.
-       (if (and (plist-get rest :prefix) (string= realname oldname))
+       (if (and (plist-get rest :explicit) (string= realname oldname))
            `(progn
               (defalias ',name ',realname)
               (make-obsolete
@@ -243,8 +242,8 @@ local with a value of `permanent' or just buffer local with 
any
 non-nil value."
   (declare (debug (name form stringp [&rest keywordp sexp]))
            (doc-string 3) (indent 2))
-  (when (or (plist-get attr :prefix) (plist-get attr :realname))
-    (error ":prefix cannot be specified for compatibility variables"))
+  (when (or (plist-get attr :explicit) (plist-get attr :realname))
+    (error ":explicit cannot be specified for compatibility variables"))
   (funcall compat--generate-function
            name
            (lambda (realname version)
diff --git a/compat-tests.el b/compat-tests.el
index a3b1834293..23c01c1d25 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -59,7 +59,7 @@ DEF-FN, INSTALL-FN, CHECK-FN and ATTR."
                       (and max-version
                            (version< max-version emacs-version)))
                   nil)
-                 ((plist-get attr :prefix)
+                 ((plist-get attr :explicit)
                   '(progn))
                  ((and version (version<= version emacs-version) (not cond))
                   nil)



reply via email to

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