Annotation of 43BSD/contrib/emacs/lisp/add-log.el, revision 1.1

1.1     ! root        1: ;; Change log maintenance commands for Emacs
        !             2: ;; Copyright (C) 1985 Richard M. Stallman.
        !             3: 
        !             4: ;; This file is part of GNU Emacs.
        !             5: 
        !             6: ;; GNU Emacs is distributed in the hope that it will be useful,
        !             7: ;; but WITHOUT ANY WARRANTY.  No author or distributor
        !             8: ;; accepts responsibility to anyone for the consequences of using it
        !             9: ;; or for whether it serves any particular purpose or works at all,
        !            10: ;; unless he says so in writing.  Refer to the GNU Emacs General Public
        !            11: ;; License for full details.
        !            12: 
        !            13: ;; Everyone is granted permission to copy, modify and redistribute
        !            14: ;; GNU Emacs, but only under the conditions described in the
        !            15: ;; GNU Emacs General Public License.   A copy of this license is
        !            16: ;; supposed to have been given to you along with GNU Emacs so you
        !            17: ;; can know your rights and responsibilities.  It should be in a
        !            18: ;; file named COPYING.  Among other things, the copyright notice
        !            19: ;; and this notice must be preserved on all copies.
        !            20: 
        !            21: 
        !            22: ;; >> Potential lossage if two people edit change log at same time.
        !            23: ;; >> Maybe should lock file and unlock when written out.
        !            24: 
        !            25: (defun add-change-log-entry (&optional whoami)
        !            26:   "Find change log file and add an entry for today.
        !            27: With ARG, prompt for name and site of person."
        !            28:   (interactive "P")
        !            29:   (let* ((full-name (if whoami
        !            30:                        (read-input "Full name: " (user-full-name))
        !            31:                      (user-full-name)))
        !            32:         ;; Note that some sites have room and phone number fields in
        !            33:         ;; full name which look silly when inserted.  Rather than do
        !            34:         ;; anything about that here, let user give prefix argument so that
        !            35:         ;; s/he can edit the full name field in prompter if s/he wants.
        !            36:         (login-name (if whoami
        !            37:                         (read-input "Login name: " (user-login-name))
        !            38:                       (user-login-name)))
        !            39:         (site-name (if whoami
        !            40:                        (read-input "Site name: " (system-name))
        !            41:                      (system-name))))
        !            42:     (find-file (expand-file-name
        !            43:                (read-file-name "Log file (default ChangeLog): "
        !            44:                                nil "ChangeLog")))
        !            45:     (or (eq major-mode 'indented-text-mode)
        !            46:        (progn
        !            47:          (indented-text-mode)
        !            48:          (setq left-margin 8)
        !            49:          (setq fill-column 74)))
        !            50:     (auto-fill-mode 1)
        !            51:     (goto-char (point-min))
        !            52:     (if (not (and (looking-at (substring (current-time-string) 0 10))
        !            53:                  (save-excursion (re-search-forward "(.* at")
        !            54:                                  (skip-chars-backward "^(")
        !            55:                                  (looking-at login-name))))
        !            56:        (progn (insert (current-time-string)
        !            57:                       "  " full-name
        !            58:                       "  (" login-name
        !            59:                       " at " site-name ")\n\n")))
        !            60:     (goto-char (point-min))
        !            61:     (forward-line 1)
        !            62:     (while (looking-at "\\sW")
        !            63:       (forward-line 1))
        !            64:     (delete-region (point)
        !            65:                   (progn
        !            66:                     (skip-chars-backward "\n")
        !            67:                     (point)))
        !            68:     (open-line 3)
        !            69:     (forward-line 2)
        !            70:     (indent-to left-margin)
        !            71:     (insert "* ")))
        !            72: 
        !            73: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.