Uncategorized

Crazy Emacs features

I just noticed this gem while skimming the list of packages built into Emacs: landmark neural-network robot that learns landmarks Yes, Emacs is no ordinary text editor. It’s an operating system, a religion, an entire universe unto itself. Here are a few other winners. animate make text dance bruce phrase utility for overloading the Communications […]
Standard

Emacs vc-git tweaks

I use Emacs, vc, and git all pretty heavily. I know the cool kids use magit and egg, but good old vc has stuck with me through four different “new hotness” version control systems – CVS, Perforce, Subversion, and now git – and I’m sure it will still be around for many more to come. […]
Standard

emacsclient in TRAMP remote shells

Update: Emacs 26.1 added official support for this with a new emacsclient –tramp option! The 26.1 manual isn’t online yet, but you can learn more with M-x info inside Emacs 26.1, Emacs => emacsclient options. I recently started running shells inside Emacs via shell mode, including ssh sessions to remote hosts using TRAMP. I’m pretty […]
Standard

why I run shells inside Emacs

Mental context switches are evil. Some people handle them better than others, but not me. I handle them worse. I feel it, almost physically, when context switches whittle down my precious flow piece by piece. It hurts! Even something as small as switching between Emacs and the shell can hurt, especially when I do it […]
Standard

Emacs Lisp for flowed text email

Here’s some Emacs Lisp for encoding flowed text a la RFC 2646. This is useful for composing email in Emacs. For example, if you use a separate email client and emacsclient as your editor, add this and (add-hook ‘server-switch-hook ‘flow-encode-buffer) to your .emacs to encode your emails as flowed text automatically. (defgroup flow-fill nil “Decoding […]
Standard

emacs special-display-function: prefer-other-visible-frame

Emacs’s support for special buffer frames, specifically the special-display-function variable and friends, let you customize the way Emacs chooses a window and buffer for new frames that are displayed via display-buffer. Here’s Elisp code you can use as special-display-function that prefers existing windows and frames, as opposed to splitting the current window and frame, but […]
Standard
Uncategorized

Filling code in Emacs

Emacs is great, but one of my pet peeves is that while it can fill (ie wrap) plain text, it can’t fill source code. I’ve recently been working on fillcode, an Emacs minor mode that does this. It’s best described by example. Fillcode fills this: public static void foo(int i, float f, String s) { […]
Standard

why I don’t run shells inside Emacs

This article describes my first attempt at running shells inside Emacs, which didn’t work out. I tried again recently, and I think I’m going to stick with it, so this is preserved for posterity only! When I’m working, I pretty much live inside Emacs. It’s my IDE, debugger, text editor, email composer, spreadsheet, file manager, […]
Standard

emacs X resources

I do most of my Emacs customization in my .emacs file. However, Emacs starts itself and creates an X11 window before it reads the .emacs file. So, customizations that affect the window itself are very expensive, since they’re applied after the window is created. A few of these customizations include turning the menu bar, toolbar, […]
Standard

emacs keybindings with number keys

I use GNU Emacs, and I love it. However, I had trouble recently when I tried to re-bind C-1 to do something new. Executive summary? Do this: (global-set-key [(control \1)] ‘foo) Note the escaped 1. Evidently this keystroke syntax interprets numeric arguments as key ids, or something, instead of the key’s actual character. So, to […]
Standard