summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--misc/ruby-mode.el22
2 files changed, 18 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 06690e08dc..fc38c75074 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jul 31 17:40:16 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 05:47:37 2004 why the lucky stiff <why@ruby-lang.org>
* lib/yaml.rb (YAML::load_file, YAML::parse_file): added.
@@ -73,7 +79,7 @@ Fri Jul 23 09:03:16 2004 Shugo Maeda <shugo@ruby-lang.org>
Thu Jul 22 16:41:54 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore#update): sets the
- permission of the session data file to 0600.
+ permission of the session data file to 0600.
* lib/cgi/session/pstore.rb (CGI::Session::Pstore#initialize):
ditto.
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index a45b638f17..aa2a2935b1 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -321,9 +321,9 @@ The variable ruby-indent-level controls the amount of indentation.
(and (looking-at ruby-symbol-re)
(skip-chars-backward ruby-symbol-chars)
(cond
- ((or (looking-at ruby-block-beg-re)
- (looking-at ruby-block-op-re)
- (looking-at ruby-block-mid-re))
+ ((or (looking-at (concat "\\<\\(" ruby-block-beg-re
+ "|" ruby-block-op-re
+ "|" ruby-block-mid-re "\\)\\>")))
(goto-char (match-end 0))
(not (looking-at "\\s_")))
((eq option 'expr-qstr)
@@ -451,7 +451,7 @@ The variable ruby-indent-level controls the amount of indentation.
(setq depth (1- depth)))
(setq nest (cdr nest))
(goto-char pnt))
- ((looking-at ruby-block-end-re)
+ ((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
(if (or (and (not (bolp))
(progn
(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 depth (1+ depth))))
(goto-char (match-end 0)))
- ((looking-at ruby-block-beg-re)
+ ((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
(and
(save-match-data
(or (not (looking-at "do\\>[^_]"))
@@ -692,7 +692,7 @@ The variable ruby-indent-level controls the amount of indentation.
(and
(or (and (looking-at ruby-symbol-re)
(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)))
(save-excursion
(goto-char (match-end 0))
@@ -728,7 +728,7 @@ The variable ruby-indent-level controls the amount of indentation.
(setq indent
(cond
((and
- (not (looking-at ruby-block-hanging-re))
+ (not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")))
(eq (ruby-deep-indent-paren-p t) 'space)
(not (bobp)))
(ruby-beginning-of-arg (or begin parse-start) (point))
@@ -782,7 +782,7 @@ An end of a defun is found by moving forward from the beginning of one."
(defun ruby-move-to-block (n)
(let (start pos done down)
(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))))
(forward-line n)
(cond
@@ -804,7 +804,7 @@ An end of a defun is found by moving forward from the beginning of one."
(if done
(progn
(back-to-indentation)
- (if (looking-at ruby-block-mid-re)
+ (if (looking-at (concat ("\\<\\(" ruby-block-mid-re "\\)\\>")))
(setq done nil))))))
(back-to-indentation))
@@ -832,7 +832,7 @@ An end of a defun is found by moving forward from the beginning of one."
(skip-chars-forward ",.:;|&^~=!?\\+\\-\\*")
(looking-at "\\s("))
(goto-char (scan-sexps (point) 1)))
- ((looking-at ruby-block-beg-re)
+ ((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
(ruby-end-of-block)
(forward-word 1))
((looking-at "\\(\\$\\|@@?\\)?\\sw")
@@ -891,7 +891,7 @@ An end of a defun is found by moving forward from the beginning of one."
(?:
(forward-char -1)
(eq (char-before) :)))))
- (if (looking-at ruby-block-end-re)
+ (if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
(ruby-beginning-of-block))
nil))
(setq i (1- i)))