Handy Emacs Gadgets
Here is a collection of emacs gadgets i've developed over time, to make my life in emacs easier/better/more all around sparkly:-) They range in application, size, and scope, and aren't arranged in no any particular order.
You can use them by putting the files in a directory on your emacs load-path, or for the small ones you can just put them right in your .emacs init file.
The customary way to include them on your load-path starts with setting aside a directory of your own for the purpose, eg "~/lib/emacs", and using a bit of code in your .emacs to include the contents of that directory on your emacs sessions' load-path, eg:
(setq load-path (cons (expand-file-name "~/lib/emacs") load-path))
Then files in that directory will be found for (load) and
(require) commands, and the like.
The format below is a description list with a link to the code followed by a brief description and then suggested .emacs code to hook it up.
- PDBTrack
- Have emacs step through the source files whenever you run the python
pdb debugger within an emacs shell-interaction (and python-interaction)
buffer. This works with Zope's command-prompt debug mode, as well as the
standard python pdb sessions.
As of python 2.1, python-mode.el incorporates pdbtrack functionality. If you're not up to python 2.1, you can get the standalone copy of current python-mode.el (with pdbtrack) .
- **poptoshell.el**
- Convenience for keybinding to
start or pop to already-running shell-interaction
buffer:
(autoload 'pop-to-shell "poptoshell")
(global-set-key "\M- " 'pop-to-shell) - **copy-line-as-kill**
- Copy line instead of deleting:
(autoload 'copy-line-as-kill "copylineaskill")
(define-key esc-map "k" 'copy-line-as-kill) - **vccheckin.el**
- Arrange the VC checkin screen
with 2/3 diff and 1/3 log-entry buffer:
(require 'vc)
(define-key vc-prefix-map " " 'arrange-vc-checkin-screen) - **outdent.el**
- Indentation-based outline exposure and
maneuvering.
The "add-hook" makes outdent mode active along with python mode, for python buffers.
(autoload 'outdent-mode "outdent")
(add-hook 'python-mode-hook 'outdent-mode) - **namedmarks.el**
- Per-buffer marks referred to
by name, with completion:
(autoload 'nm:set-mark-command "namedmarks") <br> (autoload 'nm:goto-mark "namedmarks") <br> (substitute-key-definition 'set-mark-command 'nm:set-mark-command global-map)<br> (substitute-key-definition 'exchange-point-and-mark 'nm:goto-mark global-map) - icomplete.el
- Spiffy mode-line completion
enhancement, part of emacs distributions:
(icomplete-mode)
- allout.el
- An alternate version of Emacs outline mode on
steroids. Part of emacs distribution.
Once it's loaded, try it out in a buffer with the
Meta-:command(outline-mode), and check the mode help using^Hm(require 'allout)