Mercurial > emacs
comparison lisp/mail/emacsbug.el @ 45346:abf76eedb517
(report-emacs-bug-text-prompt): New variable.
(report-emacs-bug): Store the prompt in
`report-emacs-bug-text-prompt'. Move Configuration/Important settings
information after the user's report.
(report-emacs-bug-hook): Unclutter by deleting the content of
`report-emacs-bug-text-prompt'.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Sat, 18 May 2002 19:18:46 +0000 |
parents | b9f48b248687 |
children | 845f37c81b22 |
comparison
equal
deleted
inserted
replaced
45345:1f3817058799 | 45346:abf76eedb517 |
---|---|
52 :group 'emacsbug | 52 :group 'emacsbug |
53 :type 'string) | 53 :type 'string) |
54 | 54 |
55 (defvar report-emacs-bug-orig-text nil | 55 (defvar report-emacs-bug-orig-text nil |
56 "The automatically-created initial text of bug report.") | 56 "The automatically-created initial text of bug report.") |
57 | |
58 (defvar report-emacs-bug-text-prompt nil | |
59 "The automatically-created initial prompt of bug report.") | |
57 | 60 |
58 (defcustom report-emacs-bug-no-confirmation nil | 61 (defcustom report-emacs-bug-no-confirmation nil |
59 "*If non-nil, suppress the confirmations asked for the sake of novice users." | 62 "*If non-nil, suppress the confirmations asked for the sake of novice users." |
60 :group 'emacsbug | 63 :group 'emacsbug |
61 :type 'boolean) | 64 :type 'boolean) |
73 ;; the bug subject string is read. | 76 ;; the bug subject string is read. |
74 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: ")))) | 77 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: ")))) |
75 ;; If there are four numbers in emacs-version, this is a pretest | 78 ;; If there are four numbers in emacs-version, this is a pretest |
76 ;; version. | 79 ;; version. |
77 (let ((pretest-p (string-match "\\..*\\..*\\." emacs-version)) | 80 (let ((pretest-p (string-match "\\..*\\..*\\." emacs-version)) |
78 user-point message-end-point) | 81 user-point prompt-beg-point message-end-point) |
79 (setq message-end-point | 82 (setq message-end-point |
80 (with-current-buffer (get-buffer-create "*Messages*") | 83 (with-current-buffer (get-buffer-create "*Messages*") |
81 (point-max-marker))) | 84 (point-max-marker))) |
82 (compose-mail (if pretest-p | 85 (compose-mail (if pretest-p |
83 report-emacs-bug-pretest-address | 86 report-emacs-bug-pretest-address |
90 | 93 |
91 (let ((signature (buffer-substring (point) (point-max)))) | 94 (let ((signature (buffer-substring (point) (point-max)))) |
92 (delete-region (point) (point-max)) | 95 (delete-region (point) (point-max)) |
93 (insert signature) | 96 (insert signature) |
94 (backward-char (length signature))) | 97 (backward-char (length signature))) |
98 (setq prompt-beg-point (point)) | |
95 (unless report-emacs-bug-no-explanations | 99 (unless report-emacs-bug-no-explanations |
96 ;; Insert warnings for novice users. | 100 ;; Insert warnings for novice users. |
97 (insert "This bug report will be sent to the Free Software Foundation,\n") | 101 (insert "This bug report will be sent to the Free Software Foundation,\n") |
98 (let ((pos (point))) | 102 (let ((pos (point))) |
99 (insert "not to your local site managers!") | 103 (insert "not to your local site managers!") |
110 report-emacs-bug-address))) | 114 report-emacs-bug-address))) |
111 (if pretest-p | 115 (if pretest-p |
112 (insert ".\n\n") | 116 (insert ".\n\n") |
113 (insert ",\nand to the gnu.emacs.bug news group.\n\n"))) | 117 (insert ",\nand to the gnu.emacs.bug news group.\n\n"))) |
114 | 118 |
119 (insert "Please describe exactly what actions triggered the bug\n" | |
120 "and the precise symptoms of the bug:") | |
121 (setq report-emacs-bug-text-prompt | |
122 (buffer-substring prompt-beg-point (point))) | |
123 | |
124 (insert "\n\n") | |
125 (setq user-point (point)) | |
126 (insert "\n\n\n") | |
127 | |
115 (insert "In " (emacs-version) "\n") | 128 (insert "In " (emacs-version) "\n") |
116 (if (and system-configuration-options | 129 (if (and system-configuration-options |
117 (not (equal system-configuration-options ""))) | 130 (not (equal system-configuration-options ""))) |
118 (insert "configured using `configure " | 131 (insert "configured using `configure " |
119 system-configuration-options "'\n")) | 132 system-configuration-options "'\n\n")) |
120 (insert "Important settings:\n") | 133 (insert "Important settings:\n") |
121 (mapcar | 134 (mapcar |
122 '(lambda (var) | 135 '(lambda (var) |
123 (insert (format " value of $%s: %s\n" var (getenv var)))) | 136 (insert (format " value of $%s: %s\n" var (getenv var)))) |
124 '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" | 137 '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" |
125 "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG")) | 138 "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG")) |
126 (insert (format " locale-coding-system: %s\n" locale-coding-system)) | 139 (insert (format " locale-coding-system: %s\n" locale-coding-system)) |
127 (insert (format " default-enable-multibyte-characters: %s\n" | 140 (insert (format " default-enable-multibyte-characters: %s\n" |
128 default-enable-multibyte-characters)) | 141 default-enable-multibyte-characters)) |
129 (insert "\n") | 142 (insert "\n") |
130 (insert "Please describe exactly what actions triggered the bug\n" | 143 (insert "Recent input:\n") |
131 "and the precise symptoms of the bug:\n\n") | |
132 (setq user-point (point)) | |
133 (insert "\n\n\n" | |
134 "Recent input:\n") | |
135 (let ((before-keys (point))) | 144 (let ((before-keys (point))) |
136 (insert (mapconcat (lambda (key) | 145 (insert (mapconcat (lambda (key) |
137 (if (or (integerp key) | 146 (if (or (integerp key) |
138 (symbolp key) | 147 (symbolp key) |
139 (listp key)) | 148 (listp key)) |
237 and send the mail again using \\[mail-send-and-exit]."))) | 246 and send the mail again using \\[mail-send-and-exit]."))) |
238 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer")) | 247 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer")) |
239 | 248 |
240 ;; Unclutter | 249 ;; Unclutter |
241 (mail-text) | 250 (mail-text) |
242 (let ((p (point))) | 251 (if (looking-at report-emacs-bug-text-prompt) |
243 (if (re-search-forward (concat "^In " (emacs-version)) nil t) | 252 (replace-match "Symptoms:")))) |
244 (delete-region p (match-beginning 0)))) | |
245 (if (re-search-forward "Please describe.+\n.+precise symptoms.+bug:\n*" | |
246 (point-max) t) | |
247 (replace-match "Symptoms:\n")))) | |
248 | 253 |
249 (provide 'emacsbug) | 254 (provide 'emacsbug) |
250 | 255 |
251 ;;; emacsbug.el ends here | 256 ;;; emacsbug.el ends here |