Permalink
Browse files

Add adapter for web-mode.el expansions

  • Loading branch information...
1 parent 8d5b372 commit 7139bb4d7c31bcc7a4a43fa63f193d339d5aa314 @vmalloc vmalloc committed Nov 23, 2012
Showing with 34 additions and 0 deletions.
  1. +1 −0 expand-region.el
  2. +33 −0 web-mode-expansions.el
View
@@ -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))
View
@@ -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.