[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:03784] Re: Emacs indentation

From: matz@... (Yukihiro Matsumoto)
Date: 2000-07-04 01:53:51 UTC
List: ruby-talk #3784
Hi,

In message "[ruby-talk:03761] Emacs indentation"
    on 00/07/03, Aleksi Niemel<aleksi.niemela@cinnober.com> 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))

In This Thread

Prev Next