Emacs : Information and code concerning Emacs
Updated: 3/3/2003; 8:35:39 AM.

 

Subscribe to "Emacs" 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 04, 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    

© Copyright 2003 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