Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / lisp / emacs-lisp / gulp.el
index 0020f72..1474e3c 100644 (file)
@@ -1,6 +1,7 @@
-;;; gulp.el --- Ask for updates for Lisp packages
+;;; gulp.el --- ask for updates for Lisp packages
 
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Sam Shteingold <shteingd@math.ucla.edu>
 ;; Maintainer: FSF
@@ -8,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;; update.
 
 ;;; Code:
-
-(defvar gulp-discard "^;+ *Maintainer: *FSF *$"
-  "*The regexp matching the packages not requiring the request for updates.")
-
-(defvar gulp-tmp-buffer "*gulp*" "The name of the temporary buffer.")
-
-(defvar gulp-max-len 2000
-  "*Distance into a Lisp source file to scan for keywords.")
-
-(defvar gulp-request-header
+(defgroup gulp nil
+  "Ask for updates for Lisp packages."
+  :prefix "-"
+  :group 'maint)
+
+(defcustom gulp-discard "^;+ *Maintainer: *FSF *$"
+  "*The regexp matching the packages not requiring the request for updates."
+  :type 'regexp
+  :group 'gulp)
+
+(defcustom gulp-tmp-buffer "*gulp*" "The name of the temporary buffer."
+  :type 'string
+  :group 'gulp)
+
+(defcustom gulp-max-len 2000
+  "*Distance into a Lisp source file to scan for keywords."
+  :type 'integer
+  :group 'gulp)
+
+(defcustom gulp-request-header
   (concat
    "This message was created automatically.
-A new version of GNU Emacs, "
-   (format "%d.%d" emacs-major-version (+ emacs-minor-version 1))
-   ", is entering the pretest state,
-and it is high time to submit the updates to the various emacs packages.
+I'm going to start pretesting a new version of GNU Emacs soon, so I'd
+like to ask if you have any updates for the Emacs packages you work on.
 You're listed as the maintainer of the following package(s):\n\n")
-  "*The starting text of a gulp message.")
+  "*The starting text of a gulp message."
+  :type 'string
+  :group 'gulp)
 
-(defvar gulp-request-end
+(defcustom gulp-request-end
   (concat
    "\nIf you have any changes since the version in the previous release ("
    (format "%d.%d" emacs-major-version emacs-minor-version)
    "),
 please send them to me ASAP.
 
+Please don't send the whole file.  Instead, please send a patch made with
+`diff -c' that shows precisely the changes you would like me to install.
+Also please include itemized change log entries for your changes;
+please use lisp/ChangeLog as a guide for the style and for what kinds
+of information to include.
+
 Thanks.")
-  "*The closing text in a gulp message.")
+  "*The closing text in a gulp message."
+  :type 'string
+  :group 'gulp)
+
+(declare-function mail-subject "sendmail" ())
+(declare-function mail-send "sendmail" ())
 
 (defun gulp-send-requests (dir &optional time)
   "Send requests for updates to the authors of Lisp packages in directory DIR.
@@ -78,15 +98,20 @@ is left in the `*gulp*' buffer at the end."
          ;; Temporarily inhibit undo in the *gulp* buffer.
          (buffer-undo-list t)
          mail-setup-hook msg node)
+      (setq m-p-alist
+           (sort m-p-alist
+                 (function (lambda (a b)
+                             (string< (car a) (car b))))))
       (while (setq node (car m-p-alist))
        (setq msg (gulp-create-message (cdr node) time))
        (setq mail-setup-hook
-             '(lambda () 
-                (mail-subject)
-                (insert "It's time for Emacs updates again")
-                (goto-char (point-max))
-                (insert msg)))
+             (lambda ()
+               (mail-subject)
+               (insert "It's time for Emacs updates again")
+               (goto-char (point-max))
+               (insert msg)))
        (mail nil (car node))
+       (goto-char (point-min))
        (if (y-or-n-p "Send? ") (mail-send)
          (kill-this-buffer)
          (set-buffer gulp-tmp-buffer)
@@ -111,7 +136,7 @@ is left in the `*gulp*' buffer at the end."
   "Create the maintainer/package alist for files in FLIST in DIR.
 That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
   (save-excursion
-    (let (mplist filen node mnt-tm mnt tm)
+    (let (mplist filen node mnt-tm mnt tm fl-tm)
       (get-buffer-create gulp-tmp-buffer)
       (set-buffer gulp-tmp-buffer)
       (setq buffer-undo-list t)
@@ -122,7 +147,6 @@ That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
                (setq mplist (cons (cons mnt (cons (cons filen tm) (cdr node)))
                                   (delete node mplist)))
              (setq mplist (cons (list mnt (cons filen (cdr fl-tm))) mplist))))
-       (message "%s -- %s" filen fl-tm)
        (setq flist (cdr flist)))
       (erase-buffer)
       mplist)))
@@ -130,7 +154,7 @@ That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
 (defun gulp-maintainer (filenm dir)
   "Return a list (MAINTAINER TIMESTAMP) for the package FILENM in directory DIR."
   (save-excursion
-    (let* ((fl (concat dir filenm)) mnt
+    (let* ((fl (expand-file-name filenm dir)) mnt
           (timest (format-time-string "%Y-%m-%d %a %T %Z"
                                       (elt (file-attributes fl) 5))))
       (set-buffer gulp-tmp-buffer)
@@ -149,4 +173,7 @@ That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
        (if (= (length mnt) 0) (setq mnt nil))) ;; "^;; Author: $" --> nil
       (cons mnt timest))))
 
+(provide 'gulp)
+
+;; arch-tag: 42750a11-460a-4efc-829f-342d075530e5
 ;;; gulp.el ends here