diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 02:51:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 02:51:10 +0000 |
commit | 182ced3e15230564a709a3bceeeae29ec100e131 (patch) | |
tree | 5e6d3edd5615aa0e2a52855207c5ee5632780645 | |
parent | 2d50a48405e8650380c2d15fd9e7af5716b8eabc (diff) |
* misc/ruby-mode.el (ruby-special-char-p, ruby-parse-partial): handle
operator symbols. [ruby-talk:120177]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | misc/ruby-mode.el | 13 |
2 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Mon Nov 15 11:50:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * misc/ruby-mode.el (ruby-special-char-p, ruby-parse-partial): handle + operator symbols. [ruby-talk:120177] + Sun Nov 14 13:27:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/pp.rb (PP#object_address_group): remove odd number of 'f' diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 041ddc66ff..aaf8913858 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -293,10 +293,11 @@ The variable ruby-indent-level controls the amount of indentation. (move-to-column (+ x shift)))))) (defun ruby-special-char-p (&optional pnt) - (let ((c (char-before (or pnt (point))))) + (setq pnt (or pnt (point))) + (let ((c (char-before pnt)) (b (and (< (point-min) pnt) (char-before (1- pnt))))) (cond ((or (eq c ??) (eq c ?$))) - ((eq c ?\\) - (eq (char-before (1- (or pnt (point)))) ??))))) + ((and (eq c ?:) (or (not b) (eq (char-syntax b) ? )))) + ((eq c ?\\) (eq b ??))))) (defun ruby-expr-beg (&optional option) (save-excursion @@ -503,7 +504,11 @@ The variable ruby-indent-level controls the amount of indentation. (setq nest (cons (cons nil pnt) nest)) (setq depth (1+ depth))) (goto-char pnt)) - ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*\\)?") + ((looking-at ":\\(['\"]\\)\\(\\\\.\\|[^\\\\]\\)*\\1") + (goto-char (match-end 0))) + ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\)") + (goto-char (match-end 0))) + ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?") (goto-char (match-end 0))) ((or (looking-at "\\.\\.\\.?") (looking-at "\\.[0-9]+") |