aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorDmitry Gutov2013-10-26 05:16:37 +0400
committerDmitry Gutov2013-10-26 05:16:37 +0400
commitbae91342a41c1aef864c64c2354dfbfc58335bfa (patch)
treecbbd3638d05ffca818ac046281802ce8ae97b61e /lisp/progmodes/ruby-mode.el
parenteb89dc14d9367b3f2dbb265dedf2e781a4105b03 (diff)
downloademacs-bae91342a41c1aef864c64c2354dfbfc58335bfa.tar.gz
emacs-bae91342a41c1aef864c64c2354dfbfc58335bfa.zip
* lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be more
specific in what the first arg can be: a non-keyword word, string/regexp/percent literal opener, opening paren, or unary operator followed directly by word. * test/automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix the test, in respect to adding the space after the curly.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index dbca0d4dd26..b85385a7428 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -372,9 +372,18 @@ explicitly declared in magic comment."
372 (and 372 (and
373 (< pos (line-end-position)) 373 (< pos (line-end-position))
374 (or (eq (char-syntax (preceding-char)) '?w) 374 (or (eq (char-syntax (preceding-char)) '?w)
375 ;; FIXME: Check that the preceding token is not a keyword.
376 ;; This isn't very important most of the time, though.
375 (and (memq (preceding-char) '(?! ??)) 377 (and (memq (preceding-char) '(?! ??))
376 (eq (char-syntax (char-before (1- (point)))) '?w))) 378 (eq (char-syntax (char-before (1- (point)))) '?w)))
377 (memq (char-syntax (char-after pos)) '(?w ?\")))) 379 (or (and (eq (char-syntax (char-after pos)) ?w)
380 (not (looking-at (regexp-opt '("unless" "if" "while" "until"
381 "else" "elsif" "do" "end")
382 'symbols))))
383 (memq (syntax-after pos) '(7 15))
384 (save-excursion
385 (goto-char pos)
386 (looking-at "\\s(\\|[-+!~:]\\sw")))))
378 387
379(defun ruby-smie--at-dot-call () 388(defun ruby-smie--at-dot-call ()
380 (and (eq ?w (char-syntax (following-char))) 389 (and (eq ?w (char-syntax (following-char)))