emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#16985: closed (indent-for-tab-command error messag


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#16985: closed (indent-for-tab-command error messages could mention line numbers)
Date: Wed, 02 Apr 2014 19:50:01 +0000

Your message dated Wed, 02 Apr 2014 15:49:26 -0400
with message-id <address@hidden>
and subject line Re: bug#16985: indent-for-tab-command error messages could 
mention line numbers
has caused the debbugs.gnu.org bug report #16985,
regarding indent-for-tab-command error messages could mention line numbers
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
16985: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16985
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- 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.



--- End Message ---
--- Begin Message --- Subject: Re: bug#16985: indent-for-tab-command error messages could mention line numbers Date: Wed, 02 Apr 2014 15:49:26 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
>>>>> "積丹尼" == 積丹尼 Dan Jacobson <address@hidden> writes:

>>>>> "SM" == Stefan Monnier <address@hidden> 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))



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]