home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-19.28-src.tgz / tar.out / fsf / emacs / lisp / emacsbug.el < prev    next >
Lisp/Scheme  |  1996-09-28  |  3KB  |  77 lines

  1. ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list.
  2.  
  3. ;; Copyright (C) 1985, 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Author: K. Shane Hartman
  6. ;; Maintainer: FSF
  7. ;; Keywords: maint
  8.  
  9. ;; Not fully installed because it can work only on Internet hosts.
  10. ;; This file is part of GNU Emacs.
  11.  
  12. ;; GNU Emacs is free software; you can redistribute it and/or modify
  13. ;; it under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation; either version 2, or (at your option)
  15. ;; any later version.
  16.  
  17. ;; GNU Emacs is distributed in the hope that it will be useful,
  18. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. ;; GNU General Public License for more details.
  21.  
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  24. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  25.  
  26. ;;; Commentary:
  27.  
  28. ;; `M-x report-emacs-bug ' starts an email note to the Emacs maintainers
  29. ;; describing a problem.  Here's how it's done...
  30.  
  31. ;;; Code:
  32.  
  33. ;; >> This should be an address which is accessible to your machine,
  34. ;; >> otherwise you can't use this file.  It will only work on the
  35. ;; >> internet with this address.
  36.  
  37. (require 'sendmail)
  38.  
  39. (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu"
  40.   "Address of site maintaining mailing list for GNU Emacs bugs.")
  41.  
  42. (defvar report-emacs-bug-orig-text nil
  43.   "The automatically-created initial text of bug report.")
  44.  
  45. ;;;###autoload
  46. (defun report-emacs-bug (topic)
  47.   "Report a bug in GNU Emacs.
  48. Prompts for bug subject.  Leaves you in a mail buffer."
  49.   (interactive "sBug Subject: ")
  50.   (mail nil bug-gnu-emacs topic)
  51.   (goto-char (point-min))
  52.   (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n"))
  53.   (insert "In " (emacs-version) "\n\n")
  54.   (message (substitute-command-keys "Type \\[mail-send-and-exit] to send bug report."))
  55.   ;; Make it less likely people will send empty messages.
  56.   (make-local-variable 'mail-send-hook)
  57.   (add-hook 'mail-send-hook 'report-emacs-bug-hook)
  58.   (save-excursion
  59.     (goto-char (point-max))
  60.     (skip-chars-backward " \t\n")
  61.     (make-local-variable 'report-emacs-bug-orig-text)
  62.     (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point)))))
  63.  
  64. (defun report-emacs-bug-hook ()
  65.   (save-excursion
  66.     (goto-char (point-max))
  67.     (skip-chars-backward " \t\n")
  68.     (if (and (= (- (point) (point-min))
  69.         (length report-emacs-bug-orig-text))
  70.          (equal (buffer-substring (point-min) (point))
  71.             report-emacs-bug-orig-text))
  72.     (error "No text entered in bug report"))))
  73.  
  74. (provide 'emacsbug)
  75.  
  76. ;;; emacsbug.el ends here
  77.