diff options
| author | Richard M. Stallman | 1994-07-03 20:34:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-03 20:34:19 +0000 |
| commit | e24ec555cbabbea5c9650dce52530c9ef0ecde30 (patch) | |
| tree | 8c588eb19b181ce750298eb058a1f58e3fe7087a | |
| parent | de17da156ffa69a35e89a8aa6eb1828b4feb8817 (diff) | |
| download | emacs-e24ec555cbabbea5c9650dce52530c9ef0ecde30.tar.gz emacs-e24ec555cbabbea5c9650dce52530c9ef0ecde30.zip | |
(report-emacs-bug-hook): Error if user has added no text.
(report-emacs-bug): Set local report-emacs-bug-orig-text.
Add to mail-send-hook. Use mail-send-and-exit for the echo area msg.
| -rw-r--r-- | lisp/mail/emacsbug.el | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 26556a08ad6..c722fe5db17 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el | |||
| @@ -39,6 +39,12 @@ | |||
| 39 | (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu" | 39 | (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu" |
| 40 | "Address of site maintaining mailing list for GNU Emacs bugs.") | 40 | "Address of site maintaining mailing list for GNU Emacs bugs.") |
| 41 | 41 | ||
| 42 | (defvar report-emacs-bug-orig-size nil | ||
| 43 | "Size of automatically-created initial text of bug report.") | ||
| 44 | |||
| 45 | (defvar report-emacs-bug-orig-text nil | ||
| 46 | "The automatically-created initial text of bug report.") | ||
| 47 | |||
| 42 | ;;;###autoload | 48 | ;;;###autoload |
| 43 | (defun report-emacs-bug (topic) | 49 | (defun report-emacs-bug (topic) |
| 44 | "Report a bug in GNU Emacs. | 50 | "Report a bug in GNU Emacs. |
| @@ -48,7 +54,25 @@ Prompts for bug subject. Leaves you in a mail buffer." | |||
| 48 | (goto-char (point-min)) | 54 | (goto-char (point-min)) |
| 49 | (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) | 55 | (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) |
| 50 | (insert "In " (emacs-version) "\n\n") | 56 | (insert "In " (emacs-version) "\n\n") |
| 51 | (message (substitute-command-keys "Type \\[mail-send] to send bug report."))) | 57 | (message (substitute-command-keys "Type \\[mail-send-and-exit] to send bug report.")) |
| 58 | ;; Make it less likely people will send empty messages. | ||
| 59 | (make-local-variable 'mail-send-hook) | ||
| 60 | (add-hook 'mail-send-hook 'report-emacs-bug-hook) | ||
| 61 | (save-excursion | ||
| 62 | (goto-char (point-max)) | ||
| 63 | (skip-chars-backward " \t\n") | ||
| 64 | (make-local-variable 'report-emacs-bug-orig-text) | ||
| 65 | (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point))))) | ||
| 66 | |||
| 67 | (defun report-emacs-bug-hook () | ||
| 68 | (save-excursion | ||
| 69 | (goto-char (point-max)) | ||
| 70 | (skip-chars-backward " \t\n") | ||
| 71 | (if (and (= (- (point) (point-min)) | ||
| 72 | (length report-emacs-bug-orig-text)) | ||
| 73 | (equal (buffer-substring (point-min) (point)) | ||
| 74 | report-emacs-bug-orig-text)) | ||
| 75 | (error "No text entered in bug report")))) | ||
| 52 | 76 | ||
| 53 | (provide 'emacsbug) | 77 | (provide 'emacsbug) |
| 54 | 78 | ||