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

[Sheflug] Emacs - formatting and dating files.



>>>>> "Barrie" == Barrie Bremner <TheEnglishman [at] ecosse.net> writes:

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

Looks very lame on mine, trailing of the edge of the screen that
way....  Netscape mail?  Just Say No.  Heed the author's warning:

	       http://www.jwz.org/doc/html-compose.html

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

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

AFAIK there's no general facility.  Most Emacs users use either CVS or
RCS, and they use the $Id$ keyword for this purpose.  In HTML you can
use hm--html-menus and get exactly the effect you want.

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

    Barrie>  For example, in Tcl mode, I might type some SQL queries
    Barrie> that I want formatted a particular way.

This is "mixed-mode" operation, and it's basically not available
unless you create special submodes.  I have some ideas about how to
make it work, but this will take some years before it's generally
available (it's pure vapor now).

    Barrie>  Tab doesn't even respond, unless I'm in the middle of a
    Barrie> Tcl if/else/elseif section.

This is a Tcl-mode bug.  Use python ;-)

To insert a literal TAB character, use C-q TAB.

Given the format eg you showed, you probably use tab a lot, and in
fact you probably use it more for SQL than for Tcl.  You could do the
following in .emacs:

(if t                   ; change `t' to `nil' to turn this off
    (progn
     (require 'tcl)
     (define-key tcl-mode-map [(tab)]       'self-insert-command)
     (define-key tcl-mode-map [(shift tab)] 'tcl-indent-command)))

Swapping that so that TAB does a Tcl indent and Shift-TAB inserts a
literal TAB character is harder.  (C-TAB and M-TAB usually have
commands bound to them already, so I don't want to use them.)

Use M-x untabify to turn literal tabs into spaces, and M-x tabify to
"compress" the file by using literal tabs wherever possible.


-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."
---------------------------------------------------------------------
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.