1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Check for text about Org-mode when submitting emacs bugs

* lisp/mail/emacsbug.el (report-emacs-bug-hook): Add regex check for
references to Org, and warn user if matches are found.  (Bug#78823)
This commit is contained in:
Antero Mejr 2025-06-23 21:48:44 +00:00 committed by Eli Zaretskii
parent 763c3cd081
commit c61d2587bb

View file

@ -424,6 +424,20 @@ copy text to your preferred mail program.\n"
system-configuration-options "'\n\n") system-configuration-options "'\n\n")
(fill-region (line-beginning-position -1) (point)))) (fill-region (line-beginning-position -1) (point))))
(defun report-emacs-bug-check-org ()
"Warn the user if the bug report mentions org-mode."
(unless report-emacs-bug-no-confirmation
(goto-char (point-max))
(skip-chars-backward " \t\n")
(let* ((text (buffer-substring-no-properties (point-min) (point)))
(l (length report-emacs-bug-orig-text))
(text (substring text 0 l))
(org-regex "\\b[Oo]rg\\(-mode\\)?\\b"))
(when (string-match-p org-regex text)
(when (yes-or-no-p "Is this bug about org-mode?")
(error (substitute-command-keys "\
Not sending, use \\[org-submit-bug-report] to report an Org-mode bug.")))))))
(defun report-emacs-bug-hook () (defun report-emacs-bug-hook ()
"Do some checking before sending a bug report." "Do some checking before sending a bug report."
(goto-char (point-max)) (goto-char (point-max))
@ -493,6 +507,7 @@ and send the mail again%s."
(goto-char (point-min)) (goto-char (point-min))
(re-search-forward "^From: " nil t) (re-search-forward "^From: " nil t)
(error "Please edit the From address and try again")))) (error "Please edit the From address and try again"))))
(report-emacs-bug-check-org)
;; Bury the help buffer (if it's shown). ;; Bury the help buffer (if it's shown).
(when-let* ((help (get-buffer "*Bug Help*"))) (when-let* ((help (get-buffer "*Bug Help*")))
(when (get-buffer-window help) (when (get-buffer-window help)