annotate lisp/packages/emacsbug.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children ac2d302a0011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: K. Shane Hartman
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Maintainer: FSF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: maint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Not fully installed because it can work only on Internet hosts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Synched up with: FSF 19.30.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; `M-x report-emacs-bug ' starts an email note to the Emacs maintainers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; describing a problem. Here's how it's done...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; >> This should be an address which is accessible to your machine,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; >> otherwise you can't use this file. It will only work on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; >> internet with this address.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (require 'sendmail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defvar bug-gnu-emacs "xemacs@cs.uiuc.edu"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "Address of site maintaining mailing list for GNU Emacs bugs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (defvar report-emacs-bug-orig-text nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 "The automatically-created initial text of bug report.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun report-emacs-bug (topic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Report a bug in GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 Prompts for bug subject. Leaves you in a mail buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (interactive "sBug Subject: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (mail nil bug-gnu-emacs topic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (insert "In " (emacs-version) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (if (and system-configuration-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (not (equal system-configuration-options "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (insert "configured using `configure "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 system-configuration-options "'\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; This is so the user has to type something
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; in order to send easily.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (with-output-to-temp-buffer "*Bug Help*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (princ (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 "Type \\[mail-send-and-exit] to send the bug report.\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (terpri)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (princ (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 about when and how to write a bug report,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 and what information to supply so that the bug can be fixed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 Type SPC to scroll through this section and its subsections.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; Make it less likely people will send empty messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (make-local-variable 'mail-send-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (add-hook 'mail-send-hook 'report-emacs-bug-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (skip-chars-backward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (make-local-variable 'report-emacs-bug-orig-text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defun report-emacs-bug-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "Go to the Info node on reporting Emacs bugs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (Info-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (Info-menu "emacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (Info-goto-node "Bugs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defun report-emacs-bug-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (skip-chars-backward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (if (and (= (- (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (length report-emacs-bug-orig-text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (equal (buffer-substring (point-min) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 report-emacs-bug-orig-text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (error "No text entered in bug report"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (provide 'emacsbug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;;; emacsbug.el ends here