]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix building on Emacs 24.3
authorStefan Kangas <stefankangas@gmail.com>
Sun, 13 Nov 2022 22:20:40 +0000 (23:20 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Sun, 13 Nov 2022 22:26:44 +0000 (23:26 +0100)
This fixes the following error:
use-package-core.el:60:32:Error: Cannot open load file: subr-x

lisp/use-package/use-package-core.el

index 53bc3ed2a42af30b98a3fa0c6e95273dabcb1dd7..9e7b3b56e12ab5286a0db408358872ad2e2301bb 100644 (file)
 ;; iterating over them to "disable all themes" won't disable it.
 (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))
 
-(if (and (eq emacs-major-version 24) (eq emacs-minor-version 3))
-    (defsubst hash-table-keys (hash-table)
-      "Return a list of keys in HASH-TABLE."
-      (cl-loop for k being the hash-keys of hash-table collect k))
-  (eval-when-compile (require 'subr-x)))
+(eval-when-compile
+  (if (and (eq emacs-major-version 24) (eq emacs-minor-version 3))
+      (progn
+        (defsubst hash-table-keys (hash-table)
+          "Return a list of keys in HASH-TABLE."
+          (cl-loop for k being the hash-keys of hash-table collect k))
+        (defsubst string-suffix-p (suffix string  &optional ignore-case)
+          (let ((start-pos (- (length string) (length suffix))))
+            (and (>= start-pos 0)
+                 (eq t (compare-strings suffix nil nil
+                                        string start-pos nil ignore-case))))))
+    (require 'subr-x)))
 
 (eval-when-compile
   (require 'regexp-opt))