# HG changeset patch # User Richard M. Stallman # Date 773267659 0 # Node ID c84ecb24316cefad421bf913c285043f20bf506d # Parent aa25c6ea397db2e69e0ee294925d37de12c54519 (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. diff -r aa25c6ea397d -r c84ecb24316c lisp/mail/emacsbug.el --- a/lisp/mail/emacsbug.el Sun Jul 03 20:18:38 1994 +0000 +++ b/lisp/mail/emacsbug.el Sun Jul 03 20:34:19 1994 +0000 @@ -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 @@ (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)