Tom Pierce's Blog : Let the geek times roll.
Updated: 6/20/04; 3:03:44 PM.

 

Subscribe to "Tom Pierce's Blog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Tuesday, February 4, 2003

The project that I'm currently on demands that I write alot of SQL.  The architect for the project chose a naming standard that includes putting the "_" character between words in a variable, column, or table name.  For example "Amount Type" would become "amt_type". 

Under normal conditions, Emacs treats "_" as a non-word consituent character.  This means that when you move forward a word over "amt_type" you would have to execute forward-word twice.  This is a pain when there are ALOT of words that have the "_" as part of the word.

So, an easy hack for this project is to make "_" a word constituent character.  You can do this by evaluating:

(modify-syntax-entry ?_ "w" sql-mode-syntax-table)

This can be in your .emacs file or you can simply evaluate it in the *scratch* buffer (or run ESC-:).  From that point on, you can forward-word over the entire variable named "trans_amt_in_your_face_forward_word".


10:06:01 AM    comment []

© Copyright 2004 Tom Pierce.



Click here to visit the Radio UserLand website.

 


February 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28  
Jan   Mar

Search

[sgl dagger]
How this works

Emacs Sources
 tsql-indent.el
 user-add-sql-folding-marks
 remove-line-boundary-in-region
 convert-camel-to-underscore

My Subscriptions
 Funny
 KM