comparison lisp/mail/emacsbug.el @ 68115:09374864b194

(report-emacs-bug-text-prompt): Delete var. (report-emacs-bug): Don't record initial prompt text. Instead, add text properties to prompting text. (report-emacs-bug-hook): Delete prompting text.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Tue, 10 Jan 2006 12:59:29 +0000
parents d16e53a3e227
children 067115a6e738 7beb78bc1f8e
comparison
equal deleted inserted replaced
68114:86ac787740e6 68115:09374864b194
53 :group 'emacsbug 53 :group 'emacsbug
54 :type 'string) 54 :type 'string)
55 55
56 (defvar report-emacs-bug-orig-text nil 56 (defvar report-emacs-bug-orig-text nil
57 "The automatically-created initial text of bug report.") 57 "The automatically-created initial text of bug report.")
58
59 (defvar report-emacs-bug-text-prompt nil
60 "The automatically-created initial prompt of bug report.")
61 58
62 (defcustom report-emacs-bug-no-confirmation nil 59 (defcustom report-emacs-bug-no-confirmation nil
63 "*If non-nil, suppress the confirmations asked for the sake of novice users." 60 "*If non-nil, suppress the confirmations asked for the sake of novice users."
64 :group 'emacsbug 61 :group 'emacsbug
65 :type 'boolean) 62 :type 'boolean)
81 (let* ((pretest-p (string-match "\\..*\\..*\\." emacs-version)) 78 (let* ((pretest-p (string-match "\\..*\\..*\\." emacs-version))
82 (from-buffer (current-buffer)) 79 (from-buffer (current-buffer))
83 (reporting-address (if pretest-p 80 (reporting-address (if pretest-p
84 report-emacs-bug-pretest-address 81 report-emacs-bug-pretest-address
85 report-emacs-bug-address)) 82 report-emacs-bug-address))
86 user-point prompt-beg-point message-end-point) 83 ;; Put these properties on semantically-void text.
84 (prompt-properties '(field emacsbug-prompt
85 intangible but-helpful
86 rear-nonsticky t))
87 user-point message-end-point)
87 (setq message-end-point 88 (setq message-end-point
88 (with-current-buffer (get-buffer-create "*Messages*") 89 (with-current-buffer (get-buffer-create "*Messages*")
89 (point-max-marker))) 90 (point-max-marker)))
90 (compose-mail reporting-address 91 (compose-mail reporting-address
91 topic) 92 topic)
96 97
97 (let ((signature (buffer-substring (point) (point-max)))) 98 (let ((signature (buffer-substring (point) (point-max))))
98 (delete-region (point) (point-max)) 99 (delete-region (point) (point-max))
99 (insert signature) 100 (insert signature)
100 (backward-char (length signature))) 101 (backward-char (length signature)))
101 (setq prompt-beg-point (point))
102 (unless report-emacs-bug-no-explanations 102 (unless report-emacs-bug-no-explanations
103 ;; Insert warnings for novice users. 103 ;; Insert warnings for novice users.
104 (when (string-match "@gnu\\.org^" reporting-address) 104 (when (string-match "@gnu\\.org^" reporting-address)
105 (insert "This bug report will be sent to the Free Software Foundation,\n") 105 (insert "This bug report will be sent to the Free Software Foundation,\n")
106 (let ((pos (point))) 106 (let ((pos (point)))
117 (if pretest-p 117 (if pretest-p
118 (insert ".\n\n") 118 (insert ".\n\n")
119 (insert ",\nand to the gnu.emacs.bug news group.\n\n"))) 119 (insert ",\nand to the gnu.emacs.bug news group.\n\n")))
120 120
121 (insert "Please describe exactly what actions triggered the bug\n" 121 (insert "Please describe exactly what actions triggered the bug\n"
122 "and the precise symptoms of the bug:") 122 "and the precise symptoms of the bug:\n\n")
123 (setq report-emacs-bug-text-prompt 123 (add-text-properties (point) (save-excursion (mail-text) (point))
124 (buffer-substring prompt-beg-point (point))) 124 prompt-properties)
125 125
126 (insert "\n\n")
127 (setq user-point (point)) 126 (setq user-point (point))
128 (insert "\n\n") 127 (insert "\n\n")
129 128
130 (insert "If emacs crashed, and you have the emacs process in the gdb debugger,\n" 129 (insert "If emacs crashed, and you have the emacs process in the gdb debugger,\n"
131 "please include the output from the following gdb commands:\n" 130 "please include the output from the following gdb commands:\n"
133 132
134 (let ((debug-file (expand-file-name "DEBUG" data-directory))) 133 (let ((debug-file (expand-file-name "DEBUG" data-directory)))
135 (if (file-readable-p debug-file) 134 (if (file-readable-p debug-file)
136 (insert "If you would like to further debug the crash, please read the file\n" 135 (insert "If you would like to further debug the crash, please read the file\n"
137 debug-file " for instructions.\n"))) 136 debug-file " for instructions.\n")))
137 (add-text-properties (1+ user-point) (point) prompt-properties)
138 138
139 (insert "\n\nIn " (emacs-version) "\n") 139 (insert "\n\nIn " (emacs-version) "\n")
140 (if (fboundp 'x-server-vendor) 140 (if (fboundp 'x-server-vendor)
141 (condition-case nil 141 (condition-case nil
142 (insert "X server distributor `" (x-server-vendor) "', version " 142 (insert "X server distributor `" (x-server-vendor) "', version "
272 and send the mail again using \\[mail-send-and-exit]."))) 272 and send the mail again using \\[mail-send-and-exit].")))
273 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer")) 273 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer"))
274 274
275 ;; Unclutter 275 ;; Unclutter
276 (mail-text) 276 (mail-text)
277 (if (looking-at report-emacs-bug-text-prompt) 277 (let ((pos (1- (point))))
278 (replace-match "Symptoms:")))) 278 (while (setq pos (text-property-any pos (point-max)
279 'field 'emacsbug-prompt))
280 (delete-region pos (field-end (1+ pos)))))))
279 281
280 (provide 'emacsbug) 282 (provide 'emacsbug)
281 283
282 ;;; arch-tag: 248b6523-c3b5-4fec-9a3f-0411fafa7d49 284 ;;; arch-tag: 248b6523-c3b5-4fec-9a3f-0411fafa7d49
283 ;;; emacsbug.el ends here 285 ;;; emacsbug.el ends here