annotate lisp/mail/emacsbug.el @ 106353:dec940ff2ab6

* mail/sendmail.el (mail-setup-hook, mail-send-hook): Doc fixes. * gnus/message.el (message-setup-hook, message-send-hook): Make into aliases for mail-*-hook.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 01 Dec 2009 16:20:59 +0000
parents 548e316508c5
children 16c633230547
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37671
diff changeset
1 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
2
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
3 ;; Copyright (C) 1985, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
5
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 794
diff changeset
6 ;; Author: K. Shane Hartman
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
7 ;; Maintainer: FSF
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
8 ;; Keywords: maint mail
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
9
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
11
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
15 ;; (at your option) any later version.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
16
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
24
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
25 ;;; Commentary:
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
26
46564
293b682578b5 Update copyright notice and fix typo in commentary section.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45381
diff changeset
27 ;; `M-x report-emacs-bug' starts an email note to the Emacs maintainers
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
28 ;; describing a problem. You need to be able to send mail from Emacs
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
29 ;; to complete the process. Alternatively, compose the bug report in
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
30 ;; Emacs then paste it into your normal mail client.
2307
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
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
33
6971
90859715093d (report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents: 2348
diff changeset
34 (require 'sendmail)
90859715093d (report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents: 2348
diff changeset
35
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
36 (defgroup emacsbug nil
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
37 "Sending Emacs bug reports."
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
38 :group 'maint
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
39 :group 'mail)
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
40
21360
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
41 (defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org"
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
42 "Address of mailing list for GNU Emacs bugs."
20797
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
43 :group 'emacsbug
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
44 :type 'string)
14815
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
45
21360
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
46 (defcustom report-emacs-bug-pretest-address "emacs-pretest-bug@gnu.org"
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
47 "Address of mailing list for GNU Emacs pretest bugs."
20797
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
48 :group 'emacsbug
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
49 :type 'string)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
50
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
51 (defcustom report-emacs-bug-no-confirmation nil
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
52 "If non-nil, suppress the confirmations asked for the sake of novice users."
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
53 :group 'emacsbug
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
54 :type 'boolean)
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
55
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
56 (defcustom report-emacs-bug-no-explanations nil
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
57 "If non-nil, suppress the explanations given for the sake of novice users."
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
58 :group 'emacsbug
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
59 :type 'boolean)
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
60
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
61 ;; User options end here.
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
62
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
63
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
64 (defvar report-emacs-bug-orig-text nil
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
65 "The automatically-created initial text of bug report.")
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
66
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
67 (declare-function x-server-vendor "xfns.c" (&optional terminal))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
68 (declare-function x-server-version "xfns.c" (&optional terminal))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
69
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
70 ;;;###autoload
16576
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
71 (defun report-emacs-bug (topic &optional recent-keys)
474
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 201
diff changeset
72 "Report a bug in GNU Emacs.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
73 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
74 ;; 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
75 ;; the bug subject string is read.
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
76 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: "))))
82382
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
77 ;; The syntax `version;' is preferred to `[version]' because the
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
78 ;; latter could be mistakenly stripped by mailing software.
82434
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
79 (if (eq system-type 'ms-dos)
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
80 (setq topic (concat emacs-version "; " topic))
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
81 (when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
82 (setq topic (concat (match-string 1 emacs-version) "; " topic))))
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
83 ;; If there are four numbers in emacs-version (three for MS-DOS),
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
84 ;; this is a pretest version.
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
85 (let* ((pretest-p (string-match (if (eq system-type 'ms-dos)
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
86 "\\..*\\."
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
87 "\\..*\\..*\\.")
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
88 emacs-version))
82382
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
89 (from-buffer (current-buffer))
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
90 (reporting-address (if pretest-p
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
91 report-emacs-bug-pretest-address
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
92 report-emacs-bug-address))
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
93 ;; Put these properties on semantically-void text.
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
94 (prompt-properties '(field emacsbug-prompt
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
95 intangible but-helpful
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
96 rear-nonsticky t))
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
97 user-point message-end-point)
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
98 (setq message-end-point
39067
781a740a46a0 (report-emacs-bug): Make sure *Messages*
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
99 (with-current-buffer (get-buffer-create "*Messages*")
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
100 (point-max-marker)))
68075
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
101 (compose-mail reporting-address
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
102 topic)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
103 ;; The rest of this does not execute
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
104 ;; 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
105 (rfc822-goto-eoh)
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
106 (forward-line 1)
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
107
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
108 (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
109 (delete-region (point) (point-max))
21974
42b308d86213 (report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents: 21869
diff changeset
110 (insert signature)
42b308d86213 (report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents: 21869
diff changeset
111 (backward-char (length signature)))
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
112 (unless report-emacs-bug-no-explanations
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
113 ;; Insert warnings for novice users.
68075
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
114 (when (string-match "@gnu\\.org^" reporting-address)
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
115 (insert "This bug report will be sent to the Free Software Foundation,\n")
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
116 (let ((pos (point)))
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
117 (insert "not to your local site managers!")
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
118 (put-text-property pos (point) 'face 'highlight)))
82382
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
119 (insert "\nPlease write in ")
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
120 (let ((pos (point)))
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
121 (insert "English")
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
122 (put-text-property pos (point) 'face 'highlight))
45273
b9f48b248687 (report-emacs-bug): Change the "English please" msg.
Richard M. Stallman <rms@gnu.org>
parents: 45027
diff changeset
123 (insert " if possible, because the Emacs maintainers
b9f48b248687 (report-emacs-bug): Change the "English please" msg.
Richard M. Stallman <rms@gnu.org>
parents: 45027
diff changeset
124 usually do not have translators to read other languages for them.\n\n")
35516
05a619c13dea (report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents: 35437
diff changeset
125 (insert (format "Your bug report will be posted to the %s mailing list"
68075
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
126 reporting-address))
35516
05a619c13dea (report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents: 35437
diff changeset
127 (if pretest-p
05a619c13dea (report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents: 35437
diff changeset
128 (insert ".\n\n")
05a619c13dea (report-emacs-bug): Mention the fact that the
Eli Zaretskii <eliz@gnu.org>
parents: 35437
diff changeset
129 (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
130
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
131 (insert "Please describe exactly what actions triggered the bug\n"
105808
548e316508c5 Remove odd/obsolete header comment.
Glenn Morris <rgm@gnu.org>
parents: 105757
diff changeset
132 "and the precise symptoms of the bug. If you can, give\n"
548e316508c5 Remove odd/obsolete header comment.
Glenn Morris <rgm@gnu.org>
parents: 105757
diff changeset
133 "a recipe starting from `emacs -Q':\n\n")
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
134 (add-text-properties (point) (save-excursion (mail-text) (point))
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
135 prompt-properties)
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
136
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
137 (setq user-point (point))
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
138 (insert "\n\n")
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
139
73738
266042c9bbc6 (report-emacs-bug): Fix typos in output message.
Juanma Barranquero <lekktu@gmail.com>
parents: 68648
diff changeset
140 (insert "If Emacs crashed, and you have the Emacs process in the gdb debugger,\n"
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
141 "please include the output from the following gdb commands:\n"
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
142 " `bt full' and `xbacktrace'.\n")
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
143
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
144 (let ((debug-file (expand-file-name "DEBUG" data-directory)))
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
145 (if (file-readable-p debug-file)
105723
438abba8b301 * mail/emacsbug.el (report-emacs-bug): Tweak the sentence pointing
Chong Yidong <cyd@stupidchicken.com>
parents: 105531
diff changeset
146 (insert "For information about debugging Emacs, please read the file\n"
438abba8b301 * mail/emacsbug.el (report-emacs-bug): Tweak the sentence pointing
Chong Yidong <cyd@stupidchicken.com>
parents: 105531
diff changeset
147 debug-file ".\n")))
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
148 (add-text-properties (1+ user-point) (point) prompt-properties)
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
149
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
150 (insert "\n\nIn " (emacs-version) "\n")
57768
84cd4892a56e * mail/emacsbug.el (report-emacs-bug): Insert x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 52757
diff changeset
151 (if (fboundp 'x-server-vendor)
58462
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
152 (condition-case nil
76450
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
153 ;; This is used not only for X11 but also W32 and others.
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
154 (insert "Windowing system distributor `" (x-server-vendor)
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
155 "', version "
58462
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
156 (mapconcat 'number-to-string (x-server-version) ".") "\n")
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
157 (error t)))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
158 (if (and system-configuration-options
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
159 (not (equal system-configuration-options "")))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
160 (insert "configured using `configure "
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
161 system-configuration-options "'\n\n"))
35427
21fa311a0352 (report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents: 33153
diff changeset
162 (insert "Important settings:\n")
84912
417443aefcdd (report-emacs-bug): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 82434
diff changeset
163 (mapc
37065
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
164 '(lambda (var)
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
165 (insert (format " value of $%s: %s\n" var (getenv var))))
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
166 '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES"
90701
ca120caa5838 (report-emacs-bug): Insert also the value of
Kenichi Handa <handa@m17n.org>
parents: 90650
diff changeset
167 "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS"))
35427
21fa311a0352 (report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents: 33153
diff changeset
168 (insert (format " locale-coding-system: %s\n" locale-coding-system))
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
169 (insert (format " default enable-multibyte-characters: %s\n"
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
170 (default-value 'enable-multibyte-characters)))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
171 (insert "\n")
52757
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
172 (insert (format "Major mode: %s\n"
87567
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
173 (format-mode-line
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
174 (buffer-local-value 'mode-name from-buffer)
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
175 nil nil from-buffer)))
52686
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
176 (insert "\n")
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
177 (insert "Minor modes in effect:\n")
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
178 (dolist (mode minor-mode-list)
52757
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
179 (and (boundp mode) (buffer-local-value mode from-buffer)
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
180 (insert (format " %s: %s\n" mode
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
181 (buffer-local-value mode from-buffer)))))
52686
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
182 (insert "\n")
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
183 (insert "Recent input:\n")
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
184 (let ((before-keys (point)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
185 (insert (mapconcat (lambda (key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
186 (if (or (integerp key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
187 (symbolp key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
188 (listp key))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
189 (single-key-description key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
190 (prin1-to-string key nil)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
191 (or recent-keys (recent-keys))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
192 " "))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
193 (save-restriction
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
194 (narrow-to-region before-keys (point))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
195 (goto-char before-keys)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
196 (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
197 (search-forward " " nil t)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
198 (insert "\n"))))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
199 (let ((message-buf (get-buffer "*Messages*")))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
200 (if message-buf
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
201 (let (beg-pos
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
202 (end-pos message-end-point))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
203 (with-current-buffer message-buf
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
204 (goto-char end-pos)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
205 (forward-line -10)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
206 (setq beg-pos (point)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
207 (insert "\n\nRecent messages:\n")
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
208 (insert-buffer-substring message-buf beg-pos end-pos))))
104022
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
209 ;; After Recent messages, to avoid the messages produced by
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
210 ;; list-load-path-shadows.
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
211 (unless (looking-back "\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
212 (insert "\n"))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
213 (insert "\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
214 (insert "Load-path shadows:\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
215 (message "Checking for load-path shadows...")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
216 (let ((shadows (list-load-path-shadows t)))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
217 (message "Checking for load-path shadows...done")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
218 (insert (if (zerop (length shadows))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
219 "None found.\n"
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
220 shadows)))
105531
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
221 (insert (format "\nFeatures:\n%s\n" features))
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
222 (fill-region (line-beginning-position 0) (point))
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
223 ;; This is so the user has to type something in order to send easily.
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
224 (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
225 (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
226 (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
227 (with-output-to-temp-buffer "*Bug Help*"
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
228 (princ "While in the mail buffer:\n\n")
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
229 (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
230 (princ (substitute-command-keys
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
231 " Type \\[mail-send-and-exit] to send the bug report.\n")))
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
232 (princ (substitute-command-keys
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
233 " Type \\[kill-buffer] RET to cancel (don't send it).\n"))
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
234 (terpri)
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
235 (princ (substitute-command-keys
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
236 " Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
237 about when and how to write a bug report, and what
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
238 information you should include to help fix the bug.")))
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
239 (shrink-window-if-larger-than-buffer (get-buffer-window "*Bug Help*")))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
240 ;; 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
241 (make-local-variable 'mail-send-hook)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
242 (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
243 (save-excursion
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
244 (goto-char (point-max))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
245 (skip-chars-backward " \t\n")
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
246 (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
247 (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
248 (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
249
12155
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
250 (defun report-emacs-bug-info ()
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
251 "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
252 (interactive)
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
253 (info "(emacs)Bugs"))
12155
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
254
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
255 (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
256 (save-excursion
45381
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
257 (save-excursion
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
258 (goto-char (point-max))
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
259 (skip-chars-backward " \t\n")
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
260 (if (and (= (- (point) (point-min))
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
261 (length report-emacs-bug-orig-text))
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
262 (equal (buffer-substring (point-min) (point))
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
263 report-emacs-bug-orig-text))
845f37c81b22 (report-emacs-bug-hook): Do another save-excursion.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45346
diff changeset
264 (error "No text entered in bug report")))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
265
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
266 ;; 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
267 (save-excursion
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
268 (goto-char (point-min))
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
269 (skip-chars-forward "\0-\177")
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
270 (if (not (eobp))
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
271 (if (or report-emacs-bug-no-confirmation
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
272 (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
273 (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
274 (not (eobp)))
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
275 (let ((ch (following-char)))
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
276 (delete-char 1)
21498
e69604162c2b (report-emacs-bug-hook): Don't absolutely
Karl Heuer <kwzh@gnu.org>
parents: 21360
diff changeset
277 (insert (format "=%02x" ch)))))))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
278
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
279 ;; The last warning for novice users.
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
280 (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
281 (yes-or-no-p
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
282 "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
283 ;; Just send the current mail.
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
284 nil
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
285 (goto-char (point-min))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
286 (if (search-forward "To: ")
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
287 (let ((pos (point)))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
288 (end-of-line)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
289 (delete-region pos (point))))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
290 (kill-local-variable 'mail-send-hook)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
291 (with-output-to-temp-buffer "*Bug Help*"
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
292 (princ (substitute-command-keys "\
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
293 You invoked the command M-x report-emacs-bug,
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
294 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
295
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
296 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
297 please insert the proper e-mail address after \"To: \",
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
298 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
299 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer"))
44056
448873845bcc (report-emacs-bug-hook): Remove submitter
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 39067
diff changeset
300
448873845bcc (report-emacs-bug-hook): Remove submitter
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 39067
diff changeset
301 ;; Unclutter
448873845bcc (report-emacs-bug-hook): Remove submitter
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 39067
diff changeset
302 (mail-text)
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
303 (let ((pos (1- (point))))
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
304 (while (setq pos (text-property-any pos (point-max)
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
305 'field 'emacsbug-prompt))
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
306 (delete-region pos (field-end (1+ pos)))))))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
307
2348
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
308 (provide 'emacsbug)
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
309
76450
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
310 ;; arch-tag: 248b6523-c3b5-4fec-9a3f-0411fafa7d49
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
311 ;;; emacsbug.el ends here