[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatic headers in fred
- To: David Chinn <dc6b+@andrew.cmu.edu>, info-mcl@ministry.cambridge.apple.com
- Subject: Re: Automatic headers in fred
- From: stevens@cs.colorado.edu (Curt Stevens)
- Date: Tue, 9 Nov 1993 10:35:51 -0700
At 11:06 AM 11/9/93 -0500, David Chinn wrote:
>Does anybody have or know of code to put automatic headers into fred
>files, and to update them (for instance changed date) on open or save.
>In emacs there are a few such systems (eg headers.el).
>
>On a similar note, are there other repositories of fred add-ins other
>than cambridge.apple.com ?
>
>Many thanks
>
>David Chinn
>
I have developed such a system which I am now in the final process of debugging. It does not yet have the automatic "date" feature you ask for, but I intend to put that in. Currently it creates "file" headers and "definition" headers (including internal documentation strings and definition names/types). I was going to post this later in the week after I have the time to fix one last bug with the internal doc strings. I will send you a copy asap, and post to the archive site at the same time. Here are examples of what the code does.
Place the cursor anywhere inside this method and hit a key combination to insert the header on top of the definition and the internal doc string (without the details so far).
;;;
;;;***************************************************************************
;;; INSERT-DOCUMENTATION-STRING [Method]
;;;
;;; Author : Brent Reeves (with modifications by Curt)
;;; Date : 9/28/93
;;; Abstract : Insert an internal dcumentation string in the current
;;; : definition.
;;;***************************************************************************
;;;
(defmethod INSERT-DOCUMENTATION-STRING ((w fred-window))
" in: w {fred-window}
out:
effects: puts cool comment header like this one in the definition
"
(let* ((cursor-mark (fred-buffer w)) ...
Here is what a file header might look like (the actual format is completely customizable).
;;; -*- mode:lisp; Package:cl-user; -*-
;;;***************************************************************************
;;;***************************************************************************
;;;
;;; Title : Comment Headers
;;;
;;;***************************************************************************
;;;***************************************************************************
;;; Author : Curt Stevens
;;; Copyright : 1993 University of Colorado at Boulder, All Rights Reserved
;;; Availability: public domain
;;; Address : University of Colorado at Boulder
;;; : Computer Science Department
;;; : ECOT 7-7, Engineering Center
;;; : Boulder,Colorado 80309
;;; : stevens@cs.colorado.edu
;;;***************************************************************************
;;; Filename : Comment-Headers.lisp
;;; Version : 1.0b
;;;
;;; Abstract : A set of fred extensions that automatically create file and
;;; : function/method... headers. The key mappings are set at the
;;; : bottom of the file. In addition to adding headers, you can
;;; : automatically add lines (with the current date) to the
;;; : history field of the file header. This header and the ones
;;; : above definitions in this file were created with these
;;; : extensions.
;;; :
;;; : The default key mappings are:
;;; : <meta>-h insert header above this definition
;;; : <cntl>-<meta>-h insert def header with internal doc string
;;; : <cntl>-<meta>-<shift>-h insert file header at top of file
;;; : <cntl>-<meta>-u update the history field of the file header
;;; :
;;; : <cntl>-c insert internal documentation string
;;; :
;;; : <meta>-o insert an empty comment line
;;; : (Like the empty lines here, it is used to
;;; : facilitate manually extending headers.)
;;; :
;;; : These extensions were inspired by a similar set that were
;;; : developed by Dave Wrobleski for the Symbolics environment.
;;;
;;; History :
;;; : 10/4/93 Curt Stevens
;;; : added class test to each function to stop headers from
;;; : being accidentally generated in listener windows
;;; :
;;; : 9/27/93 Curt Stevens
;;; : fixed the following bugs...
;;; : - Blows up if you try definition header with the cursor
;;; : being after the last character in the buffer.
;;; : - Blows up placing definition header in empty buffer.
;;; :
;;; : 9/15/93 Curt Stevens
;;; : initial version 1.0 alpha release
;;;
;;; Bugs : You tell me :->. Send bugs to address above.
;;; : - Blows up if you try definition header before you have the
;;; : definition finished up through the arguments.
;;;
;;; Todo : + Dialog interface for setting options.
;;; : + Implement the "update history field" feature.
;;; : + Get default author name from "sharing setup" control panel?
;;;***************************************************************************
--------------
|Curt Stevens|
--------------