[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 4364563 43/99: Use unprefixed symbols where poss
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 4364563 43/99: Use unprefixed symbols where possible |
Date: |
Sun, 17 Oct 2021 05:57:54 -0400 (EDT) |
branch: externals/compat
commit 4364563f768198ba15317985205cd217841f3671
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Use unprefixed symbols where possible
Using the explicit compatibility function or variable requires all
compatibility definitions to be loaded, while compat.el loads these
conditionally. Therefore, void functions and variable errors can be
raised, that avoided by using the unprefixed symbol.
---
compat-25.1.el | 14 +++++++-------
compat-26.1.el | 13 +++++++------
compat-28.1.el | 2 +-
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/compat-25.1.el b/compat-25.1.el
index 4ccc02c..43141ee 100644
--- a/compat-25.1.el
+++ b/compat-25.1.el
@@ -127,15 +127,15 @@ This is like `if-let' but doesn't handle a VARLIST of the
form
This is like `when-let' but doesn't handle a VARLIST of the form
\(SYMBOL SOMETHING) specially."
:feature subr-x
- (declare (indent 1) (debug compat--if-let*))
- `(compat--if-let* ,varlist ,(macroexp-progn body)))
+ (declare (indent 1) (debug if-let*))
+ `(if-let* ,varlist ,(macroexp-progn body)))
(compat-defmacro and-let* (varlist &rest body)
"Bind variables according to VARLIST and conditionally evaluate BODY.
Like `when-let*', except if BODY is empty and all the bindings
are non-nil, then the result is non-nil."
:feature subr-x
- (declare (indent 1) (debug compat--if-let*))
+ (declare (indent 1) (debug if-let*))
(let ((empty (make-symbol "s"))
(last t) list)
(dolist (var varlist)
@@ -173,7 +173,7 @@ with an old syntax that accepted only one binding."
(not (listp (car spec))))
;; Adjust the single binding case
(setq spec (list spec)))
- `(compat--if-let* ,spec ,then ,@(macroexp-unprogn else)))
+ `(if-let* ,spec ,then ,@(macroexp-unprogn else)))
(compat-defmacro when-let (spec &rest body)
"Bind variables according to SPEC and conditionally evaluate BODY.
@@ -182,8 +182,8 @@ If all are non-nil, return the value of the last form in
BODY.
The variable list SPEC is the same as in `if-let'."
:feature subr-x
- (declare (indent 1) (debug compat--if-let))
- (list 'compat--if-let spec (macroexp-progn body)))
+ (declare (indent 1) (debug if-let))
+ (list 'if-let spec (macroexp-progn body)))
(compat-defmacro thread-first (&rest forms)
"Thread FORMS elements as the first argument of their successor.
@@ -234,7 +234,7 @@ threading."
;;;; Defined in macroexp.el
-(declare macrop nil (object))
+(declare-function macrop nil (object))
(compat-defun macroexpand-1 (form &optional environment)
"Perform (at most) one step of macro expansion."
:feature macroexp
diff --git a/compat-26.1.el b/compat-26.1.el
index 465e136..b38b940 100644
--- a/compat-26.1.el
+++ b/compat-26.1.el
@@ -120,12 +120,14 @@ REGEXP defaults to \"[ \\t\\n\\r]+\"."
string)))
(if i (substring string 0 i) string)))
+(declare-function string-trim-left nil (string &optional regexp))
+(declare-function string-trim-right nil (string &optional regexp))
(compat-defun string-trim (string &optional trim-left trim-right)
"Trim STRING of leading with and trailing matching TRIM-LEFT and TRIM-RIGHT.
TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
- (compat--string-trim-left
- (compat--string-trim-right
+ (string-trim-left
+ (string-trim-right
string
trim-right)
trim-left))
@@ -256,9 +258,8 @@ TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
"Return a new uninterned symbol.
The name is made by appending `gensym-counter' to PREFIX.
PREFIX is a string, and defaults to \"g\"."
- (let ((num (prog1 compat--gensym-counter
- (setq compat--gensym-counter
- (1+ compat--gensym-counter)))))
+ (let ((num (prog1 gensym-counter
+ (setq gensym-counter (1+ gensym-counter)))))
(make-symbol (format "%s%d" (or prefix "g") num))))
;;;; Defined in files.el
@@ -300,7 +301,7 @@ the variable `temporary-file-directory' is returned."
default-directory 'temporary-file-directory)))
(if handler
(funcall handler 'temporary-file-directory)
- (if (string-match compat--mounted-file-systems default-directory)
+ (if (string-match mounted-file-systems default-directory)
default-directory
temporary-file-directory))))
diff --git a/compat-28.1.el b/compat-28.1.el
index 37f1904..489188e 100644
--- a/compat-28.1.el
+++ b/compat-28.1.el
@@ -219,7 +219,7 @@ Also see `local-variable-p'."
(void-variable nil (throw 'fail nil)))
t))
-(declare gensym nil (&optional prefix))
+(declare-function gensym nil (&optional prefix))
(compat-defmacro with-existing-directory (&rest body)
"Execute BODY with `default-directory' bound to an existing directory.
If `default-directory' is already an existing directory, it's not changed."
- [elpa] externals/compat eb0c027 26/99: Advise indirect-function to not raise void-function, (continued)
- [elpa] externals/compat eb0c027 26/99: Advise indirect-function to not raise void-function, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 797930f 34/99: Declare temporary-file-directory for make-nearby-temp-file, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 26acf1f 48/99: Use compatibility macros in ...-let definitions, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 8f64282 49/99: Use compatibility functions in string-trim definition, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e6b5f08 53/99: Load all compatibility code unconditionally, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 021ffd1 59/99: Handle legacy bytecode argument lists, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 956db9b 60/99: Improve handling of conditional compatibility definitions, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 9be46b0 16/99: Add check for Emacs 28 to compat-tests.el, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 10ef8f4 36/99: Declare string-trim-left and directory-name-p, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 9df8e0c 38/99: Add GitHub action file for CI, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 4364563 43/99: Use unprefixed symbols where possible,
ELPA Syncer <=
- [elpa] externals/compat 658db90 47/99: Simplify and-let* implementation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat ad92d70 61/99: Add decoded-time-* functions from 27.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 476aa10 62/99: Add json-* functions from 27.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a0ea4ae 65/99: Call alist-get-full-elisp from alist-get-handle-testfn, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 4513631 70/99: Fix compat-func-arity advice handling, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 09bf8d8 75/99: Declare nadvice functions for compat-func-arity, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 80ab781 77/99: Use advice.el for advising functions previously to Emacs 24.4, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 20afc89 78/99: Add :cond checks to json-* functions in compat-27.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 72c0781 81/99: Mention Chris Wellons' article on lambdas and byte compilation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat ee068f0 82/99: Revert back to manual advising, ELPA Syncer, 2021/10/17