# Changing indentation for case in Emacs (ruby.el)

**URL:** <https://www.ruby-forum.com/t/changing-indentation-for-case-in-emacs-ruby-el/111234>\
**Category:** Ruby\
**Created:** [August 4, 2007, 2:43am UTC](https://www.ruby-forum.com/t/changing-indentation-for-case-in-emacs-ruby-el/111234 "2007-08-04T02:43:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![will\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a87d85/32.png) [@will\_p](https://www.ruby-forum.com/u/will_p)\
**Post date:** [August 4, 2007, 2:43am UTC](https://www.ruby-forum.com/t/changing-indentation-for-case-in-emacs-ruby-el/111234/1 "2007-08-04T02:43:28Z")

</div>

Using Emacs to edit ruby files, I’d like to have case expresssions  
indented  
thus:

case x  
when p then s  
when q then t  
end

rather than:

case x  
when p then s  
when q then t  
end

Can I do this easily?

(PS: The 1st edition of Programming Ruby seems to use the first form,  
judging from the on-line version; the 2nd edition uses the 2nd form,  
looking at the paper copy of the book.)

- Will
