diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-07 19:29:41 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-07 19:29:41 +0000 |
commit | 20eff9bd7c62f2f7ae4367b4d16adad5dcfb50c6 (patch) | |
tree | fcd118075944bb5cce705d7f8d3b9ffe8bc55c64 /misc | |
parent | 593855a0ff14083b5b790a07b058789af163e385 (diff) | |
download | ruby-20eff9bd7c62f2f7ae4367b4d16adad5dcfb50c6.tar.gz |
* misc/ruby-mode.el: Use preceding-char/following-char
(returning 0 at BOF/EOF) instead of char-before/char-after
(returning nil at BOF/EOF) to avoid error from char-syntax when
at BOF/EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ruby-mode.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 4efa60a321..a6d0c4cec3 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -448,7 +448,7 @@ Emacs to Ruby." ((progn (forward-char -1) (and (looking-at "\\?") - (or (eq (char-syntax (char-before (point))) ?w) + (or (eq (char-syntax (preceging-char)) ?w) (ruby-special-char-p)))) nil) ((and (eq option 'heredoc) (< space 0)) @@ -1201,14 +1201,14 @@ balanced expression is found." (let ((orig (point)) (end (progn (ruby-forward-sexp) (point)))) (when (eq (char-before) ?\}) (delete-char -1) - (if (eq (char-syntax (char-before)) ?w) + (if (eq (char-syntax (preceding-char)) ?w) (insert " ")) (insert "end") - (if (eq (char-syntax (char-after)) ?w) + (if (eq (char-syntax (following-char)) ?w) (insert " ")) (goto-char orig) (delete-char 1) - (if (eq (char-syntax (char-before)) ?w) + (if (eq (char-syntax (preceding-char)) ?w) (insert " ")) (insert "do") (when (looking-at "\\sw\\||") @@ -1218,7 +1218,7 @@ balanced expression is found." (defun ruby-do-end-to-brace () (when (and (or (bolp) - (not (memq (char-syntax (char-before)) '(?w ?_)))) + (not (memq (char-syntax (preceding-char)) '(?w ?_)))) (looking-at "\\<do\\(\\s \\|$\\)")) (let ((orig (point)) (end (progn (ruby-forward-sexp) (point)))) (backward-char 3) |