mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial,
ruby-calculate-indent, ruby-move-to-block, ruby-forward-sexp, ruby-backward-sexp): keywords must match word-wise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
021b336535
commit
cd110140db
2 changed files with 17 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Jul 31 17:39:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial,
|
||||||
|
ruby-calculate-indent, ruby-move-to-block, ruby-forward-sexp,
|
||||||
|
ruby-backward-sexp): keywords must match word-wise.
|
||||||
|
|
||||||
Sat Jul 31 13:37:51 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Jul 31 13:37:51 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (is_defined): avoid unnecessary method invocations.
|
* eval.c (is_defined): avoid unnecessary method invocations.
|
||||||
|
|
|
@ -321,9 +321,9 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(and (looking-at ruby-symbol-re)
|
(and (looking-at ruby-symbol-re)
|
||||||
(skip-chars-backward ruby-symbol-chars)
|
(skip-chars-backward ruby-symbol-chars)
|
||||||
(cond
|
(cond
|
||||||
((or (looking-at ruby-block-beg-re)
|
((or (looking-at (concat "\\<\\(" ruby-block-beg-re
|
||||||
(looking-at ruby-block-op-re)
|
"|" ruby-block-op-re
|
||||||
(looking-at ruby-block-mid-re))
|
"|" ruby-block-mid-re "\\)\\>")))
|
||||||
(goto-char (match-end 0))
|
(goto-char (match-end 0))
|
||||||
(not (looking-at "\\s_")))
|
(not (looking-at "\\s_")))
|
||||||
((eq option 'expr-qstr)
|
((eq option 'expr-qstr)
|
||||||
|
@ -451,7 +451,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(setq depth (1- depth)))
|
(setq depth (1- depth)))
|
||||||
(setq nest (cdr nest))
|
(setq nest (cdr nest))
|
||||||
(goto-char pnt))
|
(goto-char pnt))
|
||||||
((looking-at ruby-block-end-re)
|
((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
|
||||||
(if (or (and (not (bolp))
|
(if (or (and (not (bolp))
|
||||||
(progn
|
(progn
|
||||||
(forward-char -1)
|
(forward-char -1)
|
||||||
|
@ -477,7 +477,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(setq nest (cons (cons nil pnt) nest))
|
(setq nest (cons (cons nil pnt) nest))
|
||||||
(setq depth (1+ depth))))
|
(setq depth (1+ depth))))
|
||||||
(goto-char (match-end 0)))
|
(goto-char (match-end 0)))
|
||||||
((looking-at ruby-block-beg-re)
|
((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
|
||||||
(and
|
(and
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(or (not (looking-at "do\\>[^_]"))
|
(or (not (looking-at "do\\>[^_]"))
|
||||||
|
@ -661,7 +661,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(and
|
(and
|
||||||
(or (and (looking-at ruby-symbol-re)
|
(or (and (looking-at ruby-symbol-re)
|
||||||
(skip-chars-backward ruby-symbol-chars)
|
(skip-chars-backward ruby-symbol-chars)
|
||||||
(looking-at ruby-block-hanging-re)
|
(looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>"))
|
||||||
(not (eq (point) (nth 3 state)))
|
(not (eq (point) (nth 3 state)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (match-end 0))
|
(goto-char (match-end 0))
|
||||||
|
@ -700,7 +700,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(cond
|
(cond
|
||||||
((and
|
((and
|
||||||
(null op-end)
|
(null op-end)
|
||||||
(not (looking-at ruby-block-hanging-re))
|
(not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")))
|
||||||
(eq (ruby-deep-indent-paren-p t) 'space)
|
(eq (ruby-deep-indent-paren-p t) 'space)
|
||||||
(not (bobp)))
|
(not (bobp)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -757,7 +757,7 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
(defun ruby-move-to-block (n)
|
(defun ruby-move-to-block (n)
|
||||||
(let (start pos done down)
|
(let (start pos done down)
|
||||||
(setq start (ruby-calculate-indent))
|
(setq start (ruby-calculate-indent))
|
||||||
(setq down (looking-at (if (< n 0) ruby-block-end-re ruby-block-beg-re)))
|
(setq down (looking-at (concat "\\<\\(" (if (< n 0) ruby-block-end-re ruby-block-beg-re) "\\)\\>")))
|
||||||
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
|
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
|
||||||
(forward-line n)
|
(forward-line n)
|
||||||
(cond
|
(cond
|
||||||
|
@ -779,7 +779,7 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
(if done
|
(if done
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(back-to-indentation)
|
(back-to-indentation)
|
||||||
(if (looking-at ruby-block-mid-re)
|
(if (looking-at (concat ("\\<\\(" ruby-block-mid-re "\\)\\>")))
|
||||||
(setq done nil))))))
|
(setq done nil))))))
|
||||||
(back-to-indentation))
|
(back-to-indentation))
|
||||||
|
|
||||||
|
@ -807,7 +807,7 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
(skip-chars-forward ",.:;|&^~=!?\\+\\-\\*")
|
(skip-chars-forward ",.:;|&^~=!?\\+\\-\\*")
|
||||||
(looking-at "\\s("))
|
(looking-at "\\s("))
|
||||||
(goto-char (scan-sexps (point) 1)))
|
(goto-char (scan-sexps (point) 1)))
|
||||||
((and (looking-at ruby-block-beg-re)
|
((and (looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
|
||||||
(not (eq (char-before (point)) ?.))
|
(not (eq (char-before (point)) ?.))
|
||||||
(not (eq (char-before (point)) ?:)))
|
(not (eq (char-before (point)) ?:)))
|
||||||
(ruby-end-of-block)
|
(ruby-end-of-block)
|
||||||
|
@ -868,7 +868,7 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
(?:
|
(?:
|
||||||
(forward-char -1)
|
(forward-char -1)
|
||||||
(eq (char-before) :)))))
|
(eq (char-before) :)))))
|
||||||
(if (looking-at ruby-block-end-re)
|
(if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
|
||||||
(ruby-beginning-of-block))
|
(ruby-beginning-of-block))
|
||||||
nil))
|
nil))
|
||||||
(setq i (1- i)))
|
(setq i (1- i)))
|
||||||
|
|
Loading…
Reference in a new issue