[comp.lang.eiffel] Code for new GNU Emacs Eiffel mode with better indenting

weiner@novavax.UUCP (Greg Horne) (02/08/90)

Each file in the following shar archive explains itself.  All mods to
Eiffel mode since my last public release are also documented.
'eif-indent.el' lets you reindent all of ISE's library and example
classes to please the eye.  You will then need to recompile all the
classes because of the automatic compilation update mechanism.
------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  eiffel.el eif-mult-fmt.el eif-indent.el
# Wrapped by weiner@ar_weiner on Tue Feb  6 18:49:24 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'eiffel.el' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'eiffel.el'\"
else
echo shar: Extracting \"'eiffel.el'\" \(32296 characters\)
sed "s/^X//" >'eiffel.el' <<'END_OF_FILE'
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cut Here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;!emacs
X;;
X;; FILE:         eiffel.el
X;; SUMMARY:      Major mode for editing Eiffel code.
X;; USAGE:        GNU Emacs Lisp Library
X;;
X;; AUTHOR:       Stephen M. Omohundro / Bob Weiner / ISE
X;; ORG:          Internat. Computer Science Inst. / Motorola / ISE
X;; E-MAIL:       USENET:  om@icsi.berkeley.edu / weiner@novavax.UUCP / eiffel@eiffel.com
X;;
X;; ORIG-DATE:    26-May-89
X;; LAST-MOD:      6-Feb-90 at 18:43:30 by Bob Weiner
X;;
X;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. and Bob Weiner
X;; Available for use and distribution under the same terms as GNU Emacs.
X;;
X;; This file is not yet part of GNU Emacs.
X;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;
X;; MOD HISTORY:
X;;
X;; Interactive Software Engineering
X;; eiffel@eiffel.com
X;; Date: November 15, 1989
X;;    Updated to Eiffel 2.2 Syntax
X;;
X;; Eiffel 2.2 keywords: 
X;;
X;; and as check class debug deferred define div do else elsif end ensure
X;; expanded export external false feature from indexing if implies infix
X;; inherit inspect invariant is language like local loop mod name not
X;; obsolete old once or prefix redefine rename repeat require rescue retry
X;; then true unique until variant when xor
X;;
X;; 
X;; Bob Weiner, Motorola Inc., 9/25/89
X;;  Added comment variables so comment filling is done properly with par-align.el.
X;;  Added a few keywords to the mode-specific abbrev table.
X;; Bob Weiner, 10/12/89
X;;  Added "indexing" keyword and 'eiffel-indices' list for default entries.
X;; Bob Weiner, 11/29/89
X;;  Added local documentation standard headers.
X;;  Added a few keybindings to insert other Eiffel construct templates.
X;;  Fixed mode-specific variable settings for comments.
X;; Bob Weiner, 12/01/89
X;;  Fixed many indentation problems.  'rename', 'redefine', and 'define'
X;;    clauses are indented very intelligently now.  Made each tabstop much
X;;    narrower than ISE's conventions which leads to much more readable code
X;;    that fits in 80 columns much more often also!
X;; Bob Weiner, 12/01/89
X;;  Added 'eiffel-line-type' command to show programmer the type of the
X;;    current line.
X;;  Improved comment indentation; more context sensitivity.
X;;
X;; LAST PUBLIC RELEASE = 12/10/89
X;;
X;; Bob Weiner, 12/22/89
X;;  Modified 'eiffel-class' to once again extract class name for insertion
X;;    from the file name.
X;; Bob Weiner, 12/28/89
X;;  Modified 'e-comment-indent' to indent intial attribute comments the same
X;;    as initial routine comments.
X;;  Removed "OUTPUTS" from 'eiffel-moto-procedure-hdrs' list since procedures
X;;    have no outputs.
X;; Bob Weiner, 1/3/90
X;;  Modified e-goto-block-head to handle single line manifest constant
X;;    properly.
X;; Bob Weiner, 1/5/90
X;;  Added completion when prompted for an Eiffel type name when inserting an
X;;    Eiffel template.  Only effective when my 'eif-lib' package is available.
X;; Bob Weiner, 01/16/90
X;;  Modified 'eiffel-set' to put attribute name as leading part of
X;;    procedure name.  This way, when features are alphabetized, 'set'
X;;    procedures stay next to the attributes they set.  Also made this function
X;;    insert a generic doc string.
X;; Bob Weiner, 01/18/90
X;;  Fixed an indentation bug in 'e-get-block-indent' when a block "end"
X;;    clause is preceded on the same line by other clauses.
X;;  Fixed problem in 'e-calc-indent' with qualifier clause indentation when
X;;    'end' keyword terminates same line that qualifier is on.  Fixed related
X;;    problem of indenting lines within a 'debug' qualifier too far.
X;;  Left qualifier indentation so that it indents one more tab stop than
X;;    other lines at the same block level.  This sets qualifier blocks off from
X;;    the rest of the code nicely.
X;; Bob Weiner, 02/02/90
X;;  Fixed problems with 'e-ends-with-is' returning t for comment lines that
X;;    end with is and not matching to manifest constant definition lines since
X;;    the constant value follows the is.
X;;  Corrected and beefed up character syntax table.
X;;  Made indentation within parentheses work properly for routine invocations.
X;;  Made indentation within double quotes work properly.
X;;  Made indentation of 'language' keyword one indentation beyond start of
X;;    external routine declaration.
X;;  Added 'eiffel-mode-variables' function invoked by 'eiffel-mode'.
X;;  Added {C-c \} key bound to 'eiffel-delim-string' which puts '\'
X;;    delimiters around a multi-line quoted string that point is within.
X;;  Added var 'eiffel-indent-args-str' to control whether to comput nice
X;;    indentation for multi-line arguments lists and strings.
X;;  Added 'eiffel-indent-assign' to properly indent assignment statement
X;;    continuations.
X;;  Added keybindings:
X;;    {C-M-a}      'eiffel-beginning-of-feature'
X;;    {C-M-e}      'eiffel-end-of-feature'
X;;    {C-M-h}      'eiffel-mark-feature'
X;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;
X;; What is missing?
X;;
X;;   2. Checking of correctness in the eiffel-elsif and eiffel-when
X;;      functions.
X;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;
X;; DESCRIPTION:  
X;;
X;; The following two statements, placed in a .emacs file or site-init.el,
X;; will cause this file to be autoloaded, and eiffel-mode invoked, when
X;; visiting .e files:
X;;
X;;      (autoload 'eiffel-mode "eiffel.el" "Eiffel mode" t nil)
X;;      (setq auto-mode-alist
X;;            (append
X;;              (list (cons "\\.e$" 'eiffel-mode))
X;;              auto-mode-alist))
X;;
X;; DESCRIP-END.
X
X;; Used to format multiple lines between parens and double quotes.
X(require 'eif-mult-fmt)
X
X
X;; SET THE FOLLOWING VALUE TO TASTE.  TRY IT AND THEN ALTER AS NECESSARY.
X;; IF t, AFFECTS class, function, procedure, and attribute TEMPLATES.
X;; ALL OF THE ADDITIONAL HEADER INFORMATION IS GENERALLY USEFUL, NOT MOTOROLA
X;; SPECIFIC.
X(defvar eiffel-moto-hdr-p t
X  "If t, use our Motorola developed Eiffel construct template headers.")
X
X;; These are used only if the above setting it t.
X(defconst eiffel-moto-procedure-hdrs
X  '("EFFECTS" "INPUTS" "MODIFIES" "SIGNALS" "INTERNAL"))
X(defconst eiffel-moto-function-hdrs
X  '("RETURNS" "INPUTS" "OUTPUTS" "MODIFIES" "SIGNALS" "INTERNAL"))
X(defconst eiffel-moto-attribute-hdrs
X  '("RETURNS" "SIGNALS" "INTERNAL"))
X
X(defconst eiffel-indent-args-str t
X  "If t, do involved calculations to indent multi-line argument lists and
Xmulti-line double quoted strings nicely.  Nil value makes indentation faster
Xand uglier.")
X
X(defconst eiffel-indices
X  '("names: " "keywords: " "representation: " "access: " "size: " "contents: ") 
X  "Indexing criteria for Eiffel classes.")
X
X(defvar eiffel-mode-map nil 
X  "Keymap for Eiffel mode.")
X(if eiffel-mode-map
X    nil
X  (setq eiffel-mode-map (make-sparse-keymap))
X  (define-key eiffel-mode-map "\C-cc" 'eiffel-class)
X  (define-key eiffel-mode-map "\C-cf" 'eiffel-function)
X  (define-key eiffel-mode-map "\C-cp" 'eiffel-procedure)
X  (define-key eiffel-mode-map "\C-ca" 'eiffel-attribute)
X  (define-key eiffel-mode-map "\C-ci" 'eiffel-if)
X  (define-key eiffel-mode-map "\C-cl" 'eiffel-loop)
X  (define-key eiffel-mode-map "\C-cs" 'eiffel-set)
X  (define-key eiffel-mode-map "\C-cn" 'eiffel-inspect)
X  (define-key eiffel-mode-map "\C-cw" 'eiffel-when)
X  (define-key eiffel-mode-map "\C-ce" 'eiffel-elsif)
X  (define-key eiffel-mode-map "\t" 'eiffel-indent-line)
X  (define-key eiffel-mode-map "\C-ct" 'eiffel-line-type)
X  (define-key eiffel-mode-map "\C-c\\" 'eiffel-delim-string)
X  (define-key eiffel-mode-map "\M-\C-a" 'eiffel-beginning-of-feature)
X  (define-key eiffel-mode-map "\M-\C-e" 'eiffel-end-of-feature)
X  (define-key eiffel-mode-map "\M-\C-h" 'eiffel-mark-feature)
X  (define-key eiffel-mode-map "\r" 'eiffel-return)
X  (define-key eiffel-mode-map "\177" 'backward-delete-char-untabify)
X  (define-key eiffel-mode-map "\M-;" 'eiffel-comment)
X  )
X
X
X(defvar eiffel-mode-syntax-table nil
X  "Syntax table in use in Eiffel-mode buffers.")
X
X(if eiffel-mode-syntax-table
X    nil
X  (let ((table (make-syntax-table))
X	(i 0))
X    (while (< i ?0)
X      (modify-syntax-entry i "_   " table)
X      (setq i (1+ i)))
X    (setq i (1+ ?9))
X    (while (< i ?A)
X      (modify-syntax-entry i "_   " table)
X      (setq i (1+ i)))
X    (setq i (1+ ?Z))
X    (while (< i ?a)
X      (modify-syntax-entry i "_   " table)
X      (setq i (1+ i)))
X    (setq i (1+ ?z))
X    (while (< i 128)
X      (modify-syntax-entry i "_   " table)
X      (setq i (1+ i)))
X    (modify-syntax-entry ?  "    " table)
X    (modify-syntax-entry ?-  "w 12" table)
X    (modify-syntax-entry ?_  "_  " table)
X    (modify-syntax-entry ?\t "    " table)
X    (modify-syntax-entry ?\n ">   " table)
X    (modify-syntax-entry ?\f ">   " table)
X    (modify-syntax-entry ?\" "\"    " table)
X    (modify-syntax-entry ?\\ "\\   " table)
X    (modify-syntax-entry ?\( "()  " table)
X    (modify-syntax-entry ?\) ")(  " table)
X    (modify-syntax-entry ?\[ "(]  " table)
X    (modify-syntax-entry ?\] ")[  " table)
X    (modify-syntax-entry ?' "." table)
X    (modify-syntax-entry ?` "." table)
X    (modify-syntax-entry ?/ "." table)
X    (modify-syntax-entry ?* "." table)
X    (modify-syntax-entry ?+ "." table)
X    (modify-syntax-entry ?= "." table)
X    (modify-syntax-entry ?% "." table)
X    (modify-syntax-entry ?< "." table)
X    (modify-syntax-entry ?> "." table)
X    (modify-syntax-entry ?& "." table)
X    (modify-syntax-entry ?| "." table)
X    (setq eiffel-mode-syntax-table table)))
X
X(defvar eiffel-mode-abbrev-table nil
X  "*Abbrev table in use in Eiffel-mode buffers.")
X(if eiffel-mode-abbrev-table
X    nil
X  (define-abbrev-table 'eiffel-mode-abbrev-table ())
X  (define-abbrev eiffel-mode-abbrev-table "itg" "INTEGER" nil)
X  (define-abbrev eiffel-mode-abbrev-table "boo" "BOOLEAN" nil)
X  (define-abbrev eiffel-mode-abbrev-table "cha" "CHARACTER" nil)
X  (define-abbrev eiffel-mode-abbrev-table "stg" "STRING" nil)
X  (define-abbrev eiffel-mode-abbrev-table "rea" "REAL" nil)
X  (define-abbrev eiffel-mode-abbrev-table "dou" "DOUBLE" nil)
X  (define-abbrev eiffel-mode-abbrev-table "res" "Result" nil)
X  (define-abbrev eiffel-mode-abbrev-table "cre" "Create" nil)
X  (define-abbrev eiffel-mode-abbrev-table "fgt" "Forget" nil)
X  (define-abbrev eiffel-mode-abbrev-table "cur" "Current" nil))
X
X(defconst eiffel-indent 3
X  "*This variable gives the indentation in Eiffel-mode")
X
X(defconst eiffel-comment-col 32
X  "*This variable gives the desired comment column for comments to the right
Xof text.")
X
X(defun eiffel-mode ()
X  "A major editing mode for the language Eiffel.
XComments are begun with --.
XParagraphs are separated by blank lines
XDelete converts tabs to spaces as it moves back.
XTab anywhere on a line indents it according to Eiffel conventions.
XM-; inserts and indents a comment on the line, or indents an existing
Xcomment if there is one.
XReturn indents to the expected indentation for the new line.
XSkeletons of the major Eiffel constructs are inserted with:
X
X C-c c  class           C-c i  if          C-c s  set-procedure
X C-c f  function        C-c p  procedure   C-c a  attribute
X C-c l  loop            M-;    comment     C-c \  delimit multi-line string
X
XAbbreviations:
X itg   for  INTEGER           boo  for  BOOLEAN
X cha   for  CHARACTER         stg  for  STRING
X rea   for  REAL              dou  for  DOUBLE
X res   for  Result            cre  for  Create
X cur   for  Current           fgt  for  Forget
X
XVariables controlling style:
X   eiffel-indent          Indentation of Eiffel statements.
X   eiffel-comment-col     Goal column for inline comments
X
XFeature operations:
X   C-M-a                 Move to current or previous feature beginning.
X   C-M-e                 Move to current or previous feature end.
X   C-M-h                 Mark current feature.
X
XTurning on Eiffel mode calls the value of the variable eiffel-mode-hook with
Xno args, if that value is non-nil."
X  (interactive)
X  (kill-all-local-variables)
X  (use-local-map eiffel-mode-map)
X  (set-syntax-table eiffel-mode-syntax-table)
X  (setq major-mode 'eiffel-mode)
X  (setq mode-name "Eiffel")
X  (eiffel-mode-variables nil)
X  (run-hooks 'eiffel-mode-hook))
X
X(defun eiffel-mode-variables (eif-syntax)
X  (cond (eif-syntax
X	  (if (not eiffel-mode-syntax-table)
X	      (progn (setq eiffel-mode-syntax-table
X			   (copy-syntax-table))
X		     (modify-syntax-entry ?\[ "w   "
X					  eiffel-mode-syntax-table)
X		     (modify-syntax-entry ?\] "w   "
X					  eiffel-mode-syntax-table)))
X	  (set-syntax-table eiffel-mode-syntax-table)))
X  (setq local-abbrev-table eiffel-mode-abbrev-table)
X  (make-local-variable 'paragraph-start)
X  (setq paragraph-start (concat "^$\\|" page-delimiter))
X  (make-local-variable 'paragraph-separate)
X  (setq paragraph-separate paragraph-start)
X  (make-local-variable 'paragraph-ignore-fill-prefix)
X  (setq paragraph-ignore-fill-prefix t)
X  (make-local-variable 'indent-line-function)
X  (setq indent-line-function 'eiffel-indent-line)
X  (make-local-variable 'parse-sexp-ignore-comments)
X  (setq parse-sexp-ignore-comments nil)
X  (make-local-variable 'comment-start)
X  (setq comment-start "--")
X  (make-local-variable 'comment-start-skip)
X  (setq comment-start-skip "--+[ \t]*")
X  (make-local-variable 'comment-column)
X  (setq comment-column 9)
X  (make-local-variable 'require-final-newline)
X  (setq require-final-newline t)
X)
X
X
X(defun eiffel-class ()
X  "Insert a 'class' template."
X  (interactive)
X  (let ((cname (if (and buffer-file-name
X			(string-match "/\\([^/]+\\)\\.e$" buffer-file-name))
X		   (substring buffer-file-name (match-beginning 1) (match-end 1))
X		 (read-string "Class: "))))
X    (if (not (e-empty-line-p))
X	(progn (end-of-line)(newline)))
X    (indent-to 0)                         
X    (if eiffel-moto-hdr-p
X	nil
X      (insert "--| Author: " (user-full-name) "\n")
X      (insert "--| Created: " (current-time-string) "\n\n"))
X    (if eiffel-indices
X	(progn (insert "indexing\n\n")
X	       (mapcar '(lambda (idx)
X			  (indent-to eiffel-indent)
X			  (insert idx "\n"))
X		       eiffel-indices)
X	       (insert "\n")))
X    (insert "class " (upcase cname)
X            " export\n\ninherit\n\nfeature\n\ninvariant\n\nend")
X    (and (not eiffel-moto-hdr-p) (insert " -- class " cname))
X    )
X  (re-search-backward "\ninherit" nil t)
X  (eiffel-indent-line))
X
X(defun eiffel-procedure ()
X  "Insert a 'procedure' template."
X  (interactive)
X  (let ((pname (read-string "Procedure name: ")))
X    (if (not (e-empty-line-p))
X	(progn (end-of-line)(newline)))
X    (indent-to eiffel-indent)
X    (insert pname " () is\n")
X    (if eiffel-moto-hdr-p
X	(mapcar '(lambda (hdr)
X		   (indent-to (* 3 eiffel-indent))
X		   (insert "-- " hdr ":")
X		   (indent-to-column (+ (current-column) (- 10 (length hdr))))
X		   (insert "\n"))
X		eiffel-moto-procedure-hdrs)
X      (indent-to (* 3 eiffel-indent))
X      (insert "-- \n"))
X    (mapcar '(lambda (keyword)
X	       (indent-to (* 2 eiffel-indent))
X	       (insert keyword "\n"))
X	    '("require" "local" "do" "ensure" "end;"))
X    (if eiffel-moto-hdr-p
X	nil
X      (forward-line -1)
X      (end-of-line)
X      (insert " -- " pname))
X    (search-backward ")" nil t)))
X
X(defun eiffel-function ()
X  "Insert a 'function' template."
X  (interactive)
X  (let ((fname (read-string "Function name: "))
X	(type (upcase (if (featurep 'eif-lib)
X			  (eif-complete-class-name nil "Return type:")
X			(read-string "Return type: ")))))
X    (if (not (e-empty-line-p))
X	(progn (end-of-line)(newline)))
X    (indent-to eiffel-indent)
X    (insert fname " (): " type " is\n")
X    (if eiffel-moto-hdr-p
X	(mapcar '(lambda (hdr)
X		   (indent-to (* 3 eiffel-indent))
X		   (insert "-- " hdr ":")
X		   (indent-to-column (+ (current-column) (- 10 (length hdr))))
X		   (insert "\n"))
X		eiffel-moto-function-hdrs)
X      (indent-to (* 3 eiffel-indent))
X      (insert "-- \n"))
X    (mapcar '(lambda (keyword)
X	       (indent-to (* 2 eiffel-indent))
X	       (insert keyword "\n"))
X	    '("require" "local" "do" "ensure" "end;"))
X    (if eiffel-moto-hdr-p
X	nil
X      (forward-line -1)
X      (end-of-line)
X      (insert " -- " fname))
X    (search-backward ")" nil t)))
X
X(defun eiffel-attribute ()
X  "Insert an 'attribute' template."
X  (interactive)
X  (if (not (e-empty-line-p))
X      (progn (end-of-line)(newline)))
X  (indent-to eiffel-indent)                             
X  (let ((aname (read-string "Attribute name: "))
X	(type (upcase (if (featurep 'eif-lib)
X			  (eif-complete-class-name nil "Attribute type:")
X			(read-string "Attribute type: ")))))
X    (insert aname ": " type ";\n")
X    (if eiffel-moto-hdr-p
X	(let ((opoint (point)))
X	  (mapcar '(lambda (hdr)
X		     (indent-to (* 3 eiffel-indent))
X		     (insert "-- " hdr ":")
X		     (indent-to-column (+ (current-column) (- 10 (length hdr))))
X		     (insert "\n"))
X		  eiffel-moto-attribute-hdrs)
X	  (goto-char opoint))
X      (indent-to (* 3 eiffel-indent))
X      (insert "-- \n"))
X    (eiffel-indent-line)
X    (end-of-line)))
X
X(defun eiffel-if ()
X  "Insert an 'if' statement template."
X  (interactive)
X  (mapcar '(lambda (s)
X	     (insert s)
X	     (eiffel-indent-line))
X	  '("if  then" "\n\nelse" "\n\nend;"))
X  (re-search-backward " then" nil t))
X
X(defun eiffel-inspect ()
X  "Insert an 'inspect-when' statement template."
X  (interactive)
X  (mapcar '(lambda (s)
X	     (insert s)
X	     (eiffel-indent-line))
X	  '("inspect " "\n\nwhen  then" "\n\nend;"))
X  (beginning-of-line)
X  (re-search-backward "inspect" nil t) (forward-line) (eiffel-indent-line))
X
X(defun eiffel-when ()
X  "Insert another 'when-then' clause."
X  ;; Obvious improvement -- have this check to see it this is a valid
X  ;; location for this construct, before inserting it.
X  (interactive)
X  (insert "\nwhen  then")
X  (eiffel-indent-line)
X  (insert "\n\n")
X  (re-search-backward " then" nil t))
X
X(defun eiffel-elsif ()
X  "Insert an 'elsif-then' clause."
X  ;; Obvious improvement -- have this check to see it this is a valid
X  ;; location for this construct, before inserting it.
X  (interactive)
X  (insert "\nelsif  then")
X  (eiffel-indent-line)
X  (insert "\n\n")
X  (re-search-backward " then" nil t))
X
X(defun eiffel-loop ()
X  "Insert a 'loop' statement template."
X  (interactive)
X  (mapcar '(lambda (s)
X	     (insert s)
X	     (eiffel-indent-line))
X	  '("from  " "\n\ninvariant" "\n\nvariant" "\n\nuntil" "\n\nloop" "\n\nend;"))
X  (re-search-backward "from" nil t)(forward-line)(eiffel-indent-line))
X
X(defun eiffel-set ()
X  "Inserts a function to set the value of the given variable."
X  (interactive)
X  (let ((aname (read-string "Attribute name: "))
X	(atype (upcase (if (featurep 'eif-lib)
X			   (eif-complete-class-name nil "Attribute type:")
X			(read-string "Attribute type: ")))))
X    (insert aname "_set" " (n" aname ": " atype ") is")
X    (eiffel-indent-line)
X    (insert "\n-- ")
X    (if eiffel-moto-hdr-p
X	(let ((hdr (car eiffel-moto-procedure-hdrs)))
X	  (insert hdr ":")
X	  (indent-to-column (+ (current-column) (- 10 (length hdr))))))
X    (mapcar '(lambda (s)
X	       (insert s)
X	       (eiffel-indent-line))
X	    (list (concat "Set value of `" aname "'")
X		  "\ndo"
X		  (concat "\n" aname " := n" aname)
X		  (concat "\nend;"
X			  (if (not eiffel-moto-hdr-p) (insert " -- set_" aname)))
X		  ))
X    (insert "\n")
X    (re-search-backward "^[ \t]*--" nil t)
X    (end-of-line)))
X
X(defun eiffel-return ()
X  "Indent line, insert newline and new current line line."
X  (interactive)
X  (eiffel-indent-line)
X  (newline)
X  (eiffel-indent-line))
X
X(defun eiffel-indent-line ()
X  "Indent the current line as Eiffel code."
X  (interactive)
X  (save-excursion
X    (beginning-of-line)
X    (delete-horizontal-space)
X    (indent-to (e-calc-indent)))
X  (skip-chars-forward " \t"))
X
X;; A line is one of the following:
X;;    a block end
X;;    a blank, 
X;;    a comment only, 
X;;    begins with a block-cont-keyword, i.e. a regular keyword,
X;;    begins with a qualifier-keyword,
X;;    a line that continues a qualifier clause, 
X;;    a block-head or general line.
X
X(defvar e-last-indent-type nil
X  "String description of type of line that was last indented.
XUse to debug 'e-calc-indent' function.")
X
X(defun eiffel-line-type ()
X  "Displays type of current line.
XUseful in debugging Eiffel indentation code and Eiffel syntax."
X  (interactive)
X  (eiffel-indent-line)
X  (message (concat "Current line type is: " e-last-indent-type)))
X
X(defun e-calc-indent ()
X  "Return the appropriate indentation for this line as an int."
X  (cond
X    ((e-qualifier-block-p)          ;indent two times
X     (setq e-last-indent-type "QUALIFIER KEYWORD")
X     (+ (* 2 eiffel-indent) (e-get-block-indent))) ;goes two in
X    ;; At the end of or a line following an 'end'
X    ((e-ends-with-end-p)
X     (setq e-last-indent-type "BLOCK END")
X     (+ eiffel-indent (e-get-block-indent)))
X    ((e-empty-line-p)               ;an empty line 
X     (setq e-last-indent-type "BLANK")
X     (+ eiffel-indent (e-get-block-indent))) ;go in one from block
X    ((e-comment-line-p)             ;a comment line
X     (setq e-last-indent-type "COMMENT")
X     (e-comment-indent))
X    ((e-block-cont-p)               ;begins with cont keyword
X     (setq e-last-indent-type "REGULAR KEYWORD")
X     (e-get-block-indent))          ;indent same as block
X    (t                              ;block-head or something else
X      (let ((ind-sexp (if eiffel-indent-args-str (eiffel-indent-multi-line) -1)))
X	(if (= ind-sexp -1)
X	    (or (eiffel-indent-assign)
X		(+ eiffel-indent 
X		   (let ((in (e-in-qualifier-indent)))
X		     (if (= in 0)
X			 (setq e-last-indent-type "GENERAL")
X		       (setq e-last-indent-type "QUALIFIER CONTINUED"))
X		     in)
X		   (e-get-block-indent)))
X	  (setq e-last-indent-type "STRING OR PAREN GROUPING")
X	  ind-sexp))
X)))
X
X(defun eiffel-comment ()
X  "Edit a comment on the line.  If one exists, reindent it and move to it, 
Xotherwise, create one. Gets rid of trailing blanks, puts one space between
Xcomment header comment text, leaves point at front of comment. If comment is
Xalone on a line it reindents relative to surrounding text. If it is before
Xany code, it is put at the line beginning.  Uses the variable eiffel-comment-col 
Xto set goal start on lines after text."
X  (interactive)
X  (cond ((e-comment-line-p)             ;just a comment on the line
X         (beginning-of-line)
X         (delete-horizontal-space)
X         (indent-to (e-comment-indent))
X         (forward-char 2)(delete-horizontal-space)(insert " "))
X        ((e-comment-on-line-p)          ;comment already at end of line
X         (cond ((e-ends-with-end-p)     ;end comments come immediately
X                (e-goto-comment-beg)(delete-horizontal-space)(insert " ")
X                (forward-char 2)(delete-horizontal-space)(insert " "))
X               (t
X                (e-goto-comment-beg)(delete-horizontal-space)
X                (if (< (current-column) eiffel-comment-col)
X                    (indent-to eiffel-comment-col)
X                  (insert " "))
X                (forward-char 2)
X		(delete-horizontal-space)
X		(insert " "))))
X        ((e-empty-line-p)               ;put just a comment on line
X         (beginning-of-line)
X         (delete-horizontal-space)
X         (indent-to (e-comment-indent))
X         (insert "-- "))
X        ((e-ends-with-end-p)            ;end comments come immediately
X         (end-of-line)(delete-horizontal-space)(insert " -- "))
X        (t                              ;put comment at end of line
X         (end-of-line)
X         (delete-horizontal-space)
X         (if (< (current-column) eiffel-comment-col)
X             (indent-to eiffel-comment-col)
X           (insert " "))
X         (insert "-- "))))
X  
X(defun e-ends-with-end-p ()
X  "t if line ends with 'end' or 'end;' and a comment."
X  (save-excursion
X    (beginning-of-line)
X    (looking-at "^\\(.*[ \t]+\\)?end;?[ \t]*\\($\\|--\\)")))
X
X(defun e-empty-line-p ()
X  "True if current line is empty."
X  (save-excursion
X    (beginning-of-line)
X    (looking-at "^[ \t]*$")))
X
X(defun e-comment-line-p ()
X  "t if current line is just a comment."
X  (save-excursion
X    (beginning-of-line)
X    (skip-chars-forward " \t")
X    (looking-at "--")))
X
X(defun e-comment-on-line-p ()
X  "t if current line contains a comment."
X  (save-excursion
X    (beginning-of-line)
X    (looking-at "[^\n]*--")))
X
X(defun e-in-comment-p ()
X  "t if point is in a comment."
X  (save-excursion
X    (and (/= (point) (point-max)) (forward-char 1))
X    (search-backward "--" (save-excursion (beginning-of-line) (point)) t)))
X
X(defun e-current-indentation ()
X  "Returns current line indentation."
X  (save-excursion
X    (beginning-of-line)
X    (skip-chars-forward " \t")
X    (current-indentation)))
X
X(defun e-goto-comment-beg ()
X  "Point to beginning of comment on line.  Assumes line contains a comment."
X  (beginning-of-line)
X  (search-forward "--" nil t)
X  (backward-char 2))
X
X(defun e-block-cont-p ()
X  "t if line continues the indentation of enclosing block."
X  (save-excursion
X    (beginning-of-line)
X    (looking-at e-block-keyword-regexp)))
X
X(defconst e-block-keyword-regexp
X  "\\(^\\|[ \t]+\\)\\(indexing\\|class\\|export\\|inherit\\|feature\\|rescue\
X\\|invariant\\|require\\|external\\|local\\|do\\|once\\|expanded\\|when\
X\\|deferred\\|ensure\\|then\\|elsif\\|else\\|variant\\|until\\|loop\\)\\([ \t]\\|$\\)"
X  "Eiffel block keywords requiring special indentation.")
X
X(defun e-qualifier-block-p ()
X  "t if line gets double indent because of qualifier keyword."
X  (save-excursion
X    (beginning-of-line)
X    (looking-at e-qualifier-regexp)))
X
X(defconst e-qualifier-regexp
X  "\\(^\\|[ \t]+\\)\\(rename\\|\\(re\\)?define\\|check\\|debug\\|language\\)\\([ \t]\\|$\\)"
X  "Eiffel qualifier keywords requiring special indentation.")
X
X(defun e-in-qualifier-indent ()
X  "Indent relative to qualifier keyword if still in clause, else 0."
X  ;; Assume current line does not begin with a keyword, otherwise this
X  ;; function would not be called.
X  (let ((qual-indent 0))
X    (if (e-block-cont-p)
X	nil
X      (save-excursion
X	(if (/= (forward-line -1) 0) ; Failed
X	    nil
X	  (end-of-line)
X	  (if (re-search-backward (concat ";\\|\\(" e-qualifier-regexp "\\)\\|"
X					  e-block-keyword-regexp)
X				  nil t)
X	      (progn (if (looking-at e-qualifier-regexp)
X			     (let ((keyword (buffer-substring (match-beginning 2)
X							      (match-end 2))))
X			       (if (string-match "check\\|debug" keyword)
X				   nil
X				 (setq qual-indent
X				       (+ 4 (- (match-end 2) (match-beginning 2))))
X				 (goto-char (match-end 2))
X				 (if (looking-at "[ \t]*\\(--\\|$\\)")
X				     (setq qual-indent (* eiffel-indent 2))))))
X		     (if (e-in-comment-p) (setq qual-indent 0)))
X	    ))))
X    qual-indent))
X		
X(defun e-ends-with-is ()
X  "t if current non-comment line ends with the keyword 'is' and an optional comment." 
X  (save-excursion
X    (end-of-line)
X    (let ((end (point)))
X      (beginning-of-line)
X      (and (re-search-forward
X	     "\\(^\\|[ \t]\\)is\\([ \t]+.*;\\)?[ \t]*\\($\\|--\\)\\|--" end t)
X	   (not (string= "--" (buffer-substring (match-beginning 0)
X						(match-end 0))))))))
X
X(defun e-move-to-prev-non-comment ()
X  "Moves point to previous line excluding comment lines and blank lines. 
XReturns t if successful, nil if not."
X  (beginning-of-line)
X  (re-search-backward "^[ \t]*\\([^ \t---\n]\\|-[^---]\\)" nil t))
X
X(defun e-move-to-prev-non-blank ()
X  "Moves point to previous line excluding blank lines. 
XReturns t if successful, nil if not."
X  (beginning-of-line)
X  (re-search-backward "^[ \t]*[^ \t\n]" nil t))
X
X(defun e-comment-indent ()
X  "Return indentation for a comment line."
X    (save-excursion
X      (let ((in (e-get-block-indent))
X	    (prev-is-blank
X	      (save-excursion (and (= (forward-line -1) 0) (e-empty-line-p)))))
X      (if (or (and prev-is-blank (= in 0))
X	      (not (e-move-to-prev-non-blank))) ;move to prev line if there is one
X	  0                                     ;early comments start to the left
X	(cond ((or (e-ends-with-is)             ;routine definition comment
X		   (save-excursion              ;attribute definition comment
X		     (and (= (e-get-block-indent) 0)
X			  (progn (end-of-line) (= (preceding-char) ?\;))
X			  (= (forward-line -1) 0)
X			  (or (e-empty-line-p)
X			      (looking-at "feature[ \t]*$")))))
X	       (+ (* eiffel-indent 2) (e-current-indentation)))  ; indent twice
X	      ((e-comment-line-p)         ;is a comment, same indentation
X	       (e-current-indentation))
X	      (t                          ;otherwise indent once
X		(+ eiffel-indent (e-current-indentation))))))))
X
X(defun e-in-comment-p ()
X  "t if point is in a comment."
X  (cond ((e-comment-on-line-p)
X         (let ((pt (current-column)))
X           (save-excursion
X             (e-goto-comment-beg)
X             (if (<= (current-column) pt)
X                 t
X               nil))))
X        (t
X         nil)))
X
X(defun e-quoted-string-on-line-p ()
X  "t if a an Eiffel quoted string begins, ends, or is continued on current line."
X  (save-excursion
X    (beginning-of-line)
X    ;; Line must either start with optional whitespace immediately followed
X    ;; by a '\\' or include a '\"'.  It must either end with a '\\' character
X    ;; or must include a second '\"' character.
X    (looking-at "^\\([ \t]*\\\\\\|[^\"\n]*\"\\)[^\"\n]*\\(\\\\$\\|\"\\)")))
X
X(defun e-in-quoted-string-p ()
X  "t if point is in a quoted string."
X  (let ((pt (point)) front)
X    (save-excursion
X      ;; Line must either start with optional whitespace immediately followed
X      ;; by a '\\' or include a '\"'.
X      (if (re-search-backward "\\(^[ \t]*\\\\\\|\"\\)"
X			      (save-excursion (beginning-of-line) (point)) t)
X	  (progn (setq front (point))
X		 (forward-char 1)
X		 ;; Line must either end with a '\\' character or must
X		 ;; include a second '\"' character.
X		 (and (re-search-forward
X			"\\(\\\\$\\|\"\\)"
X			(save-excursion (end-of-line) (point)) t)
X		      (>= (point) pt)
X		      (<= front pt)
X		      t)))
X      )))
X
X(defun e-get-block-indent ()
X  "Return the outer indentation of the current block. Returns 0 or less if it can't
Xfind one."
X  (let ((indent 0) (succeed))
X    (save-excursion
X      (setq succeed (e-goto-block-head))
X      (cond ((not succeed) nil)
X	    ;; heads ending in 'is' have extra indent
X            ((looking-at "is")
X             (setq indent (+ (current-indentation) eiffel-indent)))
X            (t
X	      (setq indent (current-indentation)))))
X    (if (and (e-ends-with-end-p)
X	     (save-excursion
X	       (beginning-of-line)
X	       ;; An "end" on a line by itself
X	       (looking-at "^[ \t]*end;?[ \t]*\\($\\|--\\)")))
X	(setq indent (- indent eiffel-indent)))
X    (if succeed
X        indent
X      -20)))                            ;will put at first col if lost
X
X(defun e-goto-block-head ()
X  "Move point to the block head that would be paired with an end at point.
XReturn nil if none."
X  (let ((depth 1))
X    (while (and (> depth 0)
X		;; Search for start of keyword
X		(re-search-backward
X		  "\\(^\\|[ \t]\\)\\(indexing\\|class\\|expanded\\|\
Xdeferred[ \t]+class\\|if\\|from\\|check\\|inspect\\|\is\\|debug\\|\
Xend\\)[ \t;\n]" nil t))
X      (goto-char (match-beginning 2))
X      (cond ((or (e-in-comment-p)
X		 (e-in-quoted-string-p)
X		 (looking-at "is[ \t]*[^-\n]"))
X             nil)                       ;ignore it
X            ((looking-at "end")         ;end of block
X             (setq depth (1+ depth)))
X            (t                          ;head of block
X             (setq depth (1- depth)))))
X    (if (> depth 0)                     ;check whether we hit top of file
X        nil
X      t)))
X
X(defun eiffel-mark-feature ()
X  "Put mark at end of feature, point at beginning."
X  (interactive)
X  (push-mark (point))
X  (eiffel-end-of-feature)
X  (push-mark (point))
X  (eiffel-beginning-of-feature)
X  (re-search-backward "^\n" (- (point) 1) t))
X
X(defun eiffel-beginning-of-feature (&optional arg)
X  "Move backward to next feature beginning.
XWith argument, do this that many times.
XReturns t unless search stops due to beginning of buffer."
X  (interactive "p")
X  (and arg (< arg 0) (forward-char 1))
X  (if (re-search-backward "^[ \t]*[\n][ \t]+[a-zA-Z0-9]\\|\\`"
X			  nil 'move (or arg 1))
X      t))
X
X(defun eiffel-end-of-feature (&optional arg)
X  "Move backward to next feature end.
XWith argument, do this that many times.
XReturns t unless search stops due to end of buffer."
X  (interactive "p")
X  (if (re-search-forward "[a-zA-Z0-9].*[\n][ \t]*[\n]\\|\\'"
X			  nil 'move (or arg 1))
X      (progn (forward-line -1)
X	     t)))
X
X(provide 'eiffel-mode)
END_OF_FILE
if test 32296 -ne `wc -c <'eiffel.el'`; then
    echo shar: \"'eiffel.el'\" unpacked with wrong size!
fi
# end of 'eiffel.el'
fi
if test -f 'eif-mult-fmt.el' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'eif-mult-fmt.el'\"
else
echo shar: Extracting \"'eif-mult-fmt.el'\" \(5618 characters\)
sed "s/^X//" >'eif-mult-fmt.el' <<'END_OF_FILE'
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cut Here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;!emacs
X;;
X;; FILE:         eif-mult-fmt.el
X;; SUMMARY:      Support for multi-line assignment, argument list and string
X;;                 formatting in Eiffel.
X;; USAGE:        GNU Emacs Lisp Library
X;;
X;; AUTHOR:       Bob Weiner
X;; ORG:          Motorola Inc.
X;; E-MAIL:       USENET:  weiner@novavax
X;;
X;; ORIG-DATE:     2-Feb-90
X;; LAST-MOD:      6-Feb-90 at 15:11:03 by Bob Weiner
X;;
X;; Copyright (C) 1985 Free Software Foundation, Inc.
X;; Copyright (C) 1990 Bob Weiner, Motorola Inc.
X;; Available for use and distribution under the same terms as GNU Emacs.
X;;
X;; Loosely based upon 'lisp-mode.el'.
X;;
X;; This file is not yet part of GNU Emacs.
X;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X
X(defun eiffel-indent-assign ()
X  "Return proper indentation for an assignment continuation line or nil."
X  (save-excursion
X    (let ((bol (save-excursion (beginning-of-line) (point)))
X	  (start)
X	  (in-col))
X      (while
X	  (and (re-search-backward ":=\\|;" nil t)
X	       (setq start (match-beginning 0))
X	       (re-search-backward "--" (save-excursion (beginning-of-line)
X							(point))
X				   t)))
X      (and start
X	   (goto-char start)
X	   (looking-at ":=[ \t]*")
X	   (goto-char (match-end 0))
X	   (setq e-last-indent-type "ASSIGNMENT CONTINUED"
X		 in-col (current-column))
X	   ;; If any line between assignment start and line to be indented is
X	   ;; indented less than the computed indent for current line
X	   ;; 'in-col' then can't be an assignment continuation.  This solves
X	   ;; most problems were assignment statements are not terminated by
X	   ;; semicolons.
X	   (while (and (forward-line 1)
X		       (< (point) bol)
X		       (progn (skip-chars-forward " \t")
X			      (if (< (current-column) in-col)
X				  (setq in-col nil)
X				t)))))
X      in-col)))
X
X(defun eiffel-indent-multi-line (&optional parse-start)
X  "Return integer giving appropriate indentation for current Eiffel code
Xline between parentheses or double quotes, otherwise -1.  Optional
XPARSE-START is buffer position at which to begin parsing, default is to begin
Xat the feature enclosing or preceding point."
X  (let ((eif-opoint (point))
X	(indent-point (progn (beginning-of-line) (point)))
X	(eif-ind-val -1)
X	(eif-in-str nil)
X	(eif-paren-depth 0)
X	(retry t)
X	state
X	;; setting this to a number inhibits calling hook
X	last-sexp containing-sexp)
X    (if parse-start
X	(goto-char parse-start)
X      (eiffel-beginning-of-feature))
X    ;; Find outermost containing sexp
X    (while (< (point) indent-point)
X      (setq state (parse-partial-sexp (point) indent-point 0)))
X    ;; Find innermost containing sexp
X    (while (and retry
X		state
X		(> (setq eif-paren-depth (elt state 0)) 0))
X      (setq retry nil)
X      (setq last-sexp (elt state 2))
X      (setq containing-sexp (elt state 1))
X      ;; Position following last unclosed open.
X      (goto-char (1+ containing-sexp))
X      ;; Is there a complete sexp since then?
X      (if (and last-sexp (> last-sexp (point)))
X	  ;; Yes, but is there a containing sexp after that?
X	  (let ((peek (parse-partial-sexp last-sexp indent-point 0)))
X	    (if (setq retry (car (cdr peek))) (setq state peek)))))
X    (if retry
X	nil
X      ;; Innermost containing sexp found
X      (goto-char (1+ containing-sexp))
X      (if (not last-sexp)
X	  ;; indent-point immediately follows open paren.
X	  nil
X	;; Find the start of first element of containing sexp.
X	(parse-partial-sexp (point) last-sexp 0 t)
X	(cond ((looking-at "\\s(")
X	       ;; First element of containing sexp is a list.
X	       ;; Indent under that list.
X	       )
X	      ((> (save-excursion (forward-line 1) (point))
X		  last-sexp)
X	       ;; This is the first line to start within the containing sexp.
X	       (backward-prefix-chars))
X	      (t
X		;; Indent beneath first sexp on same line as last-sexp.
X		;; Again, it's almost certainly a routine call.
X		(goto-char last-sexp)
X		(beginning-of-line)
X		(parse-partial-sexp (point) last-sexp 0 t)
X		(backward-prefix-chars))))
X      (setq eif-ind-val (current-column))
X      )
X    ;; Point is at the point to indent under unless we are inside a string.
X    (setq eif-in-str (elt state 3))
X    (goto-char eif-opoint)
X    (if (not eif-in-str)
X	nil
X      ;; Inside a string, indent 1 past string start
X      (setq eif-paren-depth 1) ;; To account for being inside string
X      (save-excursion
X	(if (re-search-backward "\"" nil t)
X	    (setq eif-ind-val (1+ (current-column)))
X	  (goto-char indent-point)
X	  (if (looking-at "^[ \t]*[^ \t\n]")
X	      (e-move-to-prev-non-blank))
X	  (skip-chars-forward " \t")
X	  (setq eif-ind-val (current-column)))))
X    (if (> eif-paren-depth 0) eif-ind-val -1)
X    ))
X
X(defun eiffel-delim-string ()
X  "Places '\\' delimiters around multiple line string that point is within.
XIf point is not within a string, produces an error1."
X  (interactive)
X  (let (start end)
X    (save-excursion
X      (if (and (setq start (if (re-search-backward "\"" nil t) (point)))
X	       (setq end (if (re-search-forward "\"" nil t 2) (point))))
X	  (save-restriction
X	    (narrow-to-region start end)
X	    (goto-char (point-min))
X	    (while 
X		(progn (if (looking-at "\"?[ \t]*\"?$")
X			   nil
X			 (if (/= ?\" (following-char))
X			     (progn (back-to-indentation)
X				    (if (/= ?\\ (following-char))
X				  (insert "\\"))))
X			 (end-of-line)
X			 (and (/= ?\" (preceding-char))
X			      (/= ?\\ (preceding-char))
X			      (insert "\\"))
X			 )
X		       (forward-line 1)
X		       (not (eobp))
X		       )))
X	(error "Point is not within a double quoted string.")))))
X	
X
X(provide 'eif-mult-fmt)
END_OF_FILE
if test 5618 -ne `wc -c <'eif-mult-fmt.el'`; then
    echo shar: \"'eif-mult-fmt.el'\" unpacked with wrong size!
fi
# end of 'eif-mult-fmt.el'
fi
if test -f 'eif-indent.el' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'eif-indent.el'\"
else
echo shar: Extracting \"'eif-indent.el'\" \(3170 characters\)
sed "s/^X//" >'eif-indent.el' <<'END_OF_FILE'
X;;!emacs
X;;
X;; FILE:         eif-indent.el
X;; SUMMARY:      Indent all Eiffel classes below a certain path.
X;; USAGE:        GNU Emacs Lisp Library
X;;
X;; AUTHOR:       Bob Weiner
X;; ORG:          Motorola, Inc., Communications Sector, Applied Research
X;; E-MAIL:       USENET:  weiner@novavax.UUCP
X;;
X;; ORIG-DATE:     7-Dec-89 at 19:32:47
X;; LAST-MOD:      6-Feb-90 at 18:47:34 by Bob Weiner
X;;
X;; Copyright (C) 1989, 1990 Bob Weiner, Motorola Inc.
X;; Available for use and distribution under the same terms as GNU Emacs.
X;;
X;; This file is not part of GNU Emacs.
X;;
X;; DESCRIPTION:  
X;;
X;;  To indent all of ISE's Eiffel code, do the following over night since it
X;;  takes a long time:
X;;
X;;	From a shell logged in as root:
X;;
X;;		emacs -q
X;;
X;;	In Emacs, assuming that Eiffel mode is automatically invoked whenever
X;;      an Eiffel file is read in:
X;;
X;;		{M-x load-lib RTN default RTN}
X;;		{M-x load-lib RTN eif-indent RTN}
X;;		{M-x eif-indent-ise-code RTN}
X;;
X;;	As each file is indented, its path is displayed in the minibuffer.
X;;	Eons later, "Done" will be displayed in the minibuffer; then you may
X;;	terminate the Emacs session:
X;;
X;;		{C-x C-c}
X;;
X;;  I hope that ISE will eventually pick up on this more readable,
X;;  space saving indentation style and will thereafter save the rest of the
X;;  world from having to repeat this process with each Eiffel library release.
X;;  (A recent mailing I received from them did use this style.)
X;;
X;; DESCRIP-END.
X
X(defconst eif-install-dir "/usr/local/src/Eiffel/"
X  "Directory below which ISE's Eiffel libraries and examples are stored.")
X
X
X(defvar eif-num-indented 0)
X
X(defun eif-indent-ise-code ()
X  (interactive)
X  (setq eif-num-indented 0)
X  (eif-indent-classes
X    (mapcar '(lambda (dir) (concat eif-install-dir dir))
X	    '("library" "examples" "src/browser/eb"))))
X
X(defun eif-indent-classes (search-dirs)
X  "Takes a list of directories and indents and saves all Eiffel classes below them."
X  (if (not (equal (user-real-login-name) "root"))
X      (error "Must be root to call 'eif-indent-classes'."))
X  (let ((make-backup-files nil)
X	(delete-auto-save-files t))
X    (delq nil
X	  (mapcar
X	    '(lambda (dir)
X	       (setq dir (file-name-as-directory dir))
X	       (let ((files (if (file-exists-p dir)
X				(directory-files dir t "^[^.~#].*[^~#]$"))))
X		 (delq nil
X		       (mapcar
X			 '(lambda (f)
X			    (if (and (string-match "/\\([^/]+\\)\\.e$" f)
X				     (not (file-directory-p f)))
X				(progn
X				  (find-file f)
X				  (setq buffer-read-only nil)
X				  (widen)
X				  (auto-save-mode -1) ;; Off
X				  ;; Delete excess end of line whitspace
X				  ;; which messes up indenting routine.
X				  (perform-replace "[ \t]+$" "" nil t nil)
X				  (setq eif-num-indented (1+ eif-num-indented))
X				  (message (format "(# %d) Indenting %s..."
X						   eif-num-indented f))
X				  (indent-region (point-min) (point-max) nil)
X				  (save-buffer)
X				  (kill-buffer (current-buffer)))))
X			 files))
X		 (eif-indent-classes
X		   (delq nil
X			 (mapcar '(lambda (f)
X				    (and (file-directory-p f)
X					 (not (string-match "\\.E$" f))
X					 f))
X				 files)))))
X	    search-dirs)))
X  (message "Done"))
X
X(provide 'eif-indent)
END_OF_FILE
if test 3170 -ne `wc -c <'eif-indent.el'`; then
    echo shar: \"'eif-indent.el'\" unpacked with wrong size!
fi
# end of 'eif-indent.el'
fi
echo shar: End of shell archive.
exit 0
-- 
Bob Weiner, Motorola, Inc.,   USENET:  ...!gatech!uflorida!novavax!weiner
(407) 364-2087