summaryrefslogtreecommitdiff
path: root/lisp/use-package
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-11-13 23:20:40 +0100
committerStefan Kangas <stefankangas@gmail.com>2022-11-13 23:26:44 +0100
commit43254ae62f1a775edab9a3c74d0411ba0577de0e (patch)
tree20a7d6a1fccc8643ad62a4062771f4759434fc1d /lisp/use-package
parent45e6ee1371bdfec607aaf0b5be2b340460f704db (diff)
downloademacs-43254ae62f1a775edab9a3c74d0411ba0577de0e.tar.gz
emacs-43254ae62f1a775edab9a3c74d0411ba0577de0e.tar.bz2
emacs-43254ae62f1a775edab9a3c74d0411ba0577de0e.zip
Fix building on Emacs 24.3
This fixes the following error: use-package-core.el:60:32:Error: Cannot open load file: subr-x
Diffstat (limited to 'lisp/use-package')
-rw-r--r--lisp/use-package/use-package-core.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index 53bc3ed2a42..9e7b3b56e12 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -53,11 +53,18 @@
;; 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))