diff options
Diffstat (limited to 'lisp/use-package')
-rw-r--r-- | lisp/use-package/bind-key.el | 12 | ||||
-rw-r--r-- | lisp/use-package/use-package-core.el | 17 |
2 files changed, 18 insertions, 11 deletions
diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index 1a84d6a9066..f0b9cdb588d 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el @@ -223,11 +223,11 @@ See `bind-key' for more details." In contrast to `define-key', this function removes the binding from the keymap." (define-key keymap key nil) ;; Split M-key in ESC key - (setq key (mapcan (lambda (k) - (if (and (integerp k) (/= (logand k ?\M-\0) 0)) - (list ?\e (logxor k ?\M-\0)) - (list k))) - key)) + (setq key (cl-mapcan (lambda (k) + (if (and (integerp k) (/= (logand k ?\M-\0) 0)) + (list ?\e (logxor k ?\M-\0)) + (list k))) + key)) ;; Delete single keys directly (if (= (length key) 1) (delete key keymap) @@ -241,7 +241,7 @@ In contrast to `define-key', this function removes the binding from the keymap." (delete (last key) submap) ;; Delete submap if it is empty (when (= 1 (length submap)) - (bind-key--remove prefix keymap))))) + (bind-key--remove prefix keymap))))) ;;;###autoload (defmacro bind-key* (key-name command &optional predicate) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 5b001e496dd..429b108ac71 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)) |