ruby-mode.el dies when breaking ternary exp. 
Author Message
 ruby-mode.el dies when breaking ternary exp.

ruby-mode.el causes Emacs to consume all available CPU when using the
following odd indenting:

1: def foo
2:    thingy = (bar.nil? ?
3:              "goo" :
4:              "stuff")
5: end

Pressing return at the end of line 2, then hitting tab at the
beginning of line 3 causes the problem. The following doesn't trigger
it, so I'm guessing that it's getting confused by the double-? on line
2...

1: def foo
2:    thingy = (bar.stuff ?
3:              "foo" :
4:              "stuff")
5: end  

Dan
--
/^Dan Debertin$/

www.nodewarrior.org
ignorami: n:
The art of folding problem users into representational shapes.



Fri, 07 Jan 2005 00:48:07 GMT  
 ruby-mode.el dies when breaking ternary exp.
Hi,

At Mon, 22 Jul 2002 01:40:42 +0900,

Quote:

> ruby-mode.el causes Emacs to consume all available CPU when using the
> following odd indenting:

> 1: def foo
> 2:    thingy = (bar.nil? ?
> 3:              "goo" :
> 4:                 "stuff")
> 5: end

Does the patch fix it?

Index: ruby-mode.el
===================================================================
RCS file: /cvs/ruby/src/ruby/misc/ruby-mode.el,v
retrieving revision 1.53
diff -u -2 -p -r1.53 ruby-mode.el
--- ruby-mode.el        28 Jun 2002 14:40:54 -0000      1.53

               ((looking-at "\\?")    ;skip ?char
                (cond
-                ((ruby-expr-beg)
-                 (looking-at "?\\(\\\\C-\\|\\\\M-\\)*.")
+                ((and (ruby-expr-beg)
+                      (looking-at "?\\(\\\\C-\\|\\\\M-\\)*."))
                  (goto-char (match-end 0)))
                 (t

--
Nobu Nakada



Fri, 07 Jan 2005 01:20:37 GMT  
 ruby-mode.el dies when breaking ternary exp.
At Mon, 22 Jul 2002 02:18:03 +0900,

Quote:

> Does the patch fix it?

Yes, that it does. Thanks!

Dan
--
/^Dan Debertin$/

www.nodewarrior.org
ignorami: n:
The art of folding problem users into representational shapes.



Fri, 07 Jan 2005 01:35:47 GMT  
 ruby-mode.el dies when breaking ternary exp.
Hi,

At Mon, 22 Jul 2002 02:31:56 +0900,

Quote:

> Yes, that it does. Thanks!

Although irrelevant to it, incidentally I made another patch
too.  How about this?

Index: ruby-mode.el
===================================================================
RCS file: /cvs/ruby/src/ruby/misc/ruby-mode.el,v
retrieving revision 1.53
diff -u -2 -p -r1.53 ruby-mode.el
--- ruby-mode.el        28 Jun 2002 14:40:54 -0000      1.53

 (defvar ruby-deep-arglist t
-  "*Deep indent argument lists when non-nil.")
+  "*Deep indent argument lists when non-nil.
+Also ignores spaces after parenthesis when 'space.")


                )
               ((and (looking-at "(") ruby-deep-arglist)
+               (and (eq ruby-deep-arglist 'space) (looking-at ".[ \t]+")
+                    (setq pnt (match-end 0)))
                (setq nest (cons (cons (char-after (point)) pnt) nest))
                (setq pcol (cons (cons pnt depth) pcol))

--
Nobu Nakada



Fri, 07 Jan 2005 02:05:40 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. hideshow mode for ruby-mode.el

2. latest ruby-mode.el messing up c++ mode fontification

3. ruby-mode.el was: ruby indenter

4. ruby-mode.el was: ruby indenter

5. ruby-mode.el again; imenu this time

6. ruby-mode.el and xemacs

7. A mode-ruby.el for xemacs ?

8. ruby-mode.el indentation issue #2

9. BUG: ruby-mode.el 1.41 disables font-lock coloring

10. XEmacs problems with ruby-mode.el

11. ruby-mode.el indentation issue

12. Bug fix for ruby-mode.el

 

 
Powered by phpBB® Forum Software