emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115435: * lisp/progmodes/ruby-mode.el (ruby-accurat


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r115435: * lisp/progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
Date: Mon, 09 Dec 2013 03:27:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115435
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16078
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Mon 2013-12-09 05:27:21 +0200
message:
  * 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'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-09 02:38:42 +0000
+++ b/lisp/ChangeLog    2013-12-09 03:27:21 +0000
@@ -1,3 +1,9 @@
+2013-12-09  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
+       `ruby-use-smie' is t, use `smie-forward-sexp' instead of
+       `ruby-parse-partial' (Bug#16078).
+
 2013-12-09  Leo Liu  <address@hidden>
 
        * subr.el (read-passwd): Disable show-paren-mode.  (Bug#16091)

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2013-12-06 14:24:10 +0000
+++ b/lisp/progmodes/ruby-mode.el       2013-12-09 03:27:21 +0000
@@ -614,11 +614,16 @@
   (nreverse (ruby-imenu-create-index-in-block nil (point-min) nil)))
 
 (defun ruby-accurate-end-of-block (&optional end)
-  "TODO: document."
+  "Jump to the end of the current block or END, whichever is closer."
   (let (state
         (end (or end (point-max))))
-    (while (and (setq state (apply 'ruby-parse-partial end state))
-                (>= (nth 2 state) 0) (< (point) end)))))
+    (if ruby-use-smie
+        (save-restriction
+          (back-to-indentation)
+          (narrow-to-region (point) end)
+          (smie-forward-sexp))
+      (while (and (setq state (apply 'ruby-parse-partial end state))
+                    (>= (nth 2 state) 0) (< (point) end))))))
 
 (defun ruby-mode-variables ()
   "Set up initial buffer-local variables for Ruby mode."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]