Emacs Notes

Tabs in emacs

You may want to use the sql-postgres or sql-oracle mode (meta-x sql-postgres) to cut and paste directly into psql. That's my preferred way of doing things.

However, one thing that has bit me before in the past is that if you have tabs in your data model, and copy them into the sql-postgres or sql-oracle buffer, the tabs trip up the parser. Stupid, but they do.

Solution? Put this in your .emacs file:

(setq-default indent-tabs-mode nil)
Thanks to jim and daveb on IRC.

Also, to remove tabs from a file, select it (ctrl-space at beginning, go to end, then)

M-x untabify return

Retitle your emacs windows

Put this in your .emacs file:
; retitle emacs window
(defun frame-retitle (title)

;; set a beautiful title bar
(setq frame-title-format
'("%S: " (buffer-file-name "%f"
(dired-directory dired-directory "%b"))))
Thanks to jim from IRC

Regular expression search and replace


MMM mode and more neato tricks

I haven't looked at this yet, but it seems really helpful:


Macros for emacs


This page describes how to save the macros you develop.

CVS commands in emacs


sql-postgres and sql-oracle

collection of tips for sql-oracle and sql-postgres modes

Advanced tips for Emacs users

Incredibly useful: Xah

Fixing backspace problems

Courtesy of Walter McGinnis:
I have a variant problem and solution for the bad backspace problem in emacs on a remote machine. David Hill and I started using xxx.xxx.net remotely through Mac OS X's term.app and ssh recently and discovered that the delete key wasn't working as expected in emacs (it was fine at the command line).

After much investigation, here's what works:

  1. under the Terminal Menu > Windows Settings > Emulation check ''delete key sends backspace'', this will take care of single character backwards delete, without changing the expected behavior of ctrl-d or meta-d
  2. add this to your .emacs file, to take care of meta-delete mapping to backward-kill-word (i.e. deleting the last word).
    ;; make sure that meta-delete is bound to backward-kill-word
    ;; assumes that you have set emulation to "delete sends backspace"
    ;; as mentioned above
    (keyboard-translate ?\C-? ?\d)