[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Emacs - formatting and dating files.



Hi everyone.

 Excuse the lack of wrapping on this post, I'm trying to make sure it looks the same on my screen as everyone elses for this one...

 I've a couple of (hopefully quick) questions on how to get Emacs to do a couple of things.

 There seem to be rather a few different modes in Emacs...
 I've had a look at a few folks .emacs files, skimmed across the manual etc,etc, but all I want to know is:

(a) how do I get Emacs to insert something along the lines of 

"created DD-MM-YYYY HH:MI last modified DD-MM-YYYY HH:MM" 
(where the letters stand for the obvious) for tracking source code mods etc.

and

(b) How do I configure how Emacs indents text when I press the tab key..

 For example, in Tcl mode, I might type some SQL queries that I want formatted a particular way.
 Emacs as I have it set at the moment (pretty default) will just mash everything to the left.
 Tab doesn't even respond, unless I'm in the middle of a Tcl if/else/elseif section.

I'd like to be able to indent like so:


if { condition }{
          set sql_query "select user_id, count(*) as how_many
			 from bboard
			 where posting_time + 60 > sysdate
			 group by user_id
			 having not exists (select 1 from 
                  		bboard_authorized_maintainers bam
              		    	where bam.user_id = bboard.user_id)
			order by how_many desc"
}


At the moment, the only lines Emacs will indent using tab is the set sql_query[...] line, since it recognises the 'if' keyword.
All the rest is done with the space bar, and it's a pain!

Cheers.

Baz.
--
Barrie J. Bremner

TheEnglishman [at] ecosse.net | OpenPGP public key ID: 5164F553
	    http://www.geocities.com/thefatenglishman
	    [Contact information available at website]

   "Linux? Is that some kind of MacOS?"
      -- BT technical support
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.