Ymacs: http://www.ymacs.org/
I just spent a few minutes playing around with it. Missing a ton of key bindings, and the all-important butterfly-mode, but it definitely feels like you’re in Emacs.
It’s kind of an eerie feeling.
Ymacs: http://www.ymacs.org/
I just spent a few minutes playing around with it. Missing a ton of key bindings, and the all-important butterfly-mode, but it definitely feels like you’re in Emacs.
It’s kind of an eerie feeling.
Fortunately the command has been shorted to M-x butterfly
.
Obviously I have to post this.
Knuth’s Tex for the Math-kings of sigma, and pi,
Unix vim for the Server-lords with their O’Reilly tomes,
Word for Mortal Men doomed to die,
Emacs from the Bearded One on his Gnu throne,
In the land of Stallman where free software lies.
One Emacs to rule them all. One Emacs to find them,
One Emacs to take commands and to the keystrokes bind them,
In the land of Stallman, where free software lies.— Raffael Cavallaro, gnu.emacs.help
In a similar literary vein: Emacs Haiku. To laugh with these is to weep for what you have become.
I was looking for a good introduction to Emacs for some friends and stumbled upon the truly excellent Guided Tour of Emacs on gnu.org. And unsurprisingly it contained a few useful minor modes of which I had never heard.
icomplete-mode
icomplete-mode shows completions in the minibuffer as you type. If you’re too impatient to hit tab, then this is the minor mode for you.
iswitchb-mode
This global minor mode solves an inconvenience that had always bothered me. Typically, to see a list of buffers without resorting to the mouse, one has to C-x b TAB
to see the list of buffers, or C-x C-b
and then toggle over to the other window (Ctl-o
) to use dired to select a buffer. Too many keystrokes.
With iswitchb-mode
turned on, C-x
b
shows a list of avaialble buffers in the mini buffer, narrowing them down as you type. A much easier way to jump between dozens (hundreds?) of open files.
Update: Looks like iswitchb-mode
has been replaced with the far superior ido-mode
as of Emacs 22.
If you ever find yourself stuck relying on the IME built-into Emacs (rather than the IME native to your OS), here are the essential key strokes you’ll need to know.
C-\
: toggle input mode (ime on or off)C-h
: shows conversion options if used when in conversion modeSPC
: transform input to kanji, or show the next conversion candidateDEL
: abort conversionC-n
: show the next conversion candidateC-p
: show the previous conversion candidateC-o
: lengthen conversion bunsetsuC-i
, TAB
: shorten conversion bunsetsuShift-k
: toggle between hiragana and katakanaqq
: toggle between alphabet and kanji modesqz
: turn on zenkaku alphabet modeqh
: turn off zenkaku alphabet modeAlso useful:
C-x RET l
: set the buffer language environmentC-x RET f
: select the encodingC-x RET C-\
: select the input methodIt’s an Emacs weekend here at blog.arithm.
I was recently asked if it was possible to do remote PHP debugging with Emacs. We’re talking about Emacs, so the answer is: Of course! How to do it:
debugclient
somewhere in your path. (Here Emacs is running on Windows, so I just threw it into the C:\WINDOWS\
directory.) Make sure the executable is named “debugclient” and not “debugclient-0.9.0” or whatever.Now, assuming you already have xdebug plugged into PHP, modify php.ini or an .htaccess file with the following settings:
xdebug.remote_enable = true
xdebug.remote_handler = dbgp
xdebug.remote_host = your_client_ip
For security reasons it’s wiser to do this via .htaccess on directories that permit only authenticated access.
To debug, ask Emacs to listen for connections by going into GEBEN Mode with Meta-x geben
. You should see “xdebug started.” in the status row at the bottom of the Emacs window.
Run your PHP script with the xdebug switch on, eg.
http://www.example.com/script.php?XDEBUG_SESSION_START
If everything is setup correctly, Emacs will load the source of script.php (be wary of security!) and allow you to step through the code.
Available commands are:
spc step into/step over
i step into
o step over
r step out
b set a breakpoint at a line
u unset a breakpoint at a line
g run
q stop
Some gotchas: I’ve noticed the GEBEN expects the first keystroke to be “space”; often it will freeze otherwise. GEBEN may also run into problems on certain session-related PHP commands.
Happy debugging!
Rather than allow Emacs to assume HOME is c:\ (which will cause Vista to winge every time you want to modify your .emacs file), try the following:
setx HOME "%USERPROFILE%"
This will make home something like c:\Users\username
.
Now you can keep your .emacs in a far more rational place and not have to wake up the Vista security troll whenever you want to do some tweaking.
There are a variety of ways to “undo” something in Emacs. Unfortunately some of the keystrokes work in some environments, while others do not. Here’s a quick rundown:
Meta-x undo
— Will undo only the most recent changes. Cannot be used multiple times.Ctrl-x u
— Undo. Consecutive repetitions will undo earlier and earlier changes.Ctrl-_ or Ctrl-/
— Same as Ctrl-x u, however does not work in some envrionments.Ctrl-Shift-Minus
— Same as Ctrl-x u, however does not work in some environments.For whatever reason I can never remember the Ctrl-Shift-Minus
sequence when I find myself in an environment where Ctrl-_
and Ctrl-/
don’t work.
Keep in mind that Emacs undo is a bit different from traditional undo: Undo actions themselves are recorded as actions. This can be confusing.
In some environments, Ctrl-x Ctrl-_
will reverse the order of undo. I avoid this out of fear that it will cause the universe to implode.
See the Emacs info node for more good undo lore, such as how to use “selective undo” which restricts undo actions to changes performed in the current active region. (Very useful.)
This is something I’d always wished Emacs did; finally got around to finding a minor mode for it.
While the built-in line-number and column-number modes are fine, linum-mode
makes it much easier to see where you are in the code at a glance.
To apply it to all buffers by default, throw the following in your .emacs:
(require 'linum)
(global-linum-mode)
Update: Now baked-in to version 23+ of Emacs!
This is a cool little minor mode hack for Emacs. It’s like a last-typed heat map.
Onlookers will be amazed as you burn up the screen with your brilliant code.
Update: Rafal Jedruszek’s site above has gone AWOL, so I am preserving a copy here:
Highlight Tail (3932 downloads ) version 1.3.9 (02 Apr 2007).