GNU bug report logs -
#6902
23.2; indent-line-to possible devide by zero error bug
Previous Next
Reported by: Arik Mitschang <arik.mitschang <at> gmail.com>
Date: Tue, 24 Aug 2010 15:50:03 UTC
Severity: minor
Tags: wontfix
Found in version 23.2
Done: Chong Yidong <cyd <at> stupidchicken.com>
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 6902 in the body.
You can then email your comments to 6902 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6902
; Package
emacs
.
(Tue, 24 Aug 2010 15:50:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Arik Mitschang <arik.mitschang <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 24 Aug 2010 15:50:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In indent.el the indent-line-to function has a comparison that devides
the current column count by tab-width, whose value is an integerp and
allowed to be zero (and in my experience is often 0). I noticed the
issue in specific with org mode which utilizes this function for a lot
of interesting tasks.
I can provide the following patch which makes a check to avoid an
arithmetic error:
=== modified file 'lisp/indent.el'
--- lisp/indent.el 2010-05-19 03:06:48 +0000
+++ lisp/indent.el 2010-08-24 15:20:39 +0000
@@ -177,7 +177,9 @@
(back-to-indentation)
(let ((cur-col (current-column)))
(cond ((< cur-col column)
- (if (>= (- column (* (/ cur-col tab-width) tab-width)) tab-width)
+ (if (and (> tab-width 0)
+ (>= (- column (* (/ cur-col tab-width) tab-width))
+ tab-width))
(delete-region (point)
(progn (skip-chars-backward " ") (point))))
(indent-to column))
Thanks,
~Arik
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6902
; Package
emacs
.
(Wed, 25 Aug 2010 19:32:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 6902 <at> debbugs.gnu.org (full text, mbox):
Arik Mitschang wrote:
> In indent.el the indent-line-to function has a comparison that devides
> the current column count by tab-width, whose value is an integerp and
> allowed to be zero (and in my experience is often 0).
Why do you want to set tab-width to 0?
A quick grep for tab-width shows other places that will break.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6902
; Package
emacs
.
(Wed, 25 Aug 2010 20:04:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 6902 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris writes:
> Arik Mitschang wrote:
>
> > In indent.el the indent-line-to function has a comparison that devides
> > the current column count by tab-width, whose value is an integerp and
> > allowed to be zero (and in my experience is often 0).
>
> Why do you want to set tab-width to 0?
Honestly I cannot remember, but I had it set there and I assume there
was a reason.
>
> A quick grep for tab-width shows other places that will break.
The fact that it's value can be zero (without even warning in the doc
string) and this value causes functionality to break doesn't seem good
to me. If nobody but me ever had it set to zero, then perhaps just
updating its doc-string to warn users away from that value would be
nice.
Thanks,
~Arik
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6902
; Package
emacs
.
(Sun, 10 Apr 2011 20:57:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 6902 <at> debbugs.gnu.org (full text, mbox):
Arik Mitschang <arik.mitschang <at> gmail.com> writes:
> > A quick grep for tab-width shows other places that will break.
>
> The fact that it's value can be zero (without even warning in the doc
> string) and this value causes functionality to break doesn't seem good
> to me. If nobody but me ever had it set to zero, then perhaps just
> updating its doc-string to warn users away from that value would be
> nice.
I have made such an update to the doc-string. It doesn't seem
worthwhile to try to handle zero tab-widths in all the places where it
could be problematic. Thanks.
bug closed, send any further explanations to
6902 <at> debbugs.gnu.org and Arik Mitschang <arik.mitschang <at> gmail.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> debbugs.gnu.org
.
(Sun, 10 Apr 2011 20:58:01 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
.
(Mon, 09 May 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 130 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.