GNU bug report logs -
#54550
Debugging elisp files
Previous Next
Reported by: goncholden <goncholden <at> protonmail.com>
Date: Thu, 24 Mar 2022 18:20:02 UTC
Severity: wishlist
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54550 in the body.
You can then email your comments to 54550 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Thu, 24 Mar 2022 18:20:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
goncholden <goncholden <at> protonmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 24 Mar 2022 18:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I am debugging a large file because of the following error,
Warning (initialization): An error occurred while loading ‘/home/goncho/.emacs’:
Invalid read syntax: )
This means that I have a trailing parenthesis. To ensure normal operation, I have to investigate and remove the cause of the error in my initialization file. But I am finding
the task problematic, because using the `--debug-init` option to view a complete error backtrace, has not properly located the problem. It is unfortunate that with just one mark makes the file impossible to parse from start to end. Can emacs be made to handle these things better rather than reject all the file?
The best way to find the problem is to use a binary space partitioning scheme. This means to divide the file in half (comment out one part) or put half in another file. Then check if the error occurs in the code that has not been commented out or resides in the other file. If it does, one has to divide again that part in half and repeat the process until one narrows down to the source of the problem. The process is very tedious.
In texinfo, there exists the "@ignore" and "@end ignore" tags that comment out sections of texinfo code. This makes it much easier to debug texinfo files, because one does not have to constantly comment every line, and with the advantage that one can leave the file almost intact.
I would be grateful if emacs could improve on the user debugging part, so debugging can be made more convenient for users in order to reduce downtime. Am not sure if the manual can describe the procedures to debug in a quicker and easier manner, both for new users of elisp programming and experienced ones who would benefit from fixing problem quite rapidly.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Fri, 25 Mar 2022 08:31:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 54550 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Thu, 24 Mar 2022 18:19:13 +0000, goncholden via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:
>> I am debugging a large file because of the following error,
>> Warning (initialization): An error occurred while loading ‘/home/goncho/.emacs’:
>> Invalid read syntax: )
One way to work with this is to put point at the beginning of .emacs
and eval
(while t (forward-sexp))
That will error and tell you at what character position itʼs failing.
>> In texinfo, there exists the "@ignore" and "@end ignore" tags that
>> comment out sections of texinfo code. This makes it much easier to
>> debug texinfo files, because one does not have to constantly comment
>> every line, and with the advantage that one can leave the file almost
>> intact.
You can wrap blocks of code in (when nil) to achieve the same.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Fri, 25 Mar 2022 08:39:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 54550 <at> debbugs.gnu.org (full text, mbox):
Sent with ProtonMail secure email.
------- Original Message -------
On Friday, March 25th, 2022 at 8:30 PM, Robert Pluim <rpluim <at> gmail.com> wrote:
> > > > > > On Thu, 24 Mar 2022 18:19:13 +0000, goncholden via "Bug reports for GNU Emacs, the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org said:
>
> >> I am debugging a large file because of the following error,
>
> >> Warning (initialization): An error occurred while loading ‘/home/goncho/.emacs’:
> >> Invalid read syntax: )
>
> One way to work with this is to put point at the beginning of .emacs
> and eval
>
> (while t (forward-sexp))
>
> That will error and tell you at what character position itʼs failing.
> >> In texinfo, there exists the "@ignore" and "@end ignore" tags that
> >> comment out sections of texinfo code. This makes it much easier to
> >> debug texinfo files, because one does not have to constantly comment
> >> every line, and with the advantage that one can leave the file almost
> >> intact.
> You can wrap blocks of code in (when nil) to achieve the same.
> Robert
I cannot say that the "(when nil)" can include a chunk of defuns though,
only sections within a function.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Fri, 25 Mar 2022 08:52:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 54550 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Fri, 25 Mar 2022 08:38:31 +0000, goncholden <goncholden <at> protonmail.com> said:
>> You can wrap blocks of code in (when nil) to achieve the same.
>> Robert
goncholden> I cannot say that the "(when nil)" can include a chunk of defuns though,
goncholden> only sections within a function.
Have you tried it? `defun' forms are no different from any other lisp
form in that respect.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Fri, 25 Mar 2022 11:48:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 54550 <at> debbugs.gnu.org (full text, mbox):
------- Original Message -------
On Friday, March 25th, 2022 at 8:51 PM, Robert Pluim <rpluim <at> gmail.com> wrote:
> > > > > > On Fri, 25 Mar 2022 08:38:31 +0000, goncholden goncholden <at> protonmail.com said:
>
> >> You can wrap blocks of code in (when nil) to achieve the same.
>
> >> Robert
>
> goncholden> I cannot say that the "(when nil)" can include a chunk of defuns though,
>
> goncholden> only sections within a function.
>
> Have you tried it? `defun' forms are no different from any other lisp
> form in that respect.
>
> Robert
That sounds good.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#54550
; Package
emacs
.
(Fri, 25 Mar 2022 16:23:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 54550 <at> debbugs.gnu.org (full text, mbox):
goncholden <goncholden <at> protonmail.com> writes:
> The best way to find the problem is to use a binary space partitioning
> scheme.
As Robert has already noted, the easiest way to find these errors is to
just go to the start of the file and hold the `C-M-f' key combination
down until Emacs beeps.
However, the error message here is supposed to say what line the error
is on, and it didn't, so I've now fixed that in Emacs 29.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 29.1, send any further explanations to
54550 <at> debbugs.gnu.org and goncholden <goncholden <at> protonmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Mar 2022 16:23:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 23 Apr 2022 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.