I'm gonna be working with Haskell for a while. If I come up with something good I'll send a patch!
On Fri, Nov 5, 2010 at 1:45 PM, Deniz Dogan <[email protected]>wrote: > 2010/11/5 Johan Andersson <[email protected]>: > > Ahh... haskell-indent-align-def is pretty much what I'm looking for. Why > not > > have a smart interactive version of this? > > > > I support that idea. You should submit a patch! :) > > > On Fri, Nov 5, 2010 at 9:08 AM, Deniz Dogan <[email protected]> > > wrote: > >> > >> 2010/11/4 Johan Andersson <[email protected]>: > >> > Well, I used this command mostly to get the equal signs aligned. When > >> > you > >> > change a functions arguments, the equal signs will not be aligned > >> > anymore. > >> > Then it great to be able to just quickly align them and in that case > you > >> > don't want to insert an equal sign. > >> > >> Sorry, I had misunderstood the intent of the command. > >> > >> > Maybe the function could be split up into two? One that only aligns > and > >> > one > >> > that aligns and insert the equal sign. > >> > >> I'm not sure there is any point in splitting it up into two functions > >> as you described as the body of one of them would essentially be only > >> (insert "="). And haskell-indent-align-def already does the other > >> part. > >> > >> > On Thu, Nov 4, 2010 at 12:19 AM, Deniz Dogan < > [email protected]> > >> > wrote: > >> >> > >> >> 2010/11/2 Johan Andersson <[email protected]>: > >> >> > Or maybe this is better so you can be anywhere in a line without > >> >> > inserting > >> >> > the equal sign: > >> >> > (unless (string-match "=" (buffer-substring-no-properties > >> >> > (line-beginning-position) (line-end-position))) > >> >> > (insert "= ")) > >> >> > >> >> Consider this example: > >> >> > >> >> foo a | a == 1 = 2 > >> >> | a == 2 * > >> >> > >> >> Note that the second line needs indentation and you want to both > >> >> indent the line and insert "=". With your latest suggestion, it would > >> >> not insert the character. > >> >> > >> >> I think your first idea with looking-back is the better way to go, > >> >> even though I wonder why you use this command if you already have an > >> >> equals sign. > >> >> > >> >> -- > >> >> Deniz Dogan > >> > > >> > > > > > > > > > -- > Deniz Dogan >
_______________________________________________ Haskellmode-emacs mailing list [email protected] http://projects.haskell.org/cgi-bin/mailman/listinfo/haskellmode-emacs
