Mercurial > emacs
annotate lisp/mail/emacsbug.el @ 14072:d6f46c53f2aa
(Fdump_emacs_data, Fdump_emacs): Harmonize arguments with documentation.
author | Erik Naggum <erik@naggum.no> |
---|---|
date | Tue, 09 Jan 1996 00:31:41 +0000 |
parents | 777c7668b8b0 |
children | 83f275dcd93a |
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 |
7300 | 3 ;; Copyright (C) 1985, 1994 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 |
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 | 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 | |
23 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
24 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
25 | |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
26 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
27 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
28 ;; `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
|
29 ;; 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
|
30 |
794
2598c08c91c2
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
31 ;;; Code: |
36 | 32 |
33 ;; >> This should be an address which is accessible to your machine, | |
34 ;; >> otherwise you can't use this file. It will only work on the | |
35 ;; >> internet with this address. | |
36 | |
6971
90859715093d
(report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents:
2348
diff
changeset
|
37 (require 'sendmail) |
90859715093d
(report-emacs-bug): Insert at separator, not at end.
Karl Heuer <kwzh@gnu.org>
parents:
2348
diff
changeset
|
38 |
36 | 39 (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu" |
201 | 40 "Address of site maintaining mailing list for GNU Emacs bugs.") |
36 | 41 |
8130
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
42 (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
|
43 "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
|
44 |
474 | 45 ;;;###autoload |
36 | 46 (defun report-emacs-bug (topic) |
474 | 47 "Report a bug in GNU Emacs. |
36 | 48 Prompts for bug subject. Leaves you in a mail buffer." |
49 (interactive "sBug Subject: ") | |
13795
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
50 (if (mail nil bug-gnu-emacs topic) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
51 (let (user-point) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
52 ;; 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
|
53 ;; 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
|
54 (goto-char (point-min)) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
55 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
56 (insert "In " (emacs-version) "\n") |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
57 (if (and system-configuration-options |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
58 (not (equal system-configuration-options ""))) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
59 (insert "configured using `configure " |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
60 system-configuration-options "'\n")) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
61 (insert "\n") |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
62 (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
|
63 "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
|
64 (setq user-point (point)) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
65 (insert "\n\n\n" |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
66 "Recent input:\n") |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
67 (let ((before-keys (point))) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
68 (insert (mapconcat (function (lambda (key) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
69 (if (or (integerp key) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
70 (symbolp key) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
71 (listp key)) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
72 (single-key-description key) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
73 (prin1-to-string key nil)))) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
74 (recent-keys) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
75 " ")) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
76 (goto-char before-keys) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
77 (while (progn (move-to-column 50) (not (eobp))) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
78 (search-forward " " nil t) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
79 (insert "\n"))) |
13816
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
80 (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
|
81 (if message-buf |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
82 (progn |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
83 (insert "\n\nRecent messages:\n") |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
84 (insert-buffer-substring message-buf |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
85 (save-excursion |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
86 (set-buffer message-buf) |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
87 (goto-char (point-max)) |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
88 (forward-line -10) |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
89 (point)) |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
90 (save-excursion |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
91 (set-buffer message-buf) |
777c7668b8b0
(report-emacs-bug): Don't die if *Messages* buf is gone.
Karl Heuer <kwzh@gnu.org>
parents:
13795
diff
changeset
|
92 (point-max)))))) |
13795
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
93 ;; 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
|
94 ;; in order to send easily. |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
95 (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
|
96 (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
|
97 (with-output-to-temp-buffer "*Bug Help*" |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
98 (princ (substitute-command-keys |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
99 "Type \\[mail-send-and-exit] to send the bug report.\n")) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
100 (princ (substitute-command-keys |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
101 "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
|
102 (terpri) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
103 (princ (substitute-command-keys |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
104 "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
|
105 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
|
106 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
|
107 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
|
108 ;; 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
|
109 (make-local-variable 'mail-send-hook) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
110 (add-hook 'mail-send-hook 'report-emacs-bug-hook) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
111 (save-excursion |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
112 (goto-char (point-max)) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
113 (skip-chars-backward " \t\n") |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
114 (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
|
115 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point)))) |
7665c2422011
(report-emacs-bug): If `mail' asks for confirmation
Karl Heuer <kwzh@gnu.org>
parents:
13251
diff
changeset
|
116 (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
|
117 |
12155
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
118 (defun report-emacs-bug-info () |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
119 "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
|
120 (interactive) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
121 (info) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
122 (Info-directory) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
123 (Info-menu "emacs") |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
124 (Info-goto-node "Bugs")) |
63887def546f
(report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents:
8921
diff
changeset
|
125 |
8130
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
126 (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
|
127 (save-excursion |
c84ecb24316c
(report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
128 (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
|
129 (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
|
130 (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
|
131 (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
|
132 (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
|
133 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
|
134 (error "No text entered in bug report")))) |
36 | 135 |
2348
581cda633215
Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2307
diff
changeset
|
136 (provide 'emacsbug) |
581cda633215
Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2307
diff
changeset
|
137 |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
474
diff
changeset
|
138 ;;; emacsbug.el ends here |