branch: externals/compat commit 8ebc304b3f90d4e3b888651be5b8f39d76725d61 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Remove deprecated prefixed compatibility functions These functions are only used by exactly two packages: Consult 0.30 (released) and Magit 3.4.0 (unreleased development version). Both packages have been updated to use compat-call. --- NEWS.org | 2 ++ compat-macs.el | 17 ++++------------- compat-tests.el | 13 ------------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/NEWS.org b/NEWS.org index 73a333cc6b..b7cc305bf0 100644 --- a/NEWS.org +++ b/NEWS.org @@ -2,6 +2,8 @@ * Development of "Compat" Version 29.1.1.0 +- Remove deprecated, prefixed compatibility functions. + * Release of "Compat" Version 29.1.0.1 - Add multiple new tests for existing APIs. diff --git a/compat-macs.el b/compat-macs.el index 8172ec995e..f62659e082 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -176,27 +176,18 @@ If this is not documented on yourself system, you can check \ (buffer-string)) ,@body) ,@(and (plist-get rest :explicit) - (if (string= realname name) - `((defalias ',name ',(intern (format "compat--%s" oldname))) - (make-obsolete - ',name - "Use `compat-call' or `compat-function' instead" - "29.1.0.0")) - `((defalias ',realname #',(intern (format "compat--%s" oldname)))))))) + (not (string= realname name)) + `((defalias ',realname #',(intern (format "compat--%s" oldname))))))) (lambda (realname) `(progn ;; Functions and macros are installed by aliasing the name of the ;; compatible function to the name of the compatibility function. - (defalias ',name #',realname) ,@(when (and (plist-get rest :realname) (not (string= (plist-get rest :realname) name)) (not (string= (plist-get rest :realname) realname))) `((defalias ',(plist-get rest :realname) #',realname))) - ,@(when (and (plist-get rest :explicit) (string= realname oldname)) - `((make-obsolete - ',name - "Use `compat-call' or `compat-function' instead" - "29.1.0.0"))))) + ,@(unless (and (plist-get rest :explicit) (string= realname oldname)) + `((defalias ',name #',realname))))) (lambda () `(not (fboundp ',name))) rest))) diff --git a/compat-tests.el b/compat-tests.el index f7e4f00160..66505e9124 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1017,7 +1017,6 @@ (should-equal 1 (string-distance "a" "あ"))) (ert-deftest string-width () - (should-equal 0 (compat-string-width "")) ;; Obsolete (should-equal 0 (compat-call string-width "")) (should-equal 3 (compat-call string-width "abc")) ;; no argument (should-equal 5 (compat-call string-width "abcあ")) @@ -1033,7 +1032,6 @@ (should-equal 0 (compat-call string-width "a " 1 1))) (ert-deftest string-trim-left () - (should-equal "a" (compat-string-trim-left " a")) ;; Obsolete (should-equal "a" (compat-call string-trim-left "---a" "-+")) ;; Additional regexp (should-equal "" (compat-call string-trim-left "")) ;empty string (should-equal "a" (compat-call string-trim-left "a")) ;"full" string @@ -1056,7 +1054,6 @@ (should-equal "a \n" (compat-call string-trim-left "\n \ta \n"))) (ert-deftest string-trim-right () - (should-equal "a" (compat-string-trim-right "a ")) ;; Obsolete (should-equal "a" (compat-call string-trim-right "a---" "-+")) ;; Additional regexp (should-equal "" (compat-call string-trim-right "")) ;empty string (should-equal "a" (compat-call string-trim-right "a")) ;"full" string @@ -1079,7 +1076,6 @@ (should-equal "\n \ta" (compat-call string-trim-right "\n \ta \n"))) (ert-deftest string-trim () - (should-equal "aaa" (compat-string-trim " aaa ")) ;; Obsolete (should-equal "aaa" (compat-call string-trim "--aaa__" "-+" "_+")) ;; Additional regexp (should-equal "" (compat-call string-trim "")) ;empty string (should-equal "a" (compat-call string-trim "a")) ;"full" string @@ -1416,15 +1412,6 @@ (should-equal alist-1 '((1 . "eins") (3 . "three"))) (setf (compat-call alist-get "one" alist-2 nil nil #'string=) "eins") (should-equal (compat-call alist-get "one" alist-2 nil nil #'string=) - "eins") - - ;; Obsolete compat-alist-get - (setf (compat-alist-get 1 alist-1) "eins") - (should-equal (compat-alist-get 1 alist-1) "eins") - (setf (compat-alist-get 2 alist-1 nil 'remove) nil) - (should-equal alist-1 '((1 . "eins") (3 . "three"))) - (setf (compat-alist-get "one" alist-2 nil nil #'string=) "eins") - (should-equal (compat-alist-get "one" alist-2 nil nil #'string=) "eins"))) (ert-deftest json-serialize ()