* misc/ruby-electric.el (ruby-electric-matching-char): Make

electric quotes work again at the end of buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2013-05-18 17:38:02 +00:00
Родитель 54fef60273
Коммит 30034b5536
2 изменённых файлов: 19 добавлений и 1 удалений

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

@ -1,3 +1,8 @@
Sun May 19 02:27:21 2013 Akinori MUSHA <knu@iDaemons.org>
* misc/ruby-electric.el (ruby-electric-matching-char): Make
electric quotes work again at the end of buffer.
Sun May 19 01:39:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (setjmp-type): check if setjmpex() is really available.

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

@ -248,6 +248,17 @@ strings. Note that you must have Font Lock enabled."
(insert "{}")
(backward-char 1))))))
(defmacro ruby-electric-avoid-eob(&rest body)
`(if (eobp)
(save-excursion
(insert "\n")
(backward-char)
,@body
(prog1
(ruby-electric-string-at-point-p)
(delete-char 1)))
,@body))
(defun ruby-electric-matching-char(arg)
(interactive "P")
(ruby-electric-insert
@ -257,7 +268,9 @@ strings. Note that you must have Font Lock enabled."
(cond
((char-equal closing last-command-event)
(if (and (not (ruby-electric-string-at-point-p))
(progn (redisplay) (ruby-electric-string-at-point-p)))
(ruby-electric-avoid-eob
(redisplay)
(ruby-electric-string-at-point-p)))
(save-excursion (insert closing))
(and (eq last-command 'ruby-electric-matching-char)
(char-equal (following-char) closing) ;; repeated ' or "