Categories
Computers & Software

Emacs Tip of the Month

Want real shell mode in Emacs? Using M-x shell only gives terminal emulation, which sometimes doesn’t display things correctly and which, since it supports all Emacs key bindings, makes you do things like use M-p instead of C-p to bring up previous commands in the command buffer ring. Most of the time Shell mode is fine and actually preferable, but if you need a true terminal/shell mode, use M-x term. In this mode it at first appears none of the usual Emacs key-bindings work — How do you change windows?? The secret is to use C-c instead of C-x as your command prefix, e.g. use C-c o instead of C-x o to change windows. To use the M-x commands or any other command, just precede the command with C-c. Thus use C-c M-x compile instead of just M-x compile. Try it. You’ll like it. (Hey I know this is too simple for Emacs gurus with megabyte long .emacs configuration files, but not all of us know these tricks, not even some long time users).

By mannd

I am a retired cardiac electrophysiologist who has worked both in private practice in Louisville, Kentucky and as a Professor of Medicine at the University of Colorado in Denver. I am interested not only in medicine, but also in computer programming, music, science fiction, fantasy, 30s pulp literature, and a whole lot more.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.