ruby-insert-heredoc-code-block

* misc/ruby-additional.el (ruby-insert-heredoc-code-block): insert
  here document code block for assert_separately mainly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-28 11:40:58 +00:00
Родитель 3883bb6bae
Коммит a552fa2d66
2 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat May 28 20:40:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-additional.el (ruby-insert-heredoc-code-block): insert
here document code block for assert_separately mainly.
Sat May 28 20:34:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* test/test_unicode_normalize.rb: Add test to check for availability of

Просмотреть файл

@ -157,6 +157,18 @@ Emacs to Ruby."
"Convert Unicode <-> \\u{} in the given region."
(interactive "P\nr")
(if dec (ruby-decode-unicode beg end) (ruby-encode-unicode beg end)))
(defun ruby-insert-heredoc-code-block (arg)
"Insert indented here document code block"
(interactive "P")
(let ((c (if arg "~" "-")))
(insert "\"#{<<" c "begin}#{<<" c "\"end;\"}\""))
(end-of-line)
(if (eobp) (insert "\n") (forward-char))
(indent-region (point)
(progn (insert "begin\n" "end;\n") (point)))
(beginning-of-line 0))
(define-key ruby-mode-map "\C-cH" 'ruby-insert-heredoc-code-block)
))
;; monkey-patching ruby-mode.el in Emacs 24, as r49872.