unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jeremy Hall <jeremy.hall@bakbone.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>, 4920@emacsbugs.donarmstrong.com
Subject: bug#4920: 23.1; (check-parens) problem with bash script case items unbalanced close paren
Date: Mon, 16 Nov 2009 12:25:28 +0000	[thread overview]
Message-ID: <1258374328.909.3.camel@jeremy> (raw)
In-Reply-To: <jwvd43ldlmh.fsf-monnier+emacsbugreports@gnu.org>

Hi, 

I have noticed that the behaviour is intermittent.  I have just tried a
file (at the start) when it fails.  The cursor is left on the bracket of
xxxx) .  I moved around the file a bit and it kept failing, then, at the
end of the file it worked.  After that, it worked every where in the
file.  

I see it calls (scan-sexps (point-min) (point-max)) in lisp.el,
so its clearly intended to work over over the entire buffer.

For info, my elisp is:-  (here I just want the function to be aborted
with a message, if the file is incorrect, before the indenting starts).

;;
;; Tidy whitespace in a source file.
;;
(defun jah-src-tidy ()
	"Tidy whitespace in a source file."
	(interactive)
	(jah-set-tabs)
	(message "Tidy leading tabs ...")
	(tabify (point-min) (point-max))
	(message "Tidy trailing whitespace ...")
	(delete-trailing-whitespace)
	(message "Check brackets and quotes ...")
	(save-excursion (check-parens))
	(message "Tidy indentation ...")
	(indent-region (point-min) (point-max))
	(message "Source tidy complete.")
	)

Thanks,
Jeremy

On Sat, 2009-11-14 at 13:11 -0500, Stefan Monnier wrote:
> >> Running (check-parens) fails on a bash script with case statements in
> >> because of the unmatched close ")".  Would it be possible to fix this,
> >> or tell me how to work around it?
> > I can't reproduce this: `M-x check-parens RET' on the following file
> > signals no error.  Please provice a more detailed bug report.
> 
> > #!/bin/sh
> 
> > case "$SYSNAME" in
> >     Darwin)
> > 	;;
> >     Linux)
> 
> Those parentheses get a syntax-table property applied by
> font-lock-syntactic-keywords, which means that the behavior will be
> (hopefully) correct for the visible part of the text, and maybe for all
> the text before that, but not necessarily for the text after window-end.
> 
> 
>         Stefan
> 






  reply	other threads:[~2009-11-16 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14 16:28 bug#4920: 23.1; (check-parens) problem with bash script case items unbalanced close paren Chong Yidong
2009-11-14 18:11 ` Stefan Monnier
2009-11-16 12:25   ` Jeremy Hall [this message]
2016-07-08  1:10   ` npostavs
2016-07-10  0:11     ` Stefan Monnier
2016-07-10  0:39       ` Noam Postavsky
2016-07-10  2:11         ` Stefan Monnier
2016-07-10 12:14           ` npostavs
2016-07-10 12:38             ` Stefan Monnier
2016-07-10 13:16               ` npostavs
2016-07-10 14:20                 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-11-13 16:14 Jeremy Hall

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=1258374328.909.3.camel@jeremy \
    --to=jeremy.hall@bakbone.com \
    --cc=4920@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    --cc=monnier@iro.umontreal.ca \
    /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).