home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bbs
/
may94
/
util
/
edit
/
jade.lha
/
Jade
/
lisp
/
add-log.jl
next >
Wrap
Lisp/Scheme
|
1994-04-16
|
2KB
|
37 lines
;;;; add-log.jl -- Making ChangeLog files
;;; Copyright (C) 1993, 1994 John Harper <jsh@ukc.ac.uk>
;;; This file is part of Jade.
;;; Jade is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
;;; any later version.
;;; Jade is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with Jade; see the file COPYING. If not, write to
;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
(defun add-change-log-entry (&optional log-file &aux log-buffer)
(unless log-file
(if (setq log-file (prompt "Log file: " (path-name (file-name))))
(when (file-directory-p log-file)
(setq log-file (file-concat log-file "ChangeLog")))
(return)))
(when (setq log-buffer (open-file log-file))
(goto-buffer log-buffer)
(goto (pos 1 1))
(unless (log-in-same-day-p (copy-area (pos 1 1) (line-end (pos 1 1))))
(insert (concat (current-time-string) " " (user-full-name) " (" (user-login-name) ?@ (system-name) ")\n\n")))
(goto (pos 1 2))
(insert "\n\t* \n")
(goto (line-end (pos 1 3)))))
(defun log-in-same-day-p (old-header)
(regexp-match (concat (substr (current-time-string) 0 11) ".* " (user-full-name) " \\(" (user-login-name) ?@ (system-name) "\\)") old-header))