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

Re: [Sheflug] Emacs - formatting and dating files.



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

    Barrie> If it is a .tcl file, tcl mode is started by Emacs, and
    Barrie> the response is t.

OK.  When you start up a fresh Emacs, what does C-h v "tcl-mode-map"
RET tell you?  If it actually gives information, just comment out
(semicolon-to-end-of-line comments, you've probably figured that out
by now) the "(require 'tcl)" line, and try again.

If it says "no such variable" or similar, visit a .tcl file, and see
if M-: "(featurep 'tcl-mode)" RET says t.  If so, change the "(require
'tcl)" line to "(require 'tcl-mode)" and try again.

If that doesn't work, what does C-h f "tcl-mode" RET tell you about
where the `tcl-mode' function is loaded from?  Change the "require"
line to "(load-library THAT-FILE)".

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

    Barrie>  Oh, and one last thing... :-)

    Barrie>  How do I get comments to wrap correctly in tcl mode?

    Barrie> auto-fill-mode wraps most things...

    Barrie> Can I limit it to lines that start with '#' - i.e. the
    Barrie> comments?

This is that "mixed-mode" thing I was talking about.  It's not going
to work very well.  First, try M-x "filladapt-mode" RET.  If that
doesn't work, go to http://www.wonderworks.com/ and get the filladapt
package.  It's much smarter than the base auto-fill-mode about
indentation and prefixes (eg, //-style comment to end of line vs. /*
.. */ bracket-style comments, numbered sections with hanging indent,
etc).  This may be good enough for government work.  In particular, I
use it for python and sh scripts for exactly the purpose you're
talking about.  It will screw you up if you set the right margin much
less than the width of code you can tolerate, because lots of code
lines will auto-wrap in awkward ways.  But if you rarely need code
lines extending past the comment right margin, you win big.

While you're there, get c-comment-edit.  I don't know if it will work
at all for Tcl (probably not), but it does exactly what you want for
C; filladapt doesn't do this well (it knows a lot about prefixes, ie,
the left margin, not much about nesting structure -- that's why it
wins big with python, because they're the same by definition).  Some
of the other packages there may be of interest, including setnu.

-- 
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.