M-x all-things-emacs

Entries Tagged as 'tips'

Newbie Tip: transient-mark-mode

February 20th, 2007 by Ryan McGeary · 5 Comments

Setting a mark (C-SPC) is probably the most frequent command I use besides basic navigation. The mark not only acts as a saved jump-to point, but it also sets the region. A region is what other editors might call a selection. By default, emacs does not highlight the active region, so it [...]

[Read more →]

Tags:newbie · quick · tips

Emacs, JDEE, Ant, and the Eclipse Java Compiler

February 13th, 2007 by Rob Christie · 3 Comments

This post describes how to integrate jdee, ant, and the eclipse batch compiler to get the same warning and error messages as your Eclipse-loving friends. I am assuming that you already know your way around the jdee environment (i.e., you have it setup and configured such that you can run an ant build from within [...]

[Read more →]

Tags:java · tips

Quick Tip: Defining Mode Specific Key Bindings

February 10th, 2007 by Rob Christie · 3 Comments

Many times I use global key mappings for commands that I use every day. For example, I build java projects daily using ant, so I have the following in my .emacs:

(global-set-key [f5] ‘jde-build)

Less frequently, I use the C-c C-v C-. which is the default key binding for the command jde-complete. Both commands are in [...]

[Read more →]

Tags:elisp · java · quick · ruby · tips

Quick Tip: dired-recursive-deletes

February 8th, 2007 by Ryan McGeary · 3 Comments

By default, dired only deletes empty directories. You know the drill. Put your point on the directory, D, y (yes), “file-error Removing directory directory not empty,” (slam fist on table). Doh!

Fortunately, dired supports deleting directories recursively. Add this to your .emacs:

(setq dired-recursive-deletes ‘top)

The dired-recursive-deletes variable decides whether recursive deletes are allowed. [...]

[Read more →]

Tags:dired · quick · tips

Quick Tip: visible-bell

February 6th, 2007 by Ryan McGeary · 3 Comments

This one is personal preference, but I find it annoying when emacs beeps on errors. I like knowing when something bad/unexpected happened, but the beep is too much when the sound is on and useless when muted. Add this to your .emacs to enable a visual alert cue that flashes the frame instead:

(setq [...]

[Read more →]

Tags:quick · tips

Newbie Tip: y-or-n-p and Function Aliases

February 3rd, 2007 by Ryan McGeary · 3 Comments

Part of the reason we started M-x all-things-emacs was to encourage newcomers to the emacs world. The emacs learning curve is a steep one, and sometimes it’s easy for the more advanced members of the contingent to take some of the basics for granted. This is the first of a series of [...]

[Read more →]

Tags:newbie · tips

Maximize on Startup, Part 1

January 29th, 2007 by Ryan McGeary · 10 Comments

This is part one of a two-part series. Here we’ll discuss some straight forward options for maximizing and resizing the emacs window on startup. In part two, we’ll explore a more advanced alternative.

I like to maximize my emacs window (aka frame) to fit the entire screen when I really want to focus on [...]

[Read more →]

Tags:elisp · osx · tips · windows · x

Keyboard Macros in the Wild #1

January 26th, 2007 by Rob Christie · 4 Comments

This is the first in a series of real world uses of emacs keyboard macros. Emacs macros are normally mentioned as a powerful feature of emacs, but many times I find the examples that are given are more academic in nature and don’t drive home their usefulness. These posts will show examples of macros “in [...]

[Read more →]

Tags:java · kb-macros · tips

Find Lost Neurons

January 23rd, 2007 by Ryan McGeary · 2 Comments

After years of emacs usage, sometimes I feel like my fingers get ahead of me. The esoteric set of key combinations are an extension of my subconscious. Maybe my cerebellum short circuits the impulses from my frontal lobe, but when I’m asked how I perform a particular task in emacs, often I cannot [...]

[Read more →]

Tags:tips

Indent Whole Buffer

January 17th, 2007 by Rob Christie · 1 Comment

I use this function almost daily. Why? Well, it’s because too many developers use editors that muck the alignment of the source.

1
2
3
4
5
6
(defun iwb () "indent whole buffer" (interactive) (delete-trailing-whitespace) (indent-region (point-min) (point-max) nil) (untabify (point-min) (point-max)))

Open a file, M-x iwb, save, commit, and edit happily.

I can’t take credit for it, [...]

[Read more →]

Tags:elisp · tips