上野と申します。
ruby-mode 使用時に、次のようなコードの直後でインデントが狂うのが気になっ
ています。
puts(<<-End)
...
End
# <- ここで TAB
手元では以下のパッチでしのいでいますが、よろしければ取り込んでいただけな
いでしょうか。
Index: ruby-mode.el
===================================================================
RCS file: /src/ruby/misc/ruby-mode.el,v
retrieving revision 1.83
diff -u -F^( -r1.83 ruby-mode.el
--- ruby-mode.el 17 Aug 2004 09:02:39 -0000 1.83
+++ ruby-mode.el 29 Oct 2004 07:21:31 -0000
@@ -521,10 +521,24 @@ (defun ruby-parse-partial (&optional end
(looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\sw+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
- (if (re-search-forward (concat "^" re "$") end 'move)
- (forward-line 1)
- (setq in-string (match-end 0))
- (goto-char end)))
+ (let* ((id-end (goto-char (match-end 0)))
+ (line-end-position (save-excursion (end-of-line) (point)))
+ state)
+ ;; parse the rest of the line
+ (while (and (> line-end-position (point))
+ (setq state (ruby-parse-partial
+ line-end-position
+ in-string nest depth pcol indent))))
+ (setq in-string (car state)
+ nest (nth 1 state)
+ depth (nth 2 state)
+ pcol (nth 3 state)
+ indent (nth 4 state))
+ ;; skip heredoc section
+ (if (re-search-forward (concat "^" re "$") end 'move)
+ (forward-line 1)
+ (setq in-string id-end)
+ (goto-char end))))
(t
(goto-char pnt))))
((looking-at "^__END__$")
--
Daiki Ueno