Subject: Re: bug#78823: [BUG] 31.0.50; org-babel-execute-src-block: Wrong type argument: integer-or-marker-p, nil

From: Antero Mejr <[email-masked]>
Date: Mon, 23 Jun 2025 22:02:16 +0000

Eli Zaretskii <[email-masked]> writes:
>
> I'd prefer the report-emacs-bug command itself look at the text of the
> report and intuit that it might be about Org, then ask the user.  This
> is more easily discoverable, and probably also more reliable.

I think adding a command "report-org-bug" that is an alias for
"org-submit-bug-report" may also be helpful. I looked for that before
submitting but couldn't find the right command name. I can submit a
patch to Org to add it if you want.

I also attached a patch with a regex to report-emacs-bug-hook to check
for Org stuff.

Sorry about the mix up.

>From 0fe37df8bd639e7dcbb2f3458af9c38257d1de64 Mon Sep 17 00:00:00 2001
From: Antero Mejr <[email-masked]>
Date: Mon, 23 Jun 2025 21:48:44 +0000
Subject: [PATCH] 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.
---
 lisp/mail/emacsbug.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index ad6f1b7a58b..5ffb86e68b6 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -424,6 +424,20 @@ emacs-build-description
 	    system-configuration-options "'\n\n")
     (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 ()
   "Do some checking before sending a bug report."
   (goto-char (point-max))
@@ -493,6 +507,7 @@ report-emacs-bug-hook
           (goto-char (point-min))
           (re-search-forward "^From: " nil t)
 	  (error "Please edit the From address and try again"))))
+  (report-emacs-bug-check-org)
   ;; Bury the help buffer (if it's shown).
   (when-let* ((help (get-buffer "*Bug Help*")))
     (when (get-buffer-window help)
-- 
2.34.1