annotate lisp/packages/emacsbug.el @ 138:6608ceec7cf8 r20-2b3

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