[Crossfire-wiki] [Crossfire DokuWiki] page added: user:mhoram:scripts:indent_a_file
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Thu Jan 25 19:24:33 CST 2007
A page in your DokuWiki was added or changed. Here are the details:
Date : 2007/01/25 19:24
User : mhoram
Edit Summary: created
This is a simple lisp function for Emacs (or XEmacs) that indents a file and removes all tabs, according to the Crossfire programming guide.
<code lisp>
;;; Fixes the indentation of a file at 4 spaces per indent,
;;; and replaces all tabs with spaces.
;;; To use on code.c in batch mode, save as indent.el, and run:
;;;
;;; emacs -batch code.c -l indent.el -f indent-a-file -kill
;;;
(defun indent-a-file ()
(setq c-basic-offset 4)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))
(save-buffer)
)
</code>
IP-Address : 206.71.197.56
Old Revision: none
New Revision: http://wiki.metalforge.net/doku.php/user:mhoram:scripts:indent_a_file
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list