Emacs - Undo

Roll It Back


I find undo a real help when I'm typing fast, editing and trying different things. Often I make simple mistakes and move on or retype an error. Hitting undo is such a fast way to go back.

There are a number of keys that "undo" your last "do". I use Ctrl-/.

Its fast, easily accessible and so convenient.

A feature of undo you may not know about is "undoing" your "undo".

If you keep pressing Ctrl-/ it will get to the end of your present undo cycle and start to cycle back to your very first action. This is great. You can test different text or code see how it looks and if you feel it sucks, just cycle through undo till it recalls its original state.

A key combo I use with undo is Ctrl-g, the keyboard quit command. If you cycle through undo and find its cycling back too far, hit Ctrl-g, then hit Ctrl-/. Undo will start to cycle forward. If you hit Ctrl-g, then hit Ctrl-/ again, undo will stop and cycle in the opposite direction.

Mess around with it, and see for yourself how powerful it is. Its a great tool.

Done!

Emacs Tips - Tab To Complete

Finish It


You may or may not know, when your in the mini-buffer, you can use Tab to finish your input.

Emacs will try to guess what your after and offer a few suggestions. If your trying to load a file from your home dir, you can do:

Ctrl-x Ctrl-f Start-of-Filename Tab

As long as the file name is unique, Emacs will open it for you. If its not unique, Emacs will open a buffer and display your options. Then you can either type more characters to identify the file you want, or mouse select it (boo hiss - don't use the mouse). If you can stick to the keyboard, you'll be way faster and more productive.

Give it a try.

Done!

Emacs - Loading Elisp .el Files

Load 'Em Up


You will find a ton of customized Emacs Elisp files on the Net.

Getting Emacs to recognise and load these files is simple. Create a directory in your home dir. Call it whatever you like, but something relevant such as "elisp" is good.

After creating the directory we need to let Emacs know where it is and what its called.

Open your .emacs config file. This is normally located in your home directory. It may be hidden.

You can open and edit it in Emacs:

Ctrl-x Ctrl-f

Hit enter to get a list or type .emacs

Edit your .emacs file and add the path to your new directory:

; Tell Emacs where elisp .el files reside and load
(add-to-list 'load-path "~/elisp")

Add this near the start of your .emacs file before you start loading .el files.

Emacs now knows where the files reside. Start dumping your .el files in that directory.

When you want to use a new .el file, edit .emacs and add the name of the .el file. If I download "fancy.el", I tell Emacs to load it at startup:

(require 'fancy)

Don't add the .el extension, just the name of the file.

Done!

Emacs - Delete To Start Of Line

Kill To Start


Emacs does not have a kill-to-start-of-line key-combo or built-in function.

There are a number of ways round this very minor problem.

1. Use Ctrl-a Ctrl-k

Ctrl-a moves to start of current line.
Ctrl-k kills to end of current line.

2. Use Ctrl-0 (zero) Ctrl-k

Ctrl-0 sends to point to zero char on the line.
Ctrl-k kills to end of current line.

3. Define a function, then bind it to unused keys.

(define kill-start-of-line ()
"kill from point to start of line"
(interactive)
(kill-line 0)
)

Bind it to Ctrl-; right next to Ctrl-k.

(define-set-key (kbd "C-;") 'kill-start-of-line)

When you press Ctrl-; emacs deletes from cursor position to start of current line.

Done.

Windows 7 Media Player Network Sharing Service

Stop That Share

Windows 7 Media Player Network Sharing Service, is an unneeded resource hog. It runs as a background process using CPU cycles and hogging system RAM.

Its exists to "share Windows Media Player libraries with other networked players and media devices".

If you find you don't need to share your Windows Media Player libraries over the network, you can safely kill this process and speed up your machine. Here's how:

Click Start > type 'Run' into the search box at the bottom > type services.msc into the dialogue box the opens.

A window opens that displays the services running on your machine. Scroll down till you get to "Windows Media Player Network Sharing Service" and double click.

Windows Media Player Network Sharing Service properties box opens. Click 'Stop'. This will kill the service.

Click the 'Startup Type' drop down menu and select disabled.

Windows Media Player Network Sharing Service has completely stopped and will not re-start unless you change these settings.

Done!

Windows 7 Search Indexer

Stop The Search


Windows 7 has a persistent search indexer running as a background process, continuously recording info on the files located on your computer. This gets dumped into the search index to speed up your next search.

I rarely use Windows 7 search. I have used it once in the last 2 months. I feel I don't need a search index being updated 24/7, so I killed it. Here's how:

Click Start > type 'Run' into the search box at the bottom > type services.msc into the dialogue box the opens.

A window opens that displays the services running on your machine. Scroll down till you get to "Windows Search" and double click.

Windows Search properties box opens. Click 'Stop'. This will kill the service.

Click the 'Startup Type' drop down menu and select disabled.

Search has completely stopped and will not re-start unless you change these settings.

Done!


Google Chrome

It Shines


I have been using Google's Chrome browser for more than a year and I am most impressed. I used Firefox for several years, till I switched to Chrome when it hit the download servers.

Its extremely fast, stable and the interface is slick 'n' easy to use.

To date, I have not had Chrome lock up or crash on me, though one of the tabs went into a loop and hogged CPU cycles for a while, before I closed that tab.

Chrome seems to improve with each release.

One thing I disliked about Chrome, was the lack of an ad-blocker. That has now been fixed. For a while, I ran Chrome with a host file filtering ad sites. A plug-in is available to do the job.

Chrome works well with Google Mail.

Recent stats suggest Chrome has 5% market share, beating Apple's Safari into 4th spot.

I use Chrome on both Linux and Windows.

If you haven't tried it yet, give it a shot. You might like it.