🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #3713

run indent on emacs buffer

#3713
From: Wolfgang Rupprecht
Date: Fri, 14 Nov 1986 04:40
33 lines
1854 bytes
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
Technical Details
Message-ID: <95@lmi-angel.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!pyrnj!mirror!cca!lmi-angel!wsr

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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