all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15914: 24.3; ruby-toggle-block fails when the block holds a string interpolation
@ 2013-11-17 19:32 Adam Sokolnicki
  2013-11-17 21:39 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Sokolnicki @ 2013-11-17 19:32 UTC (permalink / raw)
  To: 15914

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

Way to reproduce it:

M-x find-file tmp.rb RET
M-x ruby-mode RET
foo do\n  "#{bar}"\nend
M-x ruby-toggle-block RET

I've attached a diff that should fix it.

In GNU Emacs 24.3.1 (x86_64-apple-darwin12.5.0, NS apple-appkit-1187.39)
 of 2013-11-07 on Adam-Sokolnickis-MacBook-Pro.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--prefix=/usr/local/Cellar/emacs/24.3' '--without-dbus'
 '--enable-locallisppath=/usr/local/share/emacs/site-lisp'
 '--infodir=/usr/local/Cellar/emacs/24.3/share/info/emacs'
 '--without-gnutls' '--with-ns' '--disable-ns-self-contained' 'CC=cc''

[-- Attachment #2: ruby-toggle-block.diff --]
[-- Type: application/octet-stream, Size: 600 bytes --]

--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1590,8 +1590,9 @@ If the result is do-end block, it will always be multiline."
   (let ((start (point)) beg end)
     (end-of-line)
     (unless
-        (if (and (re-search-backward "\\({\\)\\|\\_<do\\(\\s \\|$\\||\\)")
+        (if (and (re-search-backward "\\(?:[^#]\\)\\({\\)\\|\\(\\_<do\\_>\\)")
                  (progn
+		   (goto-char (or (match-beginning 1) (match-beginning 2)))
                    (setq beg (point))
                    (save-match-data (ruby-forward-sexp))
                    (setq end (point))
-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#15914: 24.3; ruby-toggle-block fails when the block holds a string interpolation
  2013-11-17 19:32 bug#15914: 24.3; ruby-toggle-block fails when the block holds a string interpolation Adam Sokolnicki
@ 2013-11-17 21:39 ` Dmitry Gutov
  2013-11-18  0:17   ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2013-11-17 21:39 UTC (permalink / raw)
  To: Adam Sokolnicki; +Cc: 15914

Version: 24.4

Adam Sokolnicki <adam.sokolnicki@gmail.com> writes:
> I've attached a diff that should fix it.

Applied, thanks!





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#15914: 24.3; ruby-toggle-block fails when the block holds a string interpolation
  2013-11-17 21:39 ` Dmitry Gutov
@ 2013-11-18  0:17   ` Dmitry Gutov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Gutov @ 2013-11-18  0:17 UTC (permalink / raw)
  To: Adam Sokolnicki; +Cc: 15914-done

Sorry, forgot to close it.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-18  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-17 19:32 bug#15914: 24.3; ruby-toggle-block fails when the block holds a string interpolation Adam Sokolnicki
2013-11-17 21:39 ` Dmitry Gutov
2013-11-18  0:17   ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.