forked from magnars/expand-region.el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enh-ruby-mode-expansions.el
42 lines (30 loc) · 1.57 KB
/
enh-ruby-mode-expansions.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;;; enh-ruby-mode-expansions.el --- Expansions for enh-ruby-mode
;; Copyright (C) 2011 Magnar Sveen
;; Author: Magnar Sveen <[email protected]>
;; Keywords: marking region
;; 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/>.
;;; Commentary:
;; enh-ruby-mode doesn't use ruby-mode's mark-defun - it has its own.
;;
;; Feel free to contribute any other expansions for enh-ruby-mode at
;;
;; https://github.com/magnars/expand-region.el
;;; Code:
(defun er/add-enh-ruby-mode-expansions ()
"Adds Ruby-specific expansions for buffers in enh-ruby-mode"
(require 'ruby-mode-expansions)
(set (make-local-variable 'er/try-expand-list) (append
(remove 'er/mark-defun er/try-expand-list)
'(er/mark-ruby-instance-variable
er/mark-ruby-block-up))))
(er/enable-mode-expansions 'enh-ruby-mode 'er/add-enh-ruby-mode-expansions)
(provide 'enh-ruby-mode-expansions)