[racket-dev] Square-bracket-sensitive macros in Scribble sandboxes

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Nov 24 20:10:24 EST 2012

Just now, Robby Findler wrote:
> But my emacs nowadays works fine with unicode (and I long ago gave
> up on trying to maintain an .emacs file so I just get the defaults).

Heh -- yes, it handles unicode fine, but the real problem is typing
it.  There are input modes that allow you to type greek or sgml or
whatever, but they're inconvenient since you need to switch the input,
type the letter you want, then switch back.  (And each switch is some
obscure three-part chord, IIRC.)  I started with an attempt to mimic
drracket's M-\ feature, and ended up with a neat solution: I have a
key that switches to my input mode which works "temporarily" only for
one character, and then you're back to the input you've used.  So, for
example, to type a λ in drr you'd use "\LAMBDA<M-\>", and the
equivalent with my thing is "<M-RET>LAMBDA".  The nice thing about it
is that I can define multiple names for each thing, for example, in
addition to "rarr" I also have the much-easier-to-remember "->" (or a
more extreme case: "vdash" vs "|-").  It's easy enough that I just
have "\" produce a lambda so I don't even need a specific shortcut key
for that ("<M-RET>\" is almost as quick).

I'd love to see something like that in drr, but I think that it might
be too confusing since it already uses "\".  Besides, in drr it makes
sense to just have something less sophisticated and rely on the OS/GUI
to make such things easier system-wide, whereas in Emacs the result of
all of this is that I can use my thing even in places like file names,
or isearch.

(Now all that's missing is a drracket-jr resurrection...)

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.