0
|
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 XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; 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 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
2
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
0
|
26
|
2
|
27 ;;; Synched up with: FSF 19.34.
|
0
|
28
|
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; `M-x report-emacs-bug ' starts an email note to the Emacs maintainers
|
|
32 ;; describing a problem. Here's how it's done...
|
|
33
|
|
34 ;;; Code:
|
|
35
|
|
36 ;; >> This should be an address which is accessible to your machine,
|
|
37 ;; >> otherwise you can't use this file. It will only work on the
|
|
38 ;; >> internet with this address.
|
|
39
|
|
40 (require 'sendmail)
|
|
41
|
2
|
42 ;; XEmacs: Screen for whether a beta version is running and redirect
|
|
43 ;; reports to the beta list instead of the newsgroup. I don't think
|
|
44 ;; there's an XEmacs equivalent to system-configuration-options, but
|
|
45 ;; there should be. -sb
|
|
46 (defvar report-emacs-bug-pretest-address "xemacs-beta@xemacs.org"
|
|
47 "Address of mailing list for XEmacs beta bugs.")
|
|
48
|
|
49 (defvar bug-gnu-emacs "xemacs@xemacs.org"
|
|
50 "Address of site maintaining mailing list for XEmacs bugs.")
|
0
|
51
|
|
52 (defvar report-emacs-bug-orig-text nil
|
|
53 "The automatically-created initial text of bug report.")
|
|
54
|
|
55 ;;;###autoload
|
2
|
56 (defun report-xemacs-bug (topic)
|
|
57 "Report a bug in XEmacs.
|
0
|
58 Prompts for bug subject. Leaves you in a mail buffer."
|
|
59 (interactive "sBug Subject: ")
|
2
|
60 (if (mail nil
|
|
61 (if (string-match "\(beta[0-9]+\)" emacs-version)
|
|
62 ;; If there are four numbers in emacs-version,
|
|
63 ;; this is a pretest version.
|
|
64 report-emacs-bug-pretest-address
|
|
65 bug-gnu-emacs)
|
|
66 topic)
|
|
67 (let (user-point)
|
|
68 ;; The rest of this does not execute
|
|
69 ;; if the user was asked to confirm and said no.
|
|
70 (goto-char (point-min))
|
|
71 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n"))
|
|
72 (insert "In " (emacs-version) "\n")
|
|
73 (if (and (boundp 'system-configuration-options)
|
|
74 system-configuration-options
|
|
75 (not (equal system-configuration-options "")))
|
|
76 (insert "configured using `configure "
|
|
77 system-configuration-options "'\n"))
|
|
78 (insert "\n")
|
|
79 (insert "Please describe exactly what actions triggered the bug\n"
|
|
80 "and the precise symptoms of the bug:\n\n")
|
|
81 (setq user-point (point))
|
|
82 (insert "\n\n\n"
|
|
83 "Recent input:\n")
|
|
84 (let ((before-keys (point)))
|
|
85 ;; XEmacs:
|
|
86 (insert (key-description (recent-keys)))
|
|
87 ; (insert (mapconcat (lambda (key)
|
|
88 ; (if (or (integerp key)
|
|
89 ; (symbolp key)
|
|
90 ; (listp key))
|
|
91 ; (single-key-description key)
|
|
92 ; (prin1-to-string key nil)))
|
|
93 ; (recent-keys)
|
|
94 ; " "))
|
|
95 (save-restriction
|
|
96 (narrow-to-region before-keys (point))
|
|
97 (goto-char before-keys)
|
|
98 (while (progn (move-to-column 50) (not (eobp)))
|
|
99 (search-forward " " nil t)
|
|
100 (insert "\n"))))
|
|
101 (let ((message-buf (get-buffer " *Message-Log*")))
|
|
102 (if message-buf
|
|
103 (progn
|
|
104 (insert "\n\nRecent messages:\n")
|
|
105 (insert-buffer-substring message-buf
|
|
106 (save-excursion
|
|
107 (set-buffer message-buf)
|
|
108 (goto-char (point-max))
|
|
109 (forward-line -10)
|
|
110 (point))
|
|
111 (save-excursion
|
|
112 (set-buffer message-buf)
|
|
113 (point-max))))))
|
|
114 ;; This is so the user has to type something
|
|
115 ;; in order to send easily.
|
|
116 ;; XEmacs: FSF non-abstraction of data?
|
|
117 ;; (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
|
|
118 (use-local-map (current-local-map))
|
|
119 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
|
|
120 (with-output-to-temp-buffer "*Bug Help*"
|
|
121 (princ (substitute-command-keys
|
|
122 "Type \\[mail-send-and-exit] to send the bug report.\n"))
|
|
123 (princ (substitute-command-keys
|
|
124 "Type \\[kill-buffer] RET to cancel (don't send it).\n"))
|
|
125 (terpri)
|
|
126 (princ (substitute-command-keys
|
|
127 "Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
|
0
|
128 about when and how to write a bug report,
|
|
129 and what information to supply so that the bug can be fixed.
|
|
130 Type SPC to scroll through this section and its subsections.")))
|
2
|
131 ;; Make it less likely people will send empty messages.
|
|
132 (make-local-variable 'mail-send-hook)
|
|
133 (add-hook 'mail-send-hook 'report-emacs-bug-hook)
|
|
134 (save-excursion
|
|
135 (goto-char (point-max))
|
|
136 (skip-chars-backward " \t\n")
|
|
137 (make-local-variable 'report-emacs-bug-orig-text)
|
|
138 (setq report-emacs-bug-orig-text
|
|
139 (buffer-substring (point-min) (point))))
|
|
140 (goto-char user-point))))
|
|
141
|
|
142 ;; ;;;###autoload
|
|
143 ;; (defalias 'report-emacs-bug 'report-xemacs-bug)
|
0
|
144
|
|
145 (defun report-emacs-bug-info ()
|
|
146 "Go to the Info node on reporting Emacs bugs."
|
|
147 (interactive)
|
|
148 (info)
|
|
149 (Info-directory)
|
2
|
150 (Info-menu "xemacs")
|
0
|
151 (Info-goto-node "Bugs"))
|
|
152
|
|
153 (defun report-emacs-bug-hook ()
|
|
154 (save-excursion
|
|
155 (goto-char (point-max))
|
|
156 (skip-chars-backward " \t\n")
|
|
157 (if (and (= (- (point) (point-min))
|
|
158 (length report-emacs-bug-orig-text))
|
|
159 (equal (buffer-substring (point-min) (point))
|
|
160 report-emacs-bug-orig-text))
|
|
161 (error "No text entered in bug report"))))
|
|
162
|
|
163 (provide 'emacsbug)
|
|
164
|
|
165 ;;; emacsbug.el ends here
|