Monday, July 28, 2008

regexp




Text Pattern Matching in Emacs

Common Patterns:


Pattern Matches
-----------------------------------
. any single character
\. one period

[0-9]+ digit sequence
[A-Za-z]+ sequence of letters
[_A-Za-z0-9]+ sequence of alphanumeric char and underscore
[-A-Za-z0-9]+ sequence of alphanumeric char and hyphen
[[:blank:]]+ sequence of tabs and spaces

"\([^"]+\)" capture text between double quotes

+ means match previous pattern 1 or more times
* means match previous pattern 0 or more times
? means match previous pattern 0 or 1 time



Also:


M-x regexp-builder



Saturday, July 26, 2008

log commands




Log all the commands you type to a buffer with mwe-log-commands.el. Very handy when you're making an Emacs screencast.



Friday, July 25, 2008

regexp




M-x query-replace-regexp


199\([0-9]\)$



9\1)


Was very useful today.


Wednesday, July 23, 2008

org-mode




Although I'm a big fan of planner-mode and use it daily, I reccently saw the Google Tech Talk about org-mode and really like some of the things it does.

One of these is the ability to have a hierarchy in tasks so that you can have one main task, and a bunch of sub-tasks that all need to be done to finish the main task. You can sort of do this in planner-mode by having different files, but not really.

Some links:

org-mode Documentation
Tutorials
Linux Journal article about org-mode
A big org-mode tutorial
An org-mode screencast
Outlining your notes with Org by Sacha Chua



Sunday, July 20, 2008

firefox and emacsclient




Sadly, mozex isn't working anymore for Firefox 3.0. I was looking at hacking it to make it work, and make it work better with Emacs, but then I found:

about:config view_source.editor.path

Unfortunately, this didn't seem to work with my emacsclient setup, until I found:

Emacs as default View Page Source / Greasemonkey editor in Firefox on Windows which tells us that Firefox will only accept a path as an argument to view_source.editor.path, no flags are allowed.

So, I just editted my "firefox-emacsclient" script to look like this:


#!/bin/sh
/usr/sness/emacs/bin/emacsclient -c -n -s sness $1


Then set:


view_source.editor.external true
view_source.editor.path firefox-emacsclient


and I can get beautiful source code viewed in Emacs. Nice.




Saturday, July 5, 2008

create a buffer




To create a new buffer:


'C-x b BUFFER <RET>'
Select or create a buffer named BUFFER ('switch-to-buffer').


This is useful for when you accidentally delete your *scratch* buffer and don't want to restart your emacs process just to create a new one.