From: "ta-ka-si@..." Date: 2000-04-26T22:31:17+09:00 Subject: [ruby-list:22143] [patch] ruby-mode.el --Multipart_Wed_Apr_26_22:34:36_2000-1 Content-Type: text/plain; charset=ISO-2022-JP 池田です。 ruby-mode で /\\/ や %r(\\) や %r\abc\ などでもインデントする patch で す。Revision は各々 1.5.2.3 と 1.12 です。 よろしくお願いします。 --Multipart_Wed_Apr_26_22:34:36_2000-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="ruby-mode.el.1.5.2.3.patch" Content-Transfer-Encoding: 7bit --- /www/work/ruby-1.4.4/misc/ruby-mode.el Mon Jan 24 03:46:14 2000 +++ ruby-mode.el Wed Apr 26 21:28:39 2000 @@ -250,7 +250,7 @@ ((looking-at "/") (cond ((and (not (eobp)) (ruby-expr-beg)) - (if (re-search-forward "[^\\]/" indent-point t) + (if (re-search-forward "[^\\]\\(\\\\\\\\\\)*/" indent-point t) nil (setq in-string (point)) (goto-char indent-point))) @@ -261,15 +261,21 @@ ((and (not (eobp)) (ruby-expr-beg) (not (looking-at "%=")) (looking-at "%[Qqrxw]?\\(.\\)")) + (goto-char (match-beginning 1)) (setq w (buffer-substring (match-beginning 1) (match-end 1))) (cond - ((string= w "[") (setq w "]")) + ((string= w "[") (setq w "\\]")) ((string= w "{") (setq w "}")) ((string= w "(") (setq w ")")) - ((string= w "<") (setq w ">"))) - (goto-char (match-end 0)) - (if (search-forward w indent-point t) + ((string= w "<") (setq w ">")) + ((member w '("*" "." "+" "?" "^" "$")) + (setq w (concat "\\" w)))) + (if (re-search-forward + (if (string= w "\\") + "\\\\[^\\]*\\\\" + (concat "[^\\]\\(\\\\\\\\\\)*" w)) + indent-point t) nil (setq in-string (point)) (goto-char indent-point))) --Multipart_Wed_Apr_26_22:34:36_2000-1 Content-Type: text/plain; charset=US-ASCII --Multipart_Wed_Apr_26_22:34:36_2000-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="ruby-mode.el.1.12.patch" --- orig/ruby-mode.el.1.12 Wed Apr 26 13:10:01 2000 +++ ruby-mode.el Wed Apr 26 22:18:11 2000 @@ -250,8 +250,8 @@ (goto-char indent-point)))) ((looking-at "/") (cond - ((and (not (eobp)) (ruby-expr-beg 'expr-arg)) - (if (re-search-forward "[^\\]/" indent-point t) + ((and (not (eobp)) (ruby-expr-beg)) + (if (re-search-forward "[^\\]\\(\\\\\\\\\\)*/" indent-point t) nil (setq in-string (point)) (goto-char indent-point))) @@ -262,15 +262,21 @@ ((and (not (eobp)) (ruby-expr-beg 'expr-arg) (not (looking-at "%=")) (looking-at "%[Qqrxw]?\\(.\\)")) + (goto-char (match-beginning 1)) (setq w (buffer-substring (match-beginning 1) (match-end 1))) (cond - ((string= w "[") (setq w "]")) + ((string= w "[") (setq w "\\]")) ((string= w "{") (setq w "}")) ((string= w "(") (setq w ")")) - ((string= w "<") (setq w ">"))) - (goto-char (match-end 0)) - (if (search-forward w indent-point t) + ((string= w "<") (setq w ">")) + ((member w '("*" "." "+" "?" "^" "$")) + (setq w (concat "\\" w)))) + (if (re-search-forward + (if (string= w "\\") + "\\\\[^\\]*\\\\" + (concat "[^\\]\\(\\\\\\\\\\)*" w)) + indent-point t) nil (setq in-string (point)) (goto-char indent-point))) --Multipart_Wed_Apr_26_22:34:36_2000-1 Content-Type: text/plain; charset=ISO-2022-JP -- 池田孝志 --Multipart_Wed_Apr_26_22:34:36_2000-1--