Do not insert equal sign if one already

Johan Andersson johan.rejeep at gmail.com
Thu Nov 4 02:01:28 EDT 2010


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.

Maybe the function could be split up into two? One that only aligns and one
that aligns and insert the equal sign.

On Thu, Nov 4, 2010 at 12:19 AM, Deniz Dogan <deniz.a.m.dogan at gmail.com>wrote:

> 2010/11/2 Johan Andersson <johan.rejeep at gmail.com>:
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.haskell.org/pipermail/haskellmode-emacs/attachments/20101104/99607f4d/attachment.htm 


More information about the Haskellmode-emacs mailing list