annotate lisp/mail/emacsbug.el @ 19082:e159c69a45f0

(term-ignore-error): Fix foolish errors.
author Richard M. Stallman <rms@gnu.org>
date Sat, 02 Aug 1997 20:41:55 +0000
parents ac7814d08294
children 38942e2dfffa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
18827
ac7814d08294 Update copyright year.
Richard M. Stallman <rms@gnu.org>
parents: 18826
diff changeset
3 ;; Copyright (C) 1985, 1994, 1997 Free Software Foundation, Inc.
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
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
2247
2c7997f249eb Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
7 ;; Keywords: maint
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
8
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
9 ;; Not fully installed because it can work only on Internet hosts.
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
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
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
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
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15 ;; any later version.
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
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13816
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13816
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13816
diff changeset
25 ;; Boston, MA 02111-1307, USA.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
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
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
33
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
34 ;; >> This should be an address which is accessible to your machine,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
35 ;; >> otherwise you can't use this file. It will only work on the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
36 ;; >> internet with this address.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
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
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
40 (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu"
14815
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
41 "Address of mailing list for GNU Emacs bugs.")
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
42
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
43 (defvar report-emacs-bug-pretest-address "emacs-pretest-bug@gnu.ai.mit.edu"
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
44 "Address of mailing list for GNU Emacs pretest bugs.")
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
45
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
46 (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
47 "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
48
474
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 201
diff changeset
49 ;;;###autoload
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
50 (defvar report-emacs-bug-run-tersely nil
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
51 "*If non-nil, suppress confirmations for novice users.")
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
52
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
53 ;;;###autoload
16576
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
54 (defun report-emacs-bug (topic &optional recent-keys)
474
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 201
diff changeset
55 "Report a bug in GNU Emacs.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
56 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
57 ;; 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
58 ;; the bug subject string is read.
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
59 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: "))))
16775
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
60 (condition-case nil
18608
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
61 (let (user-point message-end-point)
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
62 (setq message-end-point
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
63 (with-current-buffer (get-buffer "*Messages*")
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
64 (point-max-marker)))
16775
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
65 (compose-mail (if (string-match "\\..*\\..*\\." emacs-version)
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
66 ;; If there are four numbers in emacs-version,
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
67 ;; this is a pretest version.
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
68 report-emacs-bug-pretest-address
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
69 bug-gnu-emacs)
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
70 topic)
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
71 ;; The rest of this does not execute
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
72 ;; if the user was asked to confirm and said no.
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
73 (goto-char (point-min))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
74 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n"))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
75 ;; Insert warnings for novice users.
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
76 (insert "This bug report will be sent to the Free Software Foundation,\n")
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
77 (let ((pos (point)))
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
78 (insert " not to your local site managers!!")
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
79 (put-text-property pos (point) 'face 'highlight))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
80 (insert "\nPlease write in ")
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
81 (let ((pos (point)))
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
82 (insert "English")
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
83 (put-text-property pos (point) 'face 'highlight))
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
84 (insert ", because the Emacs maintainers do not have
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
85 translators to read other languages for them.\n\n")
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
86
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
87 (insert "In " (emacs-version) "\n")
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
88 (if (and system-configuration-options
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
89 (not (equal system-configuration-options "")))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
90 (insert "configured using `configure "
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
91 system-configuration-options "'\n"))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
92 (insert "\n")
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
93 (insert "Please describe exactly what actions triggered the bug\n"
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
94 "and the precise symptoms of the bug:\n\n")
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
95 (setq user-point (point))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
96 (insert "\n\n\n"
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
97 "Recent input:\n")
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
98 (let ((before-keys (point)))
14280
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
99 (insert (mapconcat (lambda (key)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
100 (if (or (integerp key)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
101 (symbolp key)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
102 (listp key))
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
103 (single-key-description key)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
104 (prin1-to-string key nil)))
16576
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
105 (or recent-keys (recent-keys))
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
106 " "))
14280
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
107 (save-restriction
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
108 (narrow-to-region before-keys (point))
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
109 (goto-char before-keys)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
110 (while (progn (move-to-column 50) (not (eobp)))
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
111 (search-forward " " nil t)
0134b04bc92d (report-emacs-bug): Insert newlines only in the inserted key descriptions.
Erik Naggum <erik@naggum.no>
parents: 14169
diff changeset
112 (insert "\n"))))
13816
777c7668b8b0 (report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents: 13795
diff changeset
113 (let ((message-buf (get-buffer "*Messages*")))
777c7668b8b0 (report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents: 13795
diff changeset
114 (if message-buf
18608
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
115 (let (beg-pos
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
116 (end-pos message-end-point))
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
117 (with-current-buffer message-buf
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
118 (goto-char end-pos)
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
119 (forward-line -10)
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
120 (setq beg-pos (point)))
13816
777c7668b8b0 (report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents: 13795
diff changeset
121 (insert "\n\nRecent messages:\n")
18608
9e7f6d074138 (report-emacs-bug): Don't include messages
Richard M. Stallman <rms@gnu.org>
parents: 18574
diff changeset
122 (insert-buffer-substring message-buf beg-pos end-pos))))
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
123 ;; This is so the user has to type something
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
124 ;; in order to send easily.
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
125 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
126 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
127 (with-output-to-temp-buffer "*Bug Help*"
18574
19f99191b11d Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18568
diff changeset
128 (if (eq mail-user-agent 'sendmail-user-agent)
18568
5f22717861fa (report-emacs-bug): Don't assume the exit command
Richard M. Stallman <rms@gnu.org>
parents: 16775
diff changeset
129 (princ (substitute-command-keys
5f22717861fa (report-emacs-bug): Don't assume the exit command
Richard M. Stallman <rms@gnu.org>
parents: 16775
diff changeset
130 "Type \\[mail-send-and-exit] to send the bug report.\n")))
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
131 (princ (substitute-command-keys
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
132 "Type \\[kill-buffer] RET to cancel (don't send it).\n"))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
133 (terpri)
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
134 (princ (substitute-command-keys
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
135 "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
136 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
137 and what information to supply so that the bug can be fixed.
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
138 Type SPC to scroll through this section and its subsections.")))
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
139 ;; Make it less likely people will send empty messages.
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
140 (make-local-variable 'mail-send-hook)
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
141 (add-hook 'mail-send-hook 'report-emacs-bug-hook)
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
142 ;; Discourage users to write non-English text.
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
143 (setq enable-multibyte-characters nil)
13795
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
144 (save-excursion
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
145 (goto-char (point-max))
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
146 (skip-chars-backward " \t\n")
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
147 (make-local-variable 'report-emacs-bug-orig-text)
7665c2422011 (report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents: 13251
diff changeset
148 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point))))
16775
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
149 (goto-char user-point))
36a661aac20a (report-emacs-bug): Use compose-mail.
Richard M. Stallman <rms@gnu.org>
parents: 16576
diff changeset
150 (error nil)))
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
151
12155
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
152 (defun report-emacs-bug-info ()
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
153 "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
154 (interactive)
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
155 (info)
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
156 (Info-directory)
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
157 (Info-menu "emacs")
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
158 (Info-goto-node "Bugs"))
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
159
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
160 (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
161 (save-excursion
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
162 (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
163 (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
164 (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
165 (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
166 (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
167 report-emacs-bug-orig-text))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
168 (error "No text entered in bug report"))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
169
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
170 ;; Check the buffer contents and reject non-English letters.
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
171 (let ((charsets (delq 'ascii
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
172 (find-charset-region (point-min) (point-max)))))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
173 (if charsets
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
174 (if (or report-emacs-bug-run-tersely
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
175 (y-or-n-p "Convert non-ASCII letters to hexadecimal? "))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
176 (save-excursion
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
177 (goto-char (point-min))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
178 (let ((enable-multibyte-characters nil)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
179 (pattern (format "[%c-%c]" 128 255))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
180 ch)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
181 (while (re-search-forward pattern nil t)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
182 (setq ch (preceding-char))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
183 (delete-char -1)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
184 (insert (format "=%02x" ch)))))
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
185 (error "Please convert non-ASCII characters to something else"))))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
186
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
187 ;; The last warning for novice users.
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
188 (if (or report-emacs-bug-run-tersely
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
189 (yes-or-no-p
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
190 "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
191 ;; Just send the current mail.
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
192 nil
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
193 (goto-char (point-min))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
194 (if (search-forward "To: ")
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
195 (let ((pos (point)))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
196 (end-of-line)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
197 (delete-region pos (point))))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
198 (kill-local-variable 'mail-send-hook)
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
199 (with-output-to-temp-buffer "*Bug Help*"
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
200 (princ (substitute-command-keys "\
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
201 You invoked the command M-x report-emacs-bug,
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
202 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
203
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
204 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
205 please insert the proper e-mail address after \"To: \",
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
206 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
207 (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
208 ))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
209
2348
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
210 (provide 'emacsbug)
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
211
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
212 ;;; emacsbug.el ends here