aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2013-12-09 05:27:21 +0200
committerDmitry Gutov2013-12-09 05:27:21 +0200
commitff8c9764201440d24f928d864235d66263b6ed2f (patch)
tree5b5ec9238f792bb2e4a1f54dead73ee8c7e0ee54
parentd64643b40f1837c27cc1b44b9155ab20a1d9d016 (diff)
downloademacs-ff8c9764201440d24f928d864235d66263b6ed2f.tar.gz
emacs-ff8c9764201440d24f928d864235d66263b6ed2f.zip
* lisp/progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
`ruby-use-smie' is t, use `smie-forward-sexp' instead of `ruby-parse-partial'. Fixes: debbugs:16078
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/ruby-mode.el11
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d09e3a4174d..2e36fdbe4cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-12-09 Dmitry Gutov <dgutov@yandex.ru>
2
3 * progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
4 `ruby-use-smie' is t, use `smie-forward-sexp' instead of
5 `ruby-parse-partial' (Bug#16078).
6
12013-12-09 Leo Liu <sdl.web@gmail.com> 72013-12-09 Leo Liu <sdl.web@gmail.com>
2 8
3 * subr.el (read-passwd): Disable show-paren-mode. (Bug#16091) 9 * subr.el (read-passwd): Disable show-paren-mode. (Bug#16091)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 3d30cb015d6..0f5a2a5b2a0 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -614,11 +614,16 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
614 (nreverse (ruby-imenu-create-index-in-block nil (point-min) nil))) 614 (nreverse (ruby-imenu-create-index-in-block nil (point-min) nil)))
615 615
616(defun ruby-accurate-end-of-block (&optional end) 616(defun ruby-accurate-end-of-block (&optional end)
617 "TODO: document." 617 "Jump to the end of the current block or END, whichever is closer."
618 (let (state 618 (let (state
619 (end (or end (point-max)))) 619 (end (or end (point-max))))
620 (while (and (setq state (apply 'ruby-parse-partial end state)) 620 (if ruby-use-smie
621 (>= (nth 2 state) 0) (< (point) end))))) 621 (save-restriction
622 (back-to-indentation)
623 (narrow-to-region (point) end)
624 (smie-forward-sexp))
625 (while (and (setq state (apply 'ruby-parse-partial end state))
626 (>= (nth 2 state) 0) (< (point) end))))))
622 627
623(defun ruby-mode-variables () 628(defun ruby-mode-variables ()
624 "Set up initial buffer-local variables for Ruby mode." 629 "Set up initial buffer-local variables for Ruby mode."