Mercurial > emacs
annotate lisp/mail/emacsbug.el @ 35539:57b31206dbfa
(coding-category-utf-8): Initialize to mule-utf-8.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 25 Jan 2001 11:48:42 +0000 |
parents | 05a619c13dea |
children | 9a4674999109 |
rev | line source |
---|---|
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
474
diff
changeset
|
1 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list. |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
474
diff
changeset
|
2 |
21360
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
3 ;; Copyright (C) 1985, 1994, 1997, 1998 Free Software Foundation, Inc. |
845 | 4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
794
diff
changeset
|
5 ;; Author: K. Shane Hartman |
794
2598c08c91c2
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
6 ;; Maintainer: FSF |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
7 ;; Keywords: maint mail |
794
2598c08c91c2
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
8 |
36 | 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 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
794
diff
changeset
|
14 ;; the Free Software Foundation; either version 2, or (at your option) |
36 | 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 | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
36 | 26 |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
27 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
28 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
29 ;; `M-x report-emacs-bug ' starts an email note to the Emacs maintainers |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
30 ;; describing a problem. Here's how it's done... |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
31 |
794
2598c08c91c2
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
32 ;;; Code: |
36 | 33 |
34 ;; >> This should be an address which is accessible to your machine, | |
35 ;; >> otherwise you can't use this file. It will only work on the | |
36 ;; >> internet with this address. | |
37 | |
6971
90859715093d
(report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents:
2348
diff
changeset
|
38 (require 'sendmail) |
90859715093d
(report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents:
2348
diff
changeset
|
39 |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
40 (defgroup emacsbug nil |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
41 "Sending Emacs bug reports." |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
42 :group 'maint |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
43 :group 'mail) |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
44 |
21360
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
45 (defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org" |
20797
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
46 "*Address of mailing list for GNU Emacs bugs." |
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
47 :group 'emacsbug |
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
48 :type 'string) |
14815
4a742f2d5328
(report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents:
14280
diff
changeset
|
49 |
21360
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
50 (defcustom report-emacs-bug-pretest-address "emacs-pretest-bug@gnu.org" |
20797
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
51 "*Address of mailing list for GNU Emacs pretest bugs." |
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
52 :group 'emacsbug |
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
53 :type 'string) |
36 | 54 |
8130
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
55 (defvar report-emacs-bug-orig-text nil |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
56 "The automatically-created initial text of bug report.") |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
57 |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
58 (defcustom report-emacs-bug-no-confirmation nil |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
59 "*If non-nil, suppress the confirmations asked for the sake of novice users." |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
60 :group 'emacsbug |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
61 :type 'boolean) |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
62 |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
63 (defcustom report-emacs-bug-no-explanations nil |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
64 "*If non-nil, suppress the explanations given for the sake of novice users." |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
65 :group 'emacsbug |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
66 :type 'boolean) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
67 |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
68 ;;;###autoload |
16576
a04c1653a37c
(report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents:
16572
diff
changeset
|
69 (defun report-emacs-bug (topic &optional recent-keys) |
474 | 70 "Report a bug in GNU Emacs. |
36 | 71 Prompts for bug subject. Leaves you in a mail buffer." |
16576
a04c1653a37c
(report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents:
16572
diff
changeset
|
72 ;; This strange form ensures that (recent-keys) is the value before |
a04c1653a37c
(report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents:
16572
diff
changeset
|
73 ;; the bug subject string is read. |
a04c1653a37c
(report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents:
16572
diff
changeset
|
74 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: ")))) |
35516
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
75 ;; If there are four numbers in emacs-version, this is a pretest |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
76 ;; version. |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
77 (let ((pretest-p (string-match "\\..*\\..*\\." emacs-version)) |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
78 user-point message-end-point) |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
79 (setq message-end-point |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
80 (with-current-buffer (get-buffer "*Messages*") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
81 (point-max-marker))) |
35516
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
82 (compose-mail (if pretest-p |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
83 report-emacs-bug-pretest-address |
20797
5941b5298627
(report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents:
20774
diff
changeset
|
84 report-emacs-bug-address) |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
85 topic) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
86 ;; The rest of this does not execute |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
87 ;; if the user was asked to confirm and said no. |
21869
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
88 (rfc822-goto-eoh) |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
89 (forward-line 1) |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
90 |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
91 (let ((signature (buffer-substring (point) (point-max)))) |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
92 ;; Discourage users to write non-English text. |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
93 (set-buffer-multibyte nil) |
0f8ca1599a5a
(report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents:
21498
diff
changeset
|
94 (delete-region (point) (point-max)) |
21974
42b308d86213
(report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents:
21869
diff
changeset
|
95 (insert signature) |
42b308d86213
(report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents:
21869
diff
changeset
|
96 (backward-char (length signature))) |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
97 (unless report-emacs-bug-no-explanations |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
98 ;; Insert warnings for novice users. |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
99 (insert "This bug report will be sent to the Free Software Foundation,\n") |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
100 (let ((pos (point))) |
33153
65726622c836
(report-emacs-bug): Fix whitespace and
Eli Zaretskii <eliz@gnu.org>
parents:
21975
diff
changeset
|
101 (insert "not to your local site managers!") |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
102 (put-text-property pos (point) 'face 'highlight)) |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
103 (insert "\nPlease write in ") |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
104 (let ((pos (point))) |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
105 (insert "English") |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
106 (put-text-property pos (point) 'face 'highlight)) |
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
107 (insert ", because the Emacs maintainers do not have |
35516
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
108 translators to read other languages for them.\n\n") |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
109 (insert (format "Your bug report will be posted to the %s mailing list" |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
110 (if pretest-p |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
111 report-emacs-bug-pretest-address |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
112 report-emacs-bug-address))) |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
113 (if pretest-p |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
114 (insert ".\n\n") |
05a619c13dea
(report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents:
35437
diff
changeset
|
115 (insert ",\nand to the gnu.emacs.bug news group.\n\n"))) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
116 |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
117 (insert "In " (emacs-version) "\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
118 (if (and system-configuration-options |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
119 (not (equal system-configuration-options ""))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
120 (insert "configured using `configure " |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
121 system-configuration-options "'\n")) |
35427
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
122 (insert "Important settings:\n") |
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
123 (insert (format " value of $LC_ALL: %s\n" (getenv "LC_ALL"))) |
35437
b7516d64c95e
(report-emacs-bug): Report the value of LC_CTYPE, not LC_TYPE.
Eli Zaretskii <eliz@gnu.org>
parents:
35427
diff
changeset
|
124 (insert (format " value of $LC_CTYPE: %s\n" (getenv "LC_CTYPE"))) |
35427
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
125 (insert (format " value of $LANG: %s\n" (getenv "LANG"))) |
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
126 (insert (format " locale-coding-system: %s\n" locale-coding-system)) |
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
127 (insert (format " default-enable-multibyte-characters: %s\n" |
21fa311a0352
(report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents:
33153
diff
changeset
|
128 default-enable-multibyte-characters)) |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
129 (insert "\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
130 (insert "Please describe exactly what actions triggered the bug\n" |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
131 "and the precise symptoms of the bug:\n\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
132 (setq user-point (point)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
133 (insert "\n\n\n" |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
134 "Recent input:\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
135 (let ((before-keys (point))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
136 (insert (mapconcat (lambda (key) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
137 (if (or (integerp key) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
138 (symbolp key) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
139 (listp key)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
140 (single-key-description key) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
141 (prin1-to-string key nil))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
142 (or recent-keys (recent-keys)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
143 " ")) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
144 (save-restriction |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
145 (narrow-to-region before-keys (point)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
146 (goto-char before-keys) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
147 (while (progn (move-to-column 50) (not (eobp))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
148 (search-forward " " nil t) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
149 (insert "\n")))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
150 (let ((message-buf (get-buffer "*Messages*"))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
151 (if message-buf |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
152 (let (beg-pos |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
153 (end-pos message-end-point)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
154 (with-current-buffer message-buf |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
155 (goto-char end-pos) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
156 (forward-line -10) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
157 (setq beg-pos (point))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
158 (insert "\n\nRecent messages:\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
159 (insert-buffer-substring message-buf beg-pos end-pos)))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
160 ;; This is so the user has to type something |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
161 ;; in order to send easily. |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
162 (use-local-map (nconc (make-sparse-keymap) (current-local-map))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
163 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info) |
21975
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
164 (unless report-emacs-bug-no-explanations |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
165 (with-output-to-temp-buffer "*Bug Help*" |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
166 (if (eq mail-user-agent 'sendmail-user-agent) |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
167 (princ (substitute-command-keys |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
168 "Type \\[mail-send-and-exit] to send the bug report.\n"))) |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
169 (princ (substitute-command-keys |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
170 "Type \\[kill-buffer] RET to cancel (don't send it).\n")) |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
171 (terpri) |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
172 (princ (substitute-command-keys |
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
173 "Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section |
12155
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
174 about when and how to write a bug report, |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
175 and what information to supply so that the bug can be fixed. |
21975
386e14726b59
(report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents:
21974
diff
changeset
|
176 Type SPC to scroll through this section and its subsections.")))) |
20052
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
177 ;; Make it less likely people will send empty messages. |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
178 (make-local-variable 'mail-send-hook) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
179 (add-hook 'mail-send-hook 'report-emacs-bug-hook) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
180 (save-excursion |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
181 (goto-char (point-max)) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
182 (skip-chars-backward " \t\n") |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
183 (make-local-variable 'report-emacs-bug-orig-text) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
184 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point)))) |
38942e2dfffa
(report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents:
18827
diff
changeset
|
185 (goto-char user-point))) |
8130
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
186 |
12155
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
187 (defun report-emacs-bug-info () |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
188 "Go to the Info node on reporting Emacs bugs." |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
189 (interactive) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
190 (info) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
191 (Info-directory) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
192 (Info-menu "emacs") |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
193 (Info-goto-node "Bugs")) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
194 |
8130
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
195 (defun report-emacs-bug-hook () |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
196 (save-excursion |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
197 (goto-char (point-max)) |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
198 (skip-chars-backward " \t\n") |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
199 (if (and (= (- (point) (point-min)) |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
200 (length report-emacs-bug-orig-text)) |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
201 (equal (buffer-substring (point-min) (point)) |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
202 report-emacs-bug-orig-text)) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
203 (error "No text entered in bug report")) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
204 |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
205 ;; Check the buffer contents and reject non-English letters. |
21360
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
206 (save-excursion |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
207 (goto-char (point-min)) |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
208 (skip-chars-forward "\0-\177") |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
209 (if (not (eobp)) |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
210 (if (or report-emacs-bug-no-confirmation |
18826
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
211 (y-or-n-p "Convert non-ASCII letters to hexadecimal? ")) |
21360
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
212 (while (progn (skip-chars-forward "\0-\177") |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
213 (not (eobp))) |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
214 (let ((ch (following-char))) |
238c1cd70a27
(report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents:
21353
diff
changeset
|
215 (delete-char 1) |
21498
e69604162c2b
(report-emacs-bug-hook): Don't absolutely
Karl Heuer <kwzh@gnu.org>
parents:
21360
diff
changeset
|
216 (insert (format "=%02x" ch))))))) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
217 |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
218 ;; The last warning for novice users. |
20774
d56dca77717a
(emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents:
20052
diff
changeset
|
219 (if (or report-emacs-bug-no-confirmation |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
220 (yes-or-no-p |
18826
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
221 "Send this bug report to the Emacs maintainers? ")) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
222 ;; Just send the current mail. |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
223 nil |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
224 (goto-char (point-min)) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
225 (if (search-forward "To: ") |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
226 (let ((pos (point))) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
227 (end-of-line) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
228 (delete-region pos (point)))) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
229 (kill-local-variable 'mail-send-hook) |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
230 (with-output-to-temp-buffer "*Bug Help*" |
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
231 (princ (substitute-command-keys "\ |
18826
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
232 You invoked the command M-x report-emacs-bug, |
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
233 but you decided not to mail the bug report to the Emacs maintainers. |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
234 |
18826
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
235 If you want to mail it to someone else instead, |
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
236 please insert the proper e-mail address after \"To: \", |
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
237 and send the mail again using \\[mail-send-and-exit]."))) |
cb22b83e1bf8
Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents:
18795
diff
changeset
|
238 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer")) |
18795
3446ea06d63f
(report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents:
18608
diff
changeset
|
239 )) |
36 | 240 |
2348
581cda633215
Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2307
diff
changeset
|
241 (provide 'emacsbug) |
581cda633215
Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2307
diff
changeset
|
242 |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
474
diff
changeset
|
243 ;;; emacsbug.el ends here |