In some discussion on ll1-discuss, Olin Shivers talked about how nice
it was to have lower-case parens.  Here's my xmodmap file that lets
users of X have lower-case parens by swapping them with square
brackets.

After using my keyboard this way for about a month, I'm mostly used to
it, although I still sometimes type 9 or 0 for ( or ), and I
frequently type :] when I mean :).  The worst part is that I forgot a
password I used frequently.  My fingers got confused.

In Lisp dialects, parens are about 7% of my source code, so this is a
huge relief.  (I feel good every time I edit my .emacs.)  But in all
languages I type regularly (English, C, Perl, Lisp, Python)
parentheses outnumber square brackets by at least four to one.

! Olin Shivers writes:
! Life with lower-case parens is verra nice, as former LispM hackers will tell
! you. One day I was missing that feature, so I sat down and fixed it. The
! following xmodmap file 
! Swap () and []
! [version using keycodes elided -- Kragen] 
! swaps () & [] on the keyboard on my linux laptop under X, so that parens are
! conveniently accessible -- lowercase & not on the hard-to-touch-type topmost
! row. I highly recommend this hack to Lisp & Scheme hackers.
! ...
! ...These keyboard hacks also have the nice side effect that when other people use
! ...my laptop for a little while, they separate out into two sets:
!   - the set of people who go, "Hey? What's going on? Your bracket keys
!     generate parens?!?!"
!   - and the, usually older and more select, group that go, "Hey! You've
!     got lower-case parens! That's great!" and then start laughing.
! 
! [slightly more generic version that follows; it works on keyboards with different
! keycodes, but will be a little weird if your [] keys don't have {} on them, or
! your 9 0 keys don't have () on them -- kragen]
keysym bracketleft = parenleft braceleft
keysym bracketright = parenright braceright
keysym parenleft = 9 bracketleft
keysym parenright = 0 bracketright
! That isn't idempotent like the keycode version, and it isn't self-reversing.
! Undoing it on a standard PC keyboard requires the following:
! keysym bracketleft = 9 parenleft
! keysym bracketright = 0 parenright
! keysym parenleft = bracketleft braceleft
! keysym parenright = bracketright braceright

Reply via email to