comp.lang.ada
 help / color / mirror / Atom feed
From: Mattias Sj�sv�rd <qhsmasd@aom.ericsson.se>
Subject: Re: Emacs Ada-Mode
Date: 1998/05/22
Date: 1998-05-22T00:00:00+00:00	[thread overview]
Message-ID: <35654CD9.316C@aom.ericsson.se> (raw)
In-Reply-To: 35693157.3762034@news.geccs.gecm.com


Brian Orpin wrote:

> It still doesn't align elements in a record declaration (where all this
> started).  :-((
> 

I have a small lisp utility that might help; dwimtab (see doc later
in this posting). It doesn't automagically line up record declarations,
but it's a step on the way. I've used it in C, C++, Java and Ada mode. 
Mail me if you want the source.

/Sj�sv�rd

Doc best viewed with fixed width font (apologies for examples in 
C; I work in a multilingual environment! :)

Do-What-I-Mean tab. This function uses the original keybinding for the
TAB key when it is used (e.g. c-indent-line). If this does not change
the position of the point, an attempt is made to position the point
under the next 'interesting' point in the first non-blank line above
the current line. An interesting point is a start of a new column
(signified by multiple whitespace), a ':' or a '='. If no interesting
point is found, a tab-to-tab-stop is performed. This sounds weird but
it is of good use if one wants to line up declarations like:

  VeryLongTypeName  VeryLongVariableName = VERY_LONG_CONSTANT;
  int               Count                = 0;
  char *            Str                  = (char *)NULL;

A single TAB is required between ('int' - 'Count'), ('Count' - '=')
etc.  To add this feature to your favourite major mode (e.g. c-mode),
put this file in your load path, compile it and place this in your
.emacs:

(autoload 'dwimtab-tab "dwimtab")
(add-hook 'c-mode-hook 
  (lambda () (define-key c-mode-map "\t" 'dwimtab-tab)))




  parent reply	other threads:[~1998-05-22  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <356680b9.18964466@news.geccs.gecm.com>
1998-05-19  0:00 ` Emacs Ada-Mode Philippe Waroquiers
     [not found]   ` <356283c4.2281076@news.geccs.gecm.com>
1998-05-20  0:00     ` John McCabe
1998-05-20  0:00   ` Scott Evans
1998-05-19  0:00 ` David C. Hoos, Sr.
1998-05-19  0:00   ` David  Weller
1998-05-19  0:00   ` John McCabe
1998-05-21  0:00 ` Simon Wright
     [not found]   ` <35693157.3762034@news.geccs.gecm.com>
1998-05-22  0:00     ` Mattias Sj�sv�rd [this message]
1998-05-26  0:00   ` Stephen.leake
1998-05-26  0:00 ` Matthew Heaney
2006-08-18 12:07 Emacs ada-mode Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox