# Bug with Emacs mode for Ruby

**URL:** <https://www.ruby-forum.com/t/bug-with-emacs-mode-for-ruby/73300>\
**Category:** Ruby\
**Created:** [October 23, 2006, 5:43pm UTC](https://www.ruby-forum.com/t/bug-with-emacs-mode-for-ruby/73300 "2006-10-23T17:43:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [October 23, 2006, 5:43pm UTC](https://www.ruby-forum.com/t/bug-with-emacs-mode-for-ruby/73300/1 "2006-10-23T17:43:29Z")

</div>

There seems to be a bug with Emacs mode of Ruby:

For example:  
I have following three statements and Emacs behaves quite differently  
with each of them

# this work pretty fine actually

return 1 if @chunked\_data !~ /SESSID/

# indentation is pretty screwed up actually

return $& if @chunked\_data !~ /SESSID/  
# Emacs thinks this as the beginning of the next statement

#again indentation of subsequent lines get screwed up  
return “hi” if @chunked\_data =~ /(?:SESSID=)(\w+)(?:,|##)/

# Emacs thinks this as the beginning of the next statement

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [October 24, 2006, 6:10am UTC](https://www.ruby-forum.com/t/bug-with-emacs-mode-for-ruby/73300/2 "2006-10-24T06:10:11Z")

</div>

Could you post a link to a screenshot of the behavior of Emacs on your  
machine? I think I may have experienced something simillar but I am  
not entirely sure.
