diff options
| author | Dmitry Gutov | 2013-10-26 05:16:37 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-26 05:16:37 +0400 |
| commit | bae91342a41c1aef864c64c2354dfbfc58335bfa (patch) | |
| tree | cbbd3638d05ffca818ac046281802ce8ae97b61e /lisp | |
| parent | eb89dc14d9367b3f2dbb265dedf2e781a4105b03 (diff) | |
| download | emacs-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')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 82e03a48da4..e25d5bab1e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-10-26 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be more | ||
| 4 | specific in what the first arg can be: a non-keyword word, | ||
| 5 | string/regexp/percent literal opener, opening paren, or unary | ||
| 6 | operator followed directly by word. | ||
| 7 | |||
| 1 | 2013-10-25 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2013-10-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * progmodes/prolog.el: Remove old indent; use post-self-insert-hook. | 10 | * progmodes/prolog.el: Remove old indent; use post-self-insert-hook. |
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))) |