From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeremy Hall Newsgroups: gmane.emacs.bugs 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 Organization: BakBone Message-ID: <1258374328.909.3.camel@jeremy> References: <87hbsxgjfe.fsf@stupidchicken.com> Reply-To: Jeremy Hall , 4920@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258402173 23030 80.91.229.12 (16 Nov 2009 20:09:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2009 20:09:33 +0000 (UTC) Cc: Chong Yidong , 4920@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 16 21:09:25 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NA7t6-0001B2-Gj for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Nov 2009 21:09:24 +0100 Original-Received: from localhost ([127.0.0.1]:39653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA7t5-0002ov-QL for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Nov 2009 15:09:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NA7rM-0000h9-IO for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2009 15:07:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NA7rE-0000YS-2c for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2009 15:07:32 -0500 Original-Received: from [199.232.76.173] (port=55905 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA7rC-0000Wo-O6 for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2009 15:07:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38650) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NA7rC-0006wo-2r for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2009 15:07:26 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAGK7KKb001269; Mon, 16 Nov 2009 12:07:23 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAGJoKUh031218; Mon, 16 Nov 2009 11:50:20 -0800 Resent-Date: Mon, 16 Nov 2009 11:50:20 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Jeremy Hall Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 16 Nov 2009 19:50:20 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4920 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4920-submit@emacsbugs.donarmstrong.com id=B4920.125840010127837 (code B ref 4920); Mon, 16 Nov 2009 19:50:20 +0000 Original-Received: (at 4920) by emacsbugs.donarmstrong.com; 16 Nov 2009 19:35:01 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from bbfe1.bakbone.com (bbfe1.bakbone.com [209.126.247.155]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAGFVSH6005154 for <4920@emacsbugs.donarmstrong.com>; Mon, 16 Nov 2009 07:31:29 -0800 Original-Received: from USX1.corp.bb ([10.1.20.60] RDNS failed) by bbfe1.bakbone.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 16 Nov 2009 07:31:22 -0800 Original-Received: from 10.45.40.136 ([10.45.40.136]) by USX1.corp.bb ([10.1.20.63]) via Exchange Front-End Server mail2.bakbone.com ([10.1.20.65]) with Microsoft Exchange Server HTTP-DAV ; Mon, 16 Nov 2009 15:31:21 +0000 Original-Received: from jeremy by mail2.bakbone.com; 16 Nov 2009 15:31:40 +0000 In-Reply-To: X-Mailer: Evolution 2.24.1 (2.24.1-2.fc10) X-OriginalArrivalTime: 16 Nov 2009 15:31:22.0003 (UTC) FILETIME=[D9B27630:01CA66D1] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 16 Nov 2009 15:07:32 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32649 Archived-At: 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 >