Re: Any word on Epsilon/Emacs key bindings?

From: harry_bosch (harry_at_bosch.org)
Date: 02/07/04


Date: Fri, 06 Feb 2004 19:54:46 -0800


_ed_ <_nomail@_nospam.com> wrote:

> Agreed 100%, Harry! Historically, the control key was always about
> the 3rd key up on the left side, from old terminals up to the IBM AT
> keyboard (Lots of programmers love that keyboard). I don't understand
> how the current layout caught on. One of those VHS vs Beta things I
> guess. Now you have to really stretch to get to control-key
> combinations. Control+FKey combos were easy before as well.

Yep, I have no idea how the current keyboard became "approved" :-)

> I have key remappers, but I'm not sure I've seen that one. Thanks for
> the link.

Ctrl2Cap maps only the Ctrl key, so it is not a full key remapper. It's
just something I started using a while ago, and the price is right!

> Maybe I'm just accustomed to Emacs mapping, but I've always found them
> very easy, especially with the remapped control key as you have
> pointed out.

Yes, remapping the Ctrl key is a must. My main complaint about Emacs is
that the modifiers (shift, ctrl, alt) are, IMO, used disadvantageously and
hinder rapid typing. I feel that commands you would issue in rapid
succession must not require a change in key modifiers -- they should all be
ctrl keys or shift keys or alt keys, and they should *not* require you to
change from one to another when trying to issue them rapidly, *especially*
with commands you would normally issue in sucesssion. With commands that
are issued less frequently or not in succession, it is okay to have a
modifier change. For instance, in Emacs forward/backward char are Ctrl
keys, but forward/backward word are Alt keys -- ARGH! How silly! It makes
my fingers ache. It seems to me that a little thought in advance would have
revealed that they should all be either Ctrl or Alt, but not toggling back
and forth. Ctrl makes the most sense, of course, as you can park your pinky
on it as you go. OTOH, Page Down is a Ctrl key and Page Up is a Alt key,
but that's not as bad because you normally don't page forward and back in
rapid succession (unless you're just doodling). I would still prefer them
to have the same modifier, however.

> Maybe MS thought they knew how to write a text editor. <g> Hard to
> believe that their own programmers are happy with it.

Well... I know some that work there and, in their group at least, they are
not happy with it and do not use it. But they are not doing any sort of
MFC/GUI/.NET stuff, it's all low-level development that until recently was
done all in C. Their build system is also not suited to the Visual Studio
approach.

But to be honest, I do feel that VS.NET is a good editor. Not the best
perhaps, but for all the features under one roof in VS.NET, it's quite
good. And I do take the time to customize it (although I could do more). My
biggest complaint is not with the editor but with the buggy Class View and
Intellisense, and especially because there are no service packs - fixing it
so that Class View showed my program structure correctly would not even
require any documentation changes or anything. A patch or update and it
starts working correctly - Wow, what a concept! :-) But since this is
apparently the new operating mode at MS for the last couple of years, I've
basically given up on hoping that there will be any sort of fix that isn't
called an "upgrade" and that requires me to pay.

> Emacs/Epsilon users ARE disappointed. Even a bad emulation would be
> better than nothing at all. VS.NET's editor was a serious step back
> for those who had already been using Epsilon mapping in VS6.

I still suspect that it would not be that difficult to set it up with
VS.NET. Open the Macro Explorer, and open the VSEditor node. In there
you'll see a number of commands straight out of Emacs -- all you need to do
is assign them a keystroke from the Options|Environment|Keyboard section.
And there are other editor commands available that aren't macros, you just
have to scroll through the list to see them. If you can type the keys to do
what you want, it's very easy to record a series of keystrokes, save them
as a macro in your own macro file for permanent availability, and assign a
keystroke (or two) to it. I've done a fair number of additions to the
editor that way. You'll find your recorded macro in
MyMacros\RecordingModule. Go in there and fix it up or make any changes,
then cut it out and paste it into your permanent macro file, give it a
name, and you're all set.

I do use the FillCommentParagraph macro from VSEditor, but it is buggy and
often screws up, and I have not taken the time to fix it. I've learned its
quirks and know how to get around them :-) And I hardcoded the FillColumn
because it couldn't remember on its own.

> Many programmers do go outside VS to do text editing. And there are
> 3rd party addons like CodeWright. Awkward, of course, and it doesn't
> make sense of MS to dismiss a wide user base like that.

Yes, I do that too. I've added Emacs to the Tools menu, with some args so
that it loads the file into Emacs at the same place I was editing (I use
FSF Emacs, btw, not XEmacs). For one thing, the code formatting in VS.NET
is sometimes wrong, so I go over to Emacs to do that sometimes (nor is
Emacs always right when you have weird macro constructs and/or non-standard
language elements). And for some projects where I am editing a weird
assortment of file types, I like to have certain files opened in Emacs, and
normal code in VS.NET. I use Outline Mode in Emacs quite a bit for logs and
dump files (I count the nesting and emit Emacs outline mode line prefixes
and a "-*- mode: outline -*-" at the top of my log file), which is handy
for opening/closing entire branches. Just one thing Emacs does very, very
well.

> I really miss ^K (kill to end of line). I don't think the MS editor
> even has that command mapped. Hard to believe.

It's in there: Edit.DeleteToEOL. Just go to Options\Environment\Editor and
type "deletetoeol" in the "Show commands containing" edit box. Then
highlight the "Press shortcut key(s)" box and type C-k. Viola! Actually,
you will probably want to set the context to Text Editor rather than
Global. Also, you will notice that it isn't identical to Emacs, because at
the beginning of an empty line it doesn't delete anything. But -- you could
write a macro to do exactly that and assign the macro to C-k.

> What key mapping are you using currently, Harry? I'm curious about
> what you would prefer to Epsilon/Emacs.

It's a custom one that I've kind of built up over the years. It was
originally based on the "WordStar" diamond, where C-e, C-x, C-s, and C-d
are up, down, left, and right, respectively. And C-q functions as a prefix
for beginning of line, end of line, top of screen, etc. The good
thing about that old Wordstar setup is that I can move all over my file and
anywhere in any line, with only the left hand, with my pinky parked on
ctrl. My right hand is free to mouse around, swat flies, or whatever.
Another good thing about it, and another error, IMO, in Emacs, is that the
C-e/x/s/d layout is *not* mnemonic, it's visual, and the fingers naturally
"know" what to do. I mean, C-f and C-b in Emacs are nice, but after 5 or
10 minutes, do you *really* need help remembering what they are for? It
would have been better to have them adjacent or positioned somehow so that
you can issue them rapdidly and in succession, without worrying whether the
key you've chosen "stands for" something, such as "Forward" or "Back".
Well, that's just one of my Emacs rants, don't take it seriously :-)

I also have set up a series of Alt commands for rarely issued commands in
VS.NET, and a set of ctrl-prefixed commands (similar to Emacs) for other
commands and macros I've written. Probably not particularly brilliant, but
I've used it for many years, and I'm used to it :-)

-- 
harry


Relevant Pages

  • Shift down macro
    ... How do you write a macro that does one set of commands if a shift (ctrl or ... any other) button is pressed and another set of commands if it is not pressed? ...
    (microsoft.public.word.vba.general)
  • Re: effective emacs
    ... Emacs deals pretty well with proportional fonts in general. ... a few commands, and to eliminate most hotkeys altogether. ... some point of time, hotkey sequences get ingrained, and then they are ... were built on top of a more flexible buffer type. ...
    (comp.emacs)
  • Re: An Editor that Skips to the End of a Def
    ... that are to be found on the way up the Emacs learning curve. ... Off the top of my head, I can think of a few vim commands that have ... the latter case, you can't use backspace, you have to use "X". ...
    (comp.lang.python)
  • Re: Emacs newbies [Re: Which Emacs CL mode?}
    ... I learnt emacs by way of MPW (the ability to add commands to the ... basics are explained in the tutorial. ...
    (comp.lang.lisp)
  • Re: Who uses vi?
    ... I use both Vim and Emacs, and I'm really fond of them. ... They're THE editors. ... Windows is to install Vim and Emacs ports for Windows. ... One of the funny things of Emacs is that it teaches commands to you. ...
    (comp.unix.bsd.freebsd.misc)