Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!pyrnj!mirror!cca!lmi-angel!wsr From: wsr@lmi-angel.UUCP (Wolfgang Rupprecht) Newsgroups: comp.emacs Subject: run indent on emacs buffer Message-ID: <95@lmi-angel.UUCP> Date: Thu, 13-Nov-86 23:40:53 EST Article-I.D.: lmi-ange.95 Posted: Thu Nov 13 23:40:53 1986 Date-Received: Sat, 15-Nov-86 02:39:16 EST Reply-To: wsr@lmi-angel.UUCP (Wolfgang Rupprecht) Organization: LISP Machine, Inc (Cambridge Engineering HQ) Lines: 33 Keywords: unix-indent 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