From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#5410: Parenthesis Matching Bug!! Date: Thu, 04 Aug 2016 20:17:08 +0000 Message-ID: References: <1263817237.2894.15.camel@matrix-laptop> <871t25fdkb.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c19437e2043bf053944a3bc X-Trace: blaine.gmane.org 1470341928 675 195.159.176.226 (4 Aug 2016 20:18:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2016 20:18:48 +0000 (UTC) Cc: Matrix , 5410@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 04 22:18:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVP5u-0005nD-AN for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 22:18:18 +0200 Original-Received: from localhost ([::1]:41605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVP5r-0005Yj-3V for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 16:18:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVP5j-0005Vn-7s for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 16:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVP5e-00069j-JC for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 16:18:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVP5e-00069d-GK for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 16:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bVP5d-0002OJ-HI for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 16:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2016 20:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5410 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5410-submit@debbugs.gnu.org id=B5410.14703418489154 (code B ref 5410); Thu, 04 Aug 2016 20:18:01 +0000 Original-Received: (at 5410) by debbugs.gnu.org; 4 Aug 2016 20:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:55886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVP56-0002Na-GK for submit@debbugs.gnu.org; Thu, 04 Aug 2016 16:17:28 -0400 Original-Received: from mail-wm0-f46.google.com ([74.125.82.46]:38539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVP54-0002NM-IV for 5410@debbugs.gnu.org; Thu, 04 Aug 2016 16:17:26 -0400 Original-Received: by mail-wm0-f46.google.com with SMTP id o80so8205761wme.1 for <5410@debbugs.gnu.org>; Thu, 04 Aug 2016 13:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XvU+KeeBTgNo5xjXS2z9rMlVyqAdnvTSC9LJjaUay84=; b=K7lidOpsmvyi4SmA7E2E+Gp/9Tr9DAgug2fq+vgobjaiiQPxrOGcH/kpFT62gsAg9D JrHwT++4gM3pImATUZ5nJIgjdms6tpXPPc6U4SN0ZAskJwm13M8b8DMhgfIjL6T3BQK2 JfMwIuyRyEaJJjOjx4cJ4JGrqbthwjamQeSp/bDj0qP/vh8QjIx2k4tIhQ4+68qpd+Xv h3sZDsDBsk9xCtz2GowGrLm8Jkz7s1tm1jbrItcDNwLhwV4cTQywyS6xu3GTfazRcBCS VLFiAQOlLt5i1VvNC/UGI7k5NZpWfzzwRongovZ14XFc0ZWEfIlbHbb7pEZDIAVCDQpE W1tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XvU+KeeBTgNo5xjXS2z9rMlVyqAdnvTSC9LJjaUay84=; b=fvvz0tJe5DJ3gGi0SUuLjgnInV37T9vF2J7Xd2MPm+uz/ULSJQc3ssEGx1mdsJHV/f jGRbxVm0Lo/rvlcBtjWLaxr5yfxFtqTyjcbyM4MCCRCYCa+7IHs0+8Lck9CuWlsXl6dT 8yIF9FI/qHxvG0JT41+1YAKEH/2OOn0AOsqWwCF7eP4VuH/8CzPwKyDfG7Pd2dkDkmDu gC5El4YTaDvnjUPNUdIYbwJ7PG6NZqvCZF3cpgPv4tOtuoveH4GD4J60uxf9R/4nQI2h +ndtKeLqHc4+03LPu1d3u5TvoGXeo3HluI/qZGW9OmskemQodE1pVpu8T8j0/uhT6jvi QtaA== X-Gm-Message-State: AEkoouvA0y4waMqEnn9QiCMWK7wWuTk+0pmiNq1cP6WTUtkpaRs+FEIuLNzqs8k0q/GMUrp+DQysK/lqaKuiBQ== X-Received: by 10.28.206.8 with SMTP id e8mr63756935wmg.57.1470341840911; Thu, 04 Aug 2016 13:17:20 -0700 (PDT) In-Reply-To: <871t25fdkb.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121836 Archived-At: --94eb2c19437e2043bf053944a3bc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Wed, Aug 3, 2016 at 10:55 PM Michael Heerdegen wrote: > Andrew Hyatt writes: > > > Your example reproduces for me in Emacs 25. My guess is that emacs > > doesn't really assume that comment lines should be treated as a > > contiguous text block. Which is sometimes right, sometimes not, in my > > experience. > > We are talking about `show-paren-mode', right? AFAICT this just calls > `scan-sexps' and looks if that errors or not, without doing syntactical > analysis itself. > > `parse-sexp-ignore-comments' influences `scan-sexps's behavior in this > regard, and setting it to nil does change the behavior in this case for > me. I guess we could use this for a solution.2 > Yes, this works to resolve the issue for me too. Are you saying it should default to nil always, or for cc-mode? It seems like setting this to nil might cause other issues we wouldn't want; ignoring comments usually seems like the right thing to do. It'd be nice, I guess, if you could just turn it to nil when in a comment. > > > For example, you could have comments that are something > > like: > > > > // This function does three things: > > // 1) Reverse the string > > // 2) Uuencode the string > > // 3) Rot-13 the string > > > > Which certainly wouldn't make a lot of sense treated contiguously. > > Well, we would not loose anything in this case: parens are already shown > as mismatches now. > > True, I guess my point is that it'd be strange to consider this as 3 unmatched parens rather than 1 per line. > > Michael. > --94eb2c19437e2043bf053944a3bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On Wed, Aug 3, 2016 at 10:55 PM Michael Heerdegen <michael_heerdegen@web.de> wrote:
Andrew Hyatt <ahyatt@gmail.com> writes:

> Your example reproduces for me in Emacs 25. My guess is that emacs
> doesn't really assume that comment lines should be treated as a
> contiguous text block. Which is sometimes right, sometimes not, in my
> experience.

We are talking about `show-paren-mode', right?  AFAICT this just calls
`scan-sexps' and looks if that errors or not, without doing syntactical
analysis itself.


`parse-sexp-ignore-comments' influences `scan-sexps's behavior in this
regard, and setting it to nil does change the behavior in this case for
me.  I guess we could use this for a solution.2

Yes, this works to resolve the issue for me too.  Are you saying it should default to nil always, or for cc-mode?  It seems like setting this to nil might cause other issues we wouldn't want; ignoring comments usually seems like the right thing to do.  

It'd be nice, I guess, if you could just turn it to nil when in a comment.
 

> For example, you could have comments that are something
> like:
>
> // This function does three things:
> // 1) Reverse the string
> // 2) Uuencode the string
> // 3) Rot-13 the string
>
> Which certainly wouldn't make a lot of sense treated contiguously.

Well, we would not loose anything in this case: parens are already shown
as mismatches now.


True, I guess my point is that it'd be strange to consider this as 3 unmatched parens rather than 1 per line.
 

Michael.
--94eb2c19437e2043bf053944a3bc--