GNU bug report logs - #16985
indent-for-tab-command error messages could mention line numbers

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 10 Mar 2014 22:57:04 UTC

Severity: wishlist

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 16985 in the body.
You can then email your comments to 16985 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16985; Package emacs. (Mon, 10 Mar 2014 22:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Mar 2014 22:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: indent-for-tab-command error messages could mention line numbers
Date: Tue, 11 Mar 2014 02:36:33 +0800
TAB (translated from <tab>) runs the command indent-for-tab-command,

Its messages,
forward-sexp: Scan error: "Unbalanced parentheses", 1970, 1
would be improved if they could also mention line numbers and not just
apparently byte numbers. E.g.,
Unbalanced parentheses at line 34 column 33.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16985; Package emacs. (Wed, 12 Mar 2014 13:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 16985 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 16985 <at> debbugs.gnu.org
Subject: Re: bug#16985: indent-for-tab-command error messages could mention
 line numbers
Date: Wed, 12 Mar 2014 09:43:00 -0400
> TAB (translated from <tab>) runs the command indent-for-tab-command,
> Its messages,
> forward-sexp: Scan error: "Unbalanced parentheses", 1970, 1
> would be improved if they could also mention line numbers and not just
> apparently byte numbers. E.g.,
> Unbalanced parentheses at line 34 column 33.

Traditionally TAB does not signal an error for unbalanced parentheses.
It may indirectly signal such a problem by indenting to "a weird place".

IOW, please tell us in which case you got the above error, so we can
catch it and turn it into a non-error.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16985; Package emacs. (Wed, 12 Mar 2014 18:26:01 GMT) Full text and rfc822 format available.

Message #11 received at 16985 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16985 <at> debbugs.gnu.org
Subject: Re: bug#16985: indent-for-tab-command error messages could mention
 line numbers
Date: Thu, 13 Mar 2014 02:25:01 +0800
>>>>> "SM" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
SM> IOW, please tell us in which case you got the above error, so we can
SM> catch it and turn it into a non-error.

I recall it was when I was editing a perl program, so try with perl
mode... But anyway I think it would be better to catch such errors.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16985; Package emacs. (Wed, 12 Mar 2014 23:28:01 GMT) Full text and rfc822 format available.

Message #14 received at 16985 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 16985 <at> debbugs.gnu.org
Subject: Re: bug#16985: indent-for-tab-command error messages could mention
 line numbers
Date: Wed, 12 Mar 2014 19:27:08 -0400
SM> IOW, please tell us in which case you got the above error, so we can
SM> catch it and turn it into a non-error.
> I recall it was when I was editing a perl program, so try with perl
> mode... But anyway I think it would be better to catch such errors.

Hmm... catch them and do what?  Such a signal means that's a coding
error somewhere in the indentation code, so hiding the signal is not
a good idea.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16985; Package emacs. (Thu, 13 Mar 2014 01:48:01 GMT) Full text and rfc822 format available.

Message #17 received at 16985 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16985 <at> debbugs.gnu.org
Subject: Re: bug#16985: indent-for-tab-command error messages could mention
 line numbers
Date: Thu, 13 Mar 2014 09:46:56 +0800
>>>>> "SM" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
SM> IOW, please tell us in which case you got the above error, so we can
SM> catch it and turn it into a non-error.
>> I recall it was when I was editing a perl program, so try with perl
>> mode... But anyway I think it would be better to catch such errors.

SM> Hmm... catch them and do what?  Such a signal means that's a coding
SM> error somewhere in the indentation code, so hiding the signal is not
SM> a good idea.


SM>         Stefan

OK, this file.pl
{}}
}(
}
triggers the bug. Do C-x h TAB.

Also the message should say "Help report this bug in xxx.el!" else people
will think it is an error in their perl file.




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 02 Apr 2014 19:50:01 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Wed, 02 Apr 2014 19:50:03 GMT) Full text and rfc822 format available.

Message #22 received at 16985-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 16985-done <at> debbugs.gnu.org
Subject: Re: bug#16985: indent-for-tab-command error messages could mention
 line numbers
Date: Wed, 02 Apr 2014 15:49:26 -0400
>>>>> "積丹尼" == 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

>>>>> "SM" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
SM> IOW, please tell us in which case you got the above error, so we can
SM> catch it and turn it into a non-error.
>>> I recall it was when I was editing a perl program, so try with perl
>>> mode... But anyway I think it would be better to catch such errors.

SM> Hmm... catch them and do what?  Such a signal means that's a coding
SM> error somewhere in the indentation code, so hiding the signal is not
SM> a good idea.


SM> Stefan

> OK, this file.pl
> {}}
> }(
> }
> triggers the bug. Do C-x h TAB.

> Also the message should say "Help report this bug in xxx.el!" else people
> will think it is an error in their perl file.

Thanks for the simple test case.  I installed the patch below which
should fix those problems.


        Stefan


=== modified file 'lisp/progmodes/perl-mode.el'
--- lisp/progmodes/perl-mode.el	2014-02-10 01:34:22 +0000
+++ lisp/progmodes/perl-mode.el	2014-04-02 19:46:36 +0000
@@ -854,11 +854,12 @@
    (and (= (char-syntax (following-char)) ?\))
 	(save-excursion
 	  (forward-char 1)
-	  (forward-sexp -1)
+          (when (condition-case nil (progn (forward-sexp -1) t)
+                  (scan-error nil))
 	  (perl-indent-new-calculate
            ;; Recalculate the parsing-start, since we may have jumped
            ;; dangerously close (typically in the case of nested functions).
-           'virtual nil (save-excursion (perl-beginning-of-function)))))
+             'virtual nil (save-excursion (perl-beginning-of-function))))))
    (and (and (= (following-char) ?{)
 	     (save-excursion (forward-char) (perl-hanging-paren-p)))
 	(+ (or default (perl-calculate-indent parse-start))





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 May 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.