Skip to content

Commit

Permalink
Merge pull request magnars#173 from tarsius/master
Browse files Browse the repository at this point in the history
require subword, use cl-lib, silence byte-compiler
  • Loading branch information
magnars committed Aug 5, 2015
2 parents 5c2ad46 + 0f295ba commit 62f3c6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions expand-region-core.el
Expand Up @@ -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))
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions nxml-mode-expansions.el
Expand Up @@ -27,6 +27,7 @@

;;; Code:

(require 'cl-lib)
(require 'expand-region-core)
(require 'html-mode-expansions)
(require 'nxml-mode)
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions subword-mode-expansions.el
Expand Up @@ -29,6 +29,7 @@
;;; Code:

(require 'expand-region-core)
(require 'subword)

(defun er/mark-subword ()
"Mark a subword, a part of a CamelCase identifier."
Expand Down

0 comments on commit 62f3c6d

Please sign in to comment.