wsr@lmi-angel.UUCP (Wolfgang Rupprecht) (11/14/86)
For those people that like unix indent(1) for C files. Indent(1) does much more processing than gnu-emacs' indent. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; File: cindent.el ;; ;; Author: Wolfgang Rupprecht ;; ;; Created: Thu Nov 13 23:34:03 1986 ;; ;; Contents: run unix indent(1) on the specified buffer ;; ;; ;; ;; $Log$ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Copyright 1986 Wolfgang Rupprecht (defun cindent (buffer) "Reformat the specified BUFFER using the Unix indent(1) program. Selects the specified buffer, and saves it to disk, displays new version. M-x revert-buffer and M-x undo work as expected. User may opt not to save the newly indented buffer." (interactive "bbuffer to indent ") (switch-to-buffer buffer) (let ((auto-save-file-name (make-auto-save-file-name)) (opoint (point)) ) (save-buffer) (shell-command (concat "indent -l80 -bl -bc " buffer-file-name " " auto-save-file-name) nil) (erase-buffer) (insert-file auto-save-file-name) (goto-char (min opoint (point-max))))) -- Wolfgang Rupprecht {harvard|decvax!cca|mit-eddie}!lmi-angel!wsr