From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25903: Question re syntax tables and unexpected behaviour in C/C++ major mode Date: Wed, 01 Mar 2017 23:49:17 -0500 Message-ID: <87o9xkb7w2.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488430167 3642 195.159.176.226 (2 Mar 2017 04:49:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Mar 2017 04:49:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 25903@debbugs.gnu.org To: Peter Milliken Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 02 05:49:17 2017 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 1cjIfz-0008M5-5q for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Mar 2017 05:49:15 +0100 Original-Received: from localhost ([::1]:50353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjIg4-0000TA-Ro for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Mar 2017 23:49:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjIfu-0000SU-UP for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2017 23:49:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjIfu-00014m-7t for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2017 23:49:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjIfo-00013k-Ko; Wed, 01 Mar 2017 23:49:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cjIfm-0006JI-Q4; Wed, 01 Mar 2017 23:49:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 02 Mar 2017 04:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25903 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: notabug Original-Received: via spool by 25903-submit@debbugs.gnu.org id=B25903.148843009324178 (code B ref 25903); Thu, 02 Mar 2017 04:49:02 +0000 Original-Received: (at 25903) by debbugs.gnu.org; 2 Mar 2017 04:48:13 +0000 Original-Received: from localhost ([127.0.0.1]:35209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjIez-0006Hu-Kw for submit@debbugs.gnu.org; Wed, 01 Mar 2017 23:48:13 -0500 Original-Received: from mail-io0-f177.google.com ([209.85.223.177]:35109) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjIev-0006Hf-N9 for 25903@debbugs.gnu.org; Wed, 01 Mar 2017 23:48:10 -0500 Original-Received: by mail-io0-f177.google.com with SMTP id z13so1467974iof.2 for <25903@debbugs.gnu.org>; Wed, 01 Mar 2017 20:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=yxle+2YRRUwgh3mSHfrOPjPidUls5jhxxsl1Kd3JNek=; b=ULUPVX5AF/eJ8fXkKse4Ld3tBangMg/6HKhKEQMvEA9UIM3sN2Hhg2jXIid24qXZEc 0erDRsO5dIuNIYbxyM9zB4NZqxRUe6vpK53SH7cntiwnKNorfaQUkpNo3q9dl4BYVdgF chjK5LIurOVboN24Z7MQOGWpiRRd3WXfQxdhiAbf60dTcAs1Gmk9+omfZu4gu79pUXV3 cI5HabpGEy2xp+TOa0c8eRc+NfxYgNRvTV/XeUkYgZ1HzLGmIeZ70BpcXilSHfAQ3RyU kkxijoTOrBi8du3Wmd1oUzJTXWCEwYGLD7YqwzpiPrG8ynnawD2+BTHsB8d04eaNoAjD OXYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=yxle+2YRRUwgh3mSHfrOPjPidUls5jhxxsl1Kd3JNek=; b=J8P2Wz2jBzRU9hzWUMGCtm5T/FnLfYKwWVGR5/8t6NG0PKZg8HS6W5jzqkALph42GF oKD3EQfmVsOVKNlmJyDWnT7SsKpIDnrawAVnpezpeh4KFo4kR6Iq4i2JE8H/j9Ii02N+ b52fZ3uqUJrCx5kvWGUmOe3PWdGroGnDGveu0JNvyghM7doNTEZU8SSdh09YfmmCtquO 65clPJIszgNmDKOs8VO1AN5wLtFMclT5cO+C86XJQWIiUP+oodsnnFMWturU142tJBUn KCalpuECkYtnfq+s1+ZnlFwh8e53aOcfeMFlOkV7WQ8k/mwUzbv7oMRCW9mL6VATBHcL x0gw== X-Gm-Message-State: AMke39nxRhT42oLf7gRIYteYZoxDnKTh0/ij8kyKPwZvGK8U0CJzzuHYKerH+A0Ehy0Uew== X-Received: by 10.107.181.10 with SMTP id e10mr12379404iof.156.1488430084065; Wed, 01 Mar 2017 20:48:04 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id v197sm162622ita.2.2017.03.01.20.48.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Mar 2017 20:48:03 -0800 (PST) In-Reply-To: (Peter Milliken's message of "Wed, 1 Mar 2017 09:04:05 +1100") 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:130029 Archived-At: Peter Milliken writes: > My code works fine in buffers that have Python, Ada and Lisp major > modes but it experiences difficulties in buffers with C/C++ major > mode. Basically, when in a C/C++ buffer, the code locates text within > "<>" pairs as well as "{}"/"[]" pairs. I really don't want my code to > have an (ugly) exception case where it tests "if in C/C++ mode then > check if <> has been detected and skip over them and continue looking > for {}/[] pairs" You'll probably have to though. In C++, "<" matches ">" when they denote template arguments. cc-mode implements this by adding text properties to those characters so that they have pair syntax. Changing the syntax table doesn't change the text properties, so for those characters, the syntax stays the same. Use C-u C-x = to check the syntax and properties of a particular character.