diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ruby-additional.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/ruby-additional.el b/misc/ruby-additional.el index 6ef10944f2..85cfdd8d90 100644 --- a/misc/ruby-additional.el +++ b/misc/ruby-additional.el @@ -7,11 +7,11 @@ (defun ruby-insert-end () (interactive) - (if (eq (char-syntax (char-before)) ?w) + (if (eq (char-syntax (preceding-char)) ?w) (insert " ")) (insert "end") (save-excursion - (if (eq (char-syntax (char-after)) ?w) + (if (eq (char-syntax (following-char)) ?w) (insert " ")) (ruby-indent-line t) (end-of-line))) @@ -19,16 +19,16 @@ (defun ruby-brace-to-do-end () (when (looking-at "{") (let ((orig (point)) (end (progn (ruby-forward-sexp) (point)))) - (when (eq (char-before) ?\}) + (when (eq (preceding-char) ?\}) (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\\||") @@ -38,7 +38,7 @@ (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) |