Misc Stuff


Search and Replace

There are several types of search and replace:

Some Misc Text Manipulation

Bookmarks

Emacs bookmarks are software bookmarks that mark a location in a file and save it so you can return to that location after an arbitrary period of time...even if you leave Emacs. To use bookmarks:

Line and Column Numbers

"C-x l" will report line location and "C-x =" gives the column location of your cursor.

Comment Region

In certain modes, one is given the capability to comment regions. The exact keystrokes may depend on the mode you are in. Look at mode-specific menu items for details.

Quoting Characters...Whatever That Means

In order to access escape and control character and sequences, one can use something called "quoted-insert", bound to "C-q". The next character after a "C-q" will be inserted. Up to three octal digits can also be entered.

Backup Files

Backup files are created by Emacs when you make changes and are called the same filename but with a "~" appended at the end of the filename. To make versioned backups (a la VMS), stoke your "~/.emacs" file with this beauty:

(setq version-control t) ; Allow numbered backups

Restoring Changes When the System Goes Down

As you merrily edit your file, Emacs saves changes periodically into a file that is the same name as the one you are editing, but with "#" signs in the beginning and end. Should your system meet face-to-face with the dark side (ie, crash and burn), your latest changes will be in this file.

To recover these changes, you use the command "recover-file" and give it your filename. Skippy!

Color Syntax Highlighting

To enable color syntax highlighting in Emacs, place the following in your startup file:

; Turn on font-lock in all modes that support it
(if (fboundp 'global-font-lock-mode)
    (global-font-lock-mode t))

; Maximum colors
(setq font-lock-maximum-decoration t)

Finding Matching Brace

Whan you are "on" a brace and want to find the matching one, use "M-C-f" and "M-C-b" to find them in a forward and backward direction, respectively.

Tags - Finding Stuff in Source Code

Emacs has a concept of etags - a way to mark source code files so that you can jump to the exact location of a function in a file not necessarily open yet. To use it, do the following: Beginning | Previous
Last updated $Date: 1997/04/11 03:46:11 $.