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

_______________________________________________
Haskellmode-emacs mailing list
[email protected]
http://projects.haskell.org/cgi-bin/mailman/listinfo/haskellmode-emacs

Reply via email to