character syntax

Ian Zimmerman
07 Feb 2002 13:30:18 -0800

Hal> Since we're on this topic, I'm constantly annoyed by the
Hal> following (in addition to sexps with '(' and ')'): how to get
Hal> emacs to realize that it should match the parens on:

Hal> map (\(x,y) -> ...

Hal> since \( isn't an escape character.  i end up writing:

Hal> map (\ (x,y) -> ...

Hal> but i'd prefer the former

Hal> also, to not thing -- in a string begins a comment:

Hal> print "This is not -- I repeat, not -- a comment"

Hal> There's one more case, but I'm going blank on it right now.
Hal> Anyone have any fixes?

Yes, I know about these as well.  The first would normally be
addressed by

(add-hook 'haskell-mode-hook
  (lambda ()
    (modify-syntax-entry ?\\ "'")))

but of course this screws up parsing of strings, which will now be
terminated by \" :-(

The second one is because the haskell mode tries to handle comments on
its own (and fails), since once again Haskell comments can't be
handled by the normal mechanism -- partly because of nested comments,
but even the line tail comments are weird due to the single-token

All this taken together, I mean, _really_, is the lexical structure of
Haskell a botch, or what?

Ian Zimmerman, Oakland, California, U.S.A.
GPG: 433BA087  9C0F 194F 203A 63F7 B1B8  6E5A 8CA3 27DB 433B A087
The world has taken on a thickness of vulgarity that raises
a spiritual man's contempt to the violence of a passion.  Baudelaire