From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Cc: 16985-done@debbugs.gnu.org
Subject: bug#16985: indent-for-tab-command error messages could mention line numbers
Date: Wed, 02 Apr 2014 15:49:26 -0400 [thread overview]
Message-ID: <jwvppkzsec0.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87ob1ahnu7.fsf@jidanni.org> ("積丹尼 Dan Jacobson"'s message of "Thu, 13 Mar 2014 09:46:56 +0800")
>>>>> "積丹尼" == 積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:
>>>>> "SM" == Stefan Monnier <monnier@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))
prev parent reply other threads:[~2014-04-02 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 18:36 bug#16985: indent-for-tab-command error messages could mention line numbers 積丹尼 Dan Jacobson
2014-03-12 13:43 ` Stefan Monnier
2014-03-12 18:25 ` 積丹尼 Dan Jacobson
2014-03-12 23:27 ` Stefan Monnier
2014-03-13 1:46 ` 積丹尼 Dan Jacobson
2014-04-02 19:49 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvppkzsec0.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=16985-done@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).