diff --git a/expand-region-core.el b/expand-region-core.el index ac62193..283267f 100644 --- a/expand-region-core.el +++ b/expand-region-core.el @@ -188,7 +188,7 @@ before calling `er/expand-region' for the first time." (msg (car msg-and-bindings)) (bindings (cdr msg-and-bindings))) (when repeat-key - (set-temporary-overlay-map + (er/set-temporary-overlay-map (let ((map (make-sparse-keymap))) (dolist (binding bindings map) (define-key map (read-kbd-macro (car binding)) @@ -200,9 +200,10 @@ before calling `er/expand-region' for the first time." t) (or (minibufferp) (message "%s" msg))))) -(when (not (fboundp 'set-temporary-overlay-map)) +(if (fboundp 'set-temporary-overlay-map) + (fset 'er/set-temporary-overlay-map 'set-temporary-overlay-map) ;; Backport this function from newer emacs versions - (defun set-temporary-overlay-map (map &optional keep-pred) + (defun er/set-temporary-overlay-map (map &optional keep-pred) "Set a new keymap that will only exist for a short period of time. The new keymap to use must be given in the MAP variable. When to remove the keymap depends on user input and KEEP-PRED: diff --git a/nxml-mode-expansions.el b/nxml-mode-expansions.el index b997cc0..c81b590 100644 --- a/nxml-mode-expansions.el +++ b/nxml-mode-expansions.el @@ -27,6 +27,7 @@ ;;; Code: +(require 'cl-lib) (require 'expand-region-core) (require 'html-mode-expansions) (require 'nxml-mode) @@ -74,11 +75,10 @@ point is in, or otherwise nil" (save-excursion (forward-char 1) (nxml-token-before)) - (let ((attr (find-if (lambda (att) - (and (<= (xmltok-attribute-value-start att) (point)) - (>= (xmltok-attribute-value-end att) (point)))) - xmltok-attributes))) - attr)) + (cl-find-if (lambda (att) + (and (<= (xmltok-attribute-value-start att) (point)) + (>= (xmltok-attribute-value-end att) (point)))) + xmltok-attributes)) (defun er/mark-nxml-attribute-inner-string () "Marks an attribute string" diff --git a/subword-mode-expansions.el b/subword-mode-expansions.el index ab131fb..8416021 100644 --- a/subword-mode-expansions.el +++ b/subword-mode-expansions.el @@ -29,6 +29,7 @@ ;;; Code: (require 'expand-region-core) +(require 'subword) (defun er/mark-subword () "Mark a subword, a part of a CamelCase identifier."