GNU bug report logs -
#79080
31.0.50; report-emacs-bug-check-org errors with args-out-range
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#79080: 31.0.50; (report-emacs-bug-check-org) throws an error when reporting unrelated bug
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 79138 <at> debbugs.gnu.org.
--
79080: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79080
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Antero Mejr <mail <at> antr.me>
> Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 79080 <at> debbugs.gnu.org
> Date: Sat, 26 Jul 2025 15:23:16 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Wed, 23 Jul 2025 11:59:48 +0200
> >> From: Daniel Mendler via "Bug reports for GNU Emacs,
> >> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >>
> >> While sending my last bug report I observed the following issue, where
> >> `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've
> >> got the following stack trace:
> >>
> > Antero, I think the bug here is in the assumption that the user edits
> > the original text inserted by report-emacs-bug only to _add_ text.
> > But that might not be true: users could remove some of the original
> > text as well. So something like the below is in order. But I also
> > wonder why we should look for the regular expression only in part of
> > the message to be sent. Can you explain why you did that?
>
> The Features: section of the original text contains the string " org ",
> which will match the regex and always flag a false positive.
>
> The snippet you posted works but I think it will match that " org "
> feature if the user removes any of the original text.
>
> I attached a patch that compares the number of matches in the original
> text to the edited text. This should avoid false positives unless the
> user deletes the " org " strings from the original text. And it will fix
> the error.
Thanks, now installed on the master branch, and closing the bug.
[Message part 3 (message/rfc822, inline)]
Hi. I'm using the bleeding-edge emacs from git: 99080d0c049. On Debian.
GTK.
I just tried to M-x reportbug for something, and it repeatedly failed
because (report-emacs-bug-check-org) throws an "Args out of range"
error. The function in question:
(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.")))))))
So it gets the current buffer text into 'text
(goto-char (point-max))
(text (buffer-substring-no-properties (point-min) (point)))
And then it cuts this variable to the size of the text in
'report-emacs-bug-orig-text.
(l (length report-emacs-bug-orig-text))
(text (substring text 0 l))
In this case report-emacs-bug-orig-text is much bigger than text, so the
(substring) fails. So currently (report-emacs-bug-check-org) is not
self-contained: it's making assumptions on the value of some external
variable ('report-emacs-bug-orig-text) when called, and if those
assumptions fail (as they do here), it dies.
Thanks
This bug report was last modified 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.