comparison lisp/mail/emacsbug.el @ 13795:7665c2422011

(report-emacs-bug): If `mail' asks for confirmation and the user doesn't give it, don't do anything more. Explain a way to cancel the message. Include recent keys and recent *Messages* messages at end.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 17:40:55 +0000
parents a9a0c4c57a07
children 777c7668b8b0
comparison
equal deleted inserted replaced
13794:47cdd806fcfc 13795:7665c2422011
45 ;;;###autoload 45 ;;;###autoload
46 (defun report-emacs-bug (topic) 46 (defun report-emacs-bug (topic)
47 "Report a bug in GNU Emacs. 47 "Report a bug in GNU Emacs.
48 Prompts for bug subject. Leaves you in a mail buffer." 48 Prompts for bug subject. Leaves you in a mail buffer."
49 (interactive "sBug Subject: ") 49 (interactive "sBug Subject: ")
50 (mail nil bug-gnu-emacs topic) 50 (if (mail nil bug-gnu-emacs topic)
51 (goto-char (point-min)) 51 (let (user-point)
52 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) 52 ;; The rest of this does not execute
53 (insert "In " (emacs-version) "\n") 53 ;; if the user was asked to confirm and said no.
54 (if (and system-configuration-options 54 (goto-char (point-min))
55 (not (equal system-configuration-options ""))) 55 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n"))
56 (insert "configured using `configure " 56 (insert "In " (emacs-version) "\n")
57 system-configuration-options "'\n")) 57 (if (and system-configuration-options
58 (insert "\n") 58 (not (equal system-configuration-options "")))
59 ;; This is so the user has to type something 59 (insert "configured using `configure "
60 ;; in order to send easily. 60 system-configuration-options "'\n"))
61 (use-local-map (nconc (make-sparse-keymap) (current-local-map))) 61 (insert "\n")
62 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info) 62 (insert "Please describe exactly what actions triggered the bug\n"
63 (with-output-to-temp-buffer "*Bug Help*" 63 "and the precise symptoms of the bug:\n\n")
64 (princ (substitute-command-keys 64 (setq user-point (point))
65 "Type \\[mail-send-and-exit] to send the bug report.\n")) 65 (insert "\n\n\n"
66 (terpri) 66 "Recent input:\n")
67 (princ (substitute-command-keys 67 (let ((before-keys (point)))
68 "Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section 68 (insert (mapconcat (function (lambda (key)
69 (if (or (integerp key)
70 (symbolp key)
71 (listp key))
72 (single-key-description key)
73 (prin1-to-string key nil))))
74 (recent-keys)
75 " "))
76 (goto-char before-keys)
77 (while (progn (move-to-column 50) (not (eobp)))
78 (search-forward " " nil t)
79 (insert "\n")))
80 (insert "\n\n")
81 (insert "Recent messages:\n")
82 (insert-buffer-substring "*Messages*"
83 (save-excursion
84 (set-buffer "*Messages*")
85 (goto-char (point-max))
86 (forward-line -10)
87 (point))
88 (save-excursion
89 (set-buffer "*Messages*")
90 (point-max)))
91 ;; This is so the user has to type something
92 ;; in order to send easily.
93 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
94 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
95 (with-output-to-temp-buffer "*Bug Help*"
96 (princ (substitute-command-keys
97 "Type \\[mail-send-and-exit] to send the bug report.\n"))
98 (princ (substitute-command-keys
99 "Type \\[kill-buffer] RET to cancel (don't send it).\n"))
100 (terpri)
101 (princ (substitute-command-keys
102 "Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
69 about when and how to write a bug report, 103 about when and how to write a bug report,
70 and what information to supply so that the bug can be fixed. 104 and what information to supply so that the bug can be fixed.
71 Type SPC to scroll through this section and its subsections."))) 105 Type SPC to scroll through this section and its subsections.")))
72 ;; Make it less likely people will send empty messages. 106 ;; Make it less likely people will send empty messages.
73 (make-local-variable 'mail-send-hook) 107 (make-local-variable 'mail-send-hook)
74 (add-hook 'mail-send-hook 'report-emacs-bug-hook) 108 (add-hook 'mail-send-hook 'report-emacs-bug-hook)
75 (save-excursion 109 (save-excursion
76 (goto-char (point-max)) 110 (goto-char (point-max))
77 (skip-chars-backward " \t\n") 111 (skip-chars-backward " \t\n")
78 (make-local-variable 'report-emacs-bug-orig-text) 112 (make-local-variable 'report-emacs-bug-orig-text)
79 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point))))) 113 (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point))))
114 (goto-char user-point))))
80 115
81 (defun report-emacs-bug-info () 116 (defun report-emacs-bug-info ()
82 "Go to the Info node on reporting Emacs bugs." 117 "Go to the Info node on reporting Emacs bugs."
83 (interactive) 118 (interactive)
84 (info) 119 (info)