Skip to content

Commit

Permalink
Add adapter for web-mode.el expansions
Browse files Browse the repository at this point in the history
  • Loading branch information
vmalloc committed Nov 23, 2012
1 parent 8d5b372 commit 7139bb4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions expand-region.el
Expand Up @@ -164,6 +164,7 @@ before calling `er/expand-region' for the first time."
(eval-after-load "sgml-mode" '(require 'html-mode-expansions)) ;; html-mode is defined in sgml-mode.el
(eval-after-load "rhtml-mode" '(require 'html-mode-expansions))
(eval-after-load "nxhtml-mode" '(require 'html-mode-expansions))
(eval-after-load "web-mode" '(require 'web-mode-expansions))
(eval-after-load "js" '(require 'js-mode-expansions))
(eval-after-load "js2-mode" '(require 'js-mode-expansions))
(eval-after-load "js2-mode" '(require 'js2-mode-expansions))
Expand Down
33 changes: 33 additions & 0 deletions web-mode-expansions.el
@@ -0,0 +1,33 @@
;;; web-mode-expansions.el --- Thin layer for adapting fxbois's web-mode-mark-and-expand function
;;; to expand-region

;; Copyright (C) 2012 Rotem Yaari

;; Authors: Rotem Yaari
;; Based on, and makes use of web-mode.el by fxbois

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Code:


(defun er/add-web-mode-expansions ()
(make-variable-buffer-local 'er/try-expand-list)
(setq er/try-expand-list (append
er/try-expand-list
'(web-mode-mark-and-expand))))

(add-hook 'web-mode-hook 'er/add-web-mode-expansions)

(provide 'web-mode-expansions)

0 comments on commit 7139bb4

Please sign in to comment.