M-x all-things-emacs

Entries Tagged as 'elisp'

Tab Completion Everywhere

March 12th, 2007 by Ryan McGeary · 7 Comments

I am addicted to tab completion in the minibuffer and in shells like bash — so much so that I want it everywhere. By default, emacs comes with dabbrev-expand (bound to M-/). When invoked after typing the first few letters of a word, dabbrev-expand first searches the current buffer and then other [...]

[Read more →]

Tags:elisp · tips

Quick Tip: Add occur to isearch

February 27th, 2007 by Ryan McGeary · 9 Comments

Zenspider gives us an excellent tip for extending incremental search. Add this to your emacs initialization:

1
2
3
4
5
6
(define-key isearch-mode-map (kbd "C-o") (lambda () (interactive) (let ((case-fold-search isearch-case-fold-search)) (occur (if isearch-regexp isearch-string [...]

[Read more →]

Tags:elisp · isearch · quick · tips

Maximize on Startup, Part 2

February 22nd, 2007 by Ryan McGeary · 31 Comments

In part 1 of the series, we discussed two ways to resize the emacs frame on startup. Here, we will use the display-pixel-width and display-pixel-height functions to automatically determine the proper size of the emacs frame.

Option 3 (the package)

As I tried to come up with a generic way to maximize the emacs frame on [...]

[Read more →]

Tags:elisp · osx · tips · windows · x

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

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

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