aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorSriram Thaiyar2016-06-22 09:21:26 -0700
committerDmitry Gutov2016-06-27 07:31:39 +0300
commit7f02dedfcae6ba0e3a646c1367c908af9b3dbe1d (patch)
tree1d2880f718e78d7170655a9eae65bdff08eea36c /lisp/progmodes/ruby-mode.el
parentdd98ee8992c3246861e44447ffcd02886a52878e (diff)
downloademacs-7f02dedfcae6ba0e3a646c1367c908af9b3dbe1d.tar.gz
emacs-7f02dedfcae6ba0e3a646c1367c908af9b3dbe1d.zip
Fix quote escaping in ruby-toggle-string-quotes
* lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): Change logic to quote based on the current quote of the string. * test/lisp/progmodes/ruby-mode-tests.el (ruby-toggle-string-quotes-quotes-correctly): Add test. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index d75edbc84ef..aa7c08c542f 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1799,7 +1799,7 @@ If the result is do-end block, it will always be multiline."
1799 (content 1799 (content
1800 (buffer-substring-no-properties (1+ min) (1- max)))) 1800 (buffer-substring-no-properties (1+ min) (1- max))))
1801 (setq content 1801 (setq content
1802 (if (equal string-quote "\"") 1802 (if (equal string-quote "'")
1803 (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) 1803 (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content))
1804 (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) 1804 (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content))))
1805 (let ((orig-point (point))) 1805 (let ((orig-point (point)))