mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -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:
parent
763c3cd081
commit
c61d2587bb
1 changed files with 15 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue