diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-07-03 20:34:19 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-07-03 20:34:19 +0000 |
commit | e24ec555cbabbea5c9650dce52530c9ef0ecde30 (patch) | |
tree | 8c588eb19b181ce750298eb058a1f58e3fe7087a /lisp/mail/emacsbug.el | |
parent | de17da156ffa69a35e89a8aa6eb1828b4feb8817 (diff) | |
download | emacs-e24ec555cbabbea5c9650dce52530c9ef0ecde30.tar.gz |
(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.
Diffstat (limited to 'lisp/mail/emacsbug.el')
-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 @@ (defvar bug-gnu-emacs "bug-gnu-emacs@prep.ai.mit.edu" "Address of site maintaining mailing list for GNU Emacs bugs.") +(defvar report-emacs-bug-orig-size nil + "Size of automatically-created initial text of bug report.") + +(defvar report-emacs-bug-orig-text nil + "The automatically-created initial text of bug report.") + ;;;###autoload (defun report-emacs-bug (topic) "Report a bug in GNU Emacs. @@ -48,7 +54,25 @@ Prompts for bug subject. Leaves you in a mail buffer." (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) (insert "In " (emacs-version) "\n\n") - (message (substitute-command-keys "Type \\[mail-send] to send bug report."))) + (message (substitute-command-keys "Type \\[mail-send-and-exit] to send bug report.")) + ;; Make it less likely people will send empty messages. + (make-local-variable 'mail-send-hook) + (add-hook 'mail-send-hook 'report-emacs-bug-hook) + (save-excursion + (goto-char (point-max)) + (skip-chars-backward " \t\n") + (make-local-variable 'report-emacs-bug-orig-text) + (setq report-emacs-bug-orig-text (buffer-substring (point-min) (point))))) + +(defun report-emacs-bug-hook () + (save-excursion + (goto-char (point-max)) + (skip-chars-backward " \t\n") + (if (and (= (- (point) (point-min)) + (length report-emacs-bug-orig-text)) + (equal (buffer-substring (point-min) (point)) + report-emacs-bug-orig-text)) + (error "No text entered in bug report")))) (provide 'emacsbug) |