Emacs align-regexp on = but not ==

Posted by Karl on Stack Overflow See other posts from Stack Overflow or by Karl
Published on 2011-01-11T02:25:04Z Indexed on 2011/01/11 2:54 UTC
Read the original article Hit count: 221

Filed under:
|
|
|

I am working in Haskell and frequently come across code similar to the following:

func i j | i == j = i
         | otherwise = j

I want to align on the '=' character using align-regexp but don't have the elisp knowhow. I have tried just doing " = " without the quotes, but this inserts an unwanted space character before each '='. I have found a proposed solution here but I can't seem to get that to do anything at all.

Please help me write a function or hard-coded macro that will allow me to set a keybinding for this.

© Stack Overflow or respective owner

Related posts about emacs

Related posts about haskell