From 432af3c05d27ae8221b11a90e54941809083f40c Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 31 Jul 2015 17:25:28 +0200 Subject: [PATCH 1/3] Require library subword for subword-left and subword-right --- subword-mode-expansions.el | 1 + 1 file changed, 1 insertion(+) 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." From d93e6acd199207566b86abfdb351a526ca983575 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 31 Jul 2015 17:27:15 +0200 Subject: [PATCH 2/3] Use cl-find-if, require cl-lib Use `cl-find-if' instead of `find-if` (from the obsolete `cl' library). Require `cl-lib' which defines `cl-find-if'. Previously neither `cl' nor `cl-lib' was required. --- nxml-mode-expansions.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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" From 0f295ba8e11c94330d163deaed75fdbd3d662351 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 31 Jul 2015 17:28:58 +0200 Subject: [PATCH 3/3] Silence byte-compiler Define `er/set-temporary-overlay-map' instead of the obsolete `set-temporary-overlay-map'. It would be better to use `set-transient-map', at least for Emacs v25.1. --- expand-region-core.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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: