From: matz@... (Yukihiro Matsumoto) Date: 2000-07-04T10:53:51+09:00 Subject: [ruby-talk:03784] Re: Emacs indentation Hi, In message "[ruby-talk:03761] Emacs indentation" on 00/07/03, Aleksi Niemel� writes: | |def emacs | indentation_example = | "next line is indented " + | "right " + # but next line doesn't | "and the reason is " + | "the incorrect handling of the '#' " + | "character. I hope some " + | "emacs guru fixes this." | | puts indentation_example |end This patch may help. --- ruby-mode.el 2000/06/12 07:48:31 1.15 +++ ruby-mode.el 2000/07/04 01:51:47 @@ -549,8 +549,11 @@ (skip-chars-backward " \t") - (and (re-search-backward "#" (save-excursion - (beginning-of-line) - (point)) t) - (setq state (ruby-parse-region parse-start (point))) - (nth 0 state) - (goto-char (nth 0 state))) + (let ((pos (point))) + (and + (re-search-backward "#" (save-excursion + (beginning-of-line) + (point)) t) + (skip-chars-backward " \t") + (setq state (ruby-parse-region parse-start (point))) + (nth 0 state) + (goto-char pos))) (or (bobp) (forward-char -1))