unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
@ 2010-09-03 16:05 Bob
  2019-10-06 11:39 ` Stefan Kangas
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bob @ 2010-09-03 16:05 UTC (permalink / raw)
  To: 6978

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

 

Emacs 23.1.97:

 

When using the C++ scope operator "::", show-paren-mode gets confused:

 

------  Foo.cpp ------------------------------------

struct Foo1 {};

 

namespace X

{

  struct Foo2 {};

 

  template<class _Y>

  struct Bar;

 

  template<>

  struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>` to
`<`

  {

  };

 

  template<>

  struct Bar<Foo2>           // "(show-paren-mode)" correctly matches `>` to
`<` 

  {

  };

}

---------------------------------------------


[-- Attachment #2: Type: text/html, Size: 3299 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
  2010-09-03 16:05 bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97 Bob
@ 2019-10-06 11:39 ` Stefan Kangas
       [not found] ` <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org>
       [not found] ` <mailman.1131.1570388227.2651.bug-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2019-10-06 11:39 UTC (permalink / raw)
  To: Bob; +Cc: 6978

severity 6978 minor
found 6978 27.0.50
quit

"Bob" <purchasebyemail1@comcast.net> writes:

>
>
> Emacs 23.1.97:
>
>
>
> When using the C++ scope operator "::", show-paren-mode gets confused:
>
>
>
> ------  Foo.cpp ------------------------------------
>
> struct Foo1 {};
>
>
>
> namespace X
>
> {
>
>   struct Foo2 {};
>
>
>
>   template<class _Y>
>
>   struct Bar;
>
>
>
>   template<>
>
>   struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>` to `<`
>
>   {
>
>   };
>
>
>
>   template<>
>
>   struct Bar<Foo2>           // "(show-paren-mode)" correctly matches `>` to `<`
>
>   {
>
>   };
>
> }
>
> ---------------------------------------------

I can reproduce this on current master.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
       [not found] ` <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org>
@ 2019-10-06 17:38   ` Alan Mackenzie
  2019-10-06 18:56     ` Richard Copley
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-10-06 17:38 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 6978

In article <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org> you wrote:
> severity 6978 minor
> found 6978 27.0.50
> quit

> "Bob" <purchasebyemail1@comcast.net> writes:

>>
>>
>> Emacs 23.1.97:
>>
>>
>>
>> When using the C++ scope operator "::", show-paren-mode gets confused:
>>
>>
>>
>> ------  Foo.cpp ------------------------------------
>>
>> struct Foo1 {};
>>
>>
>>
>> namespace X
>>
>> {
>>
>>   struct Foo2 {};
>>
>>
>>
>>   template<class _Y>
>>
>>   struct Bar;
>>
>>
>>
>>   template<>
>>
>>   struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>` to `<`
>>
>>   {
>>
>>   };
>>
>>
>>
>>   template<>
>>
>>   struct Bar<Foo2>           // "(show-paren-mode)" correctly matches `>` to `<`
>>
>>   {
>>
>>   };
>>
>> }
>>
>> ---------------------------------------------

> I can reproduce this on current master.

This is a CC Mode bug.  The pertinent < and > are not being marked with
syntax-table text properties, hence can't be recognised as parens.

I'll be looking into this.

> Best regards,
> Stefan Kangas

-- 
Alan Mackenzie (Nuremberg, Germany).






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
  2019-10-06 17:38   ` Alan Mackenzie
@ 2019-10-06 18:56     ` Richard Copley
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Copley @ 2019-10-06 18:56 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Stefan Kangas, 6978

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Sun, 6 Oct 2019 at 18:39, Alan Mackenzie <acm@muc.de> wrote:

> In article <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org> you wrote:
> > "Bob" <purchasebyemail1@comcast.net> writes:
> >>   struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>`
> to `<`
> The pertinent < and > are not being marked with
> syntax-table text properties, hence can't be recognised as parens.
>

Digraphs? (Just a thought.)

Best,
Richard.

[-- Attachment #2: Type: text/html, Size: 1012 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
       [not found] ` <mailman.1131.1570388227.2651.bug-gnu-emacs@gnu.org>
@ 2019-10-06 19:16   ` Alan Mackenzie
  2019-10-06 20:11     ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-10-06 19:16 UTC (permalink / raw)
  To: Richard Copley; +Cc: 6978

Hello, Richard.

In article <mailman.1131.1570388227.2651.bug-gnu-emacs@gnu.org> you wrote:
> [-- text/plain, encoding 7bit, charset: UTF-8, 15 lines --]

> On Sun, 6 Oct 2019 at 18:39, Alan Mackenzie <acm@muc.de> wrote:

>> In article <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org> you wrote:
>> > "Bob" <purchasebyemail1@comcast.net> writes:
>> >>   struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>`
>> >>   to `<`
>> The pertinent < and > are not being marked with
>> syntax-table text properties, hence can't be recognised as parens.
>>

> Digraphs? (Just a thought.)

Spot on!

I just need to find a way of removing <: from the regexp used to check
the opening <.  Shouldn't be too difficult.

Why on earth are digraphs still an issue?  Why are they still in the C
and C++ standards?  It's been several decades since "complete" character
sets (here, meaning ASCII) superseded incomplete ones.

> Best,
> Richard.

-- 
Alan Mackenzie (Nuremberg, Germany).






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
  2019-10-06 19:16   ` Alan Mackenzie
@ 2019-10-06 20:11     ` Alan Mackenzie
  2019-10-06 20:21       ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-10-06 20:11 UTC (permalink / raw)
  To: Richard Copley, Stefan Kangas; +Cc: 6978

Hello, Stefan and Richard.

On Sun, Oct 06, 2019 at 19:16:07 -0000, Alan Mackenzie wrote:
> In article <mailman.1131.1570388227.2651.bug-gnu-emacs@gnu.org> you wrote:
> > [-- text/plain, encoding 7bit, charset: UTF-8, 15 lines --]

> > On Sun, 6 Oct 2019 at 18:39, Alan Mackenzie <acm@muc.de> wrote:

> >> In article <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org> you wrote:
> >> > "Bob" <purchasebyemail1@comcast.net> writes:
> >> >>   struct Bar<::Foo1>         // "(show-paren-mode)" does not match `>`
> >> >>   to `<`
> >> The pertinent < and > are not being marked with
> >> syntax-table text properties, hence can't be recognised as parens.

> > Digraphs? (Just a thought.)

> Spot on!

> I just need to find a way of removing <: from the regexp used to check
> the opening <.  Shouldn't be too difficult.

The following seems to fix the bug:



diff -r b0943da37755 cc-langs.el
--- a/cc-langs.el	Thu Oct 03 14:14:45 2019 +0000
+++ b/cc-langs.el	Sun Oct 06 20:08:43 2019 +0000
@@ -1382,11 +1382,11 @@
 
 (c-lang-defconst c-<-op-cont-regexp
   ;; Regexp matching the second and subsequent characters of all
-  ;; multicharacter tokens that begin with "<".
+  ;; multicharacter tokens that begin with "<", apart from digraphs.
   t (c-make-keywords-re nil
       (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
 		    t
-		    "\\`<."
+		    "\\`<[^:]"
 		    (lambda (op) (substring op 1)))))
 (c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
 


> > Best,
> > Richard.

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
  2019-10-06 20:11     ` Alan Mackenzie
@ 2019-10-06 20:21       ` Stefan Kangas
  2019-10-11 19:32         ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2019-10-06 20:21 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Richard Copley, 6978

Hi Alan,

Alan Mackenzie <acm@muc.de> writes:

> The following seems to fix the bug:

I can verify that applying your patch to current master fixes the bug
for me.  I think you can push and close this bug.  Thanks for fixing
it.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97
  2019-10-06 20:21       ` Stefan Kangas
@ 2019-10-11 19:32         ` Alan Mackenzie
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mackenzie @ 2019-10-11 19:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Richard Copley, 6978-done

Hello, Stefan.

On Sun, Oct 06, 2019 at 22:21:39 +0200, Stefan Kangas wrote:
> Hi Alan,

> Alan Mackenzie <acm@muc.de> writes:

> > The following seems to fix the bug:

> I can verify that applying your patch to current master fixes the bug
> for me.  I think you can push and close this bug.  Thanks for fixing
> it.

I've actually developed a longer, more rigorous patch, which I've
committed.  The C++ standard says that although <:: should be recognised
as a template opener, <::>, and <::: should not be.  The committed patch
follows this.

I'm closing the bug with this post.

> Best regards,
> Stefan Kangas

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-11 19:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 16:05 bug#6978: show-paren-mode doesn't match when scope "::" operator is used : emacs 32.1.97 Bob
2019-10-06 11:39 ` Stefan Kangas
     [not found] ` <mailman.1087.1570362019.2651.bug-gnu-emacs@gnu.org>
2019-10-06 17:38   ` Alan Mackenzie
2019-10-06 18:56     ` Richard Copley
     [not found] ` <mailman.1131.1570388227.2651.bug-gnu-emacs@gnu.org>
2019-10-06 19:16   ` Alan Mackenzie
2019-10-06 20:11     ` Alan Mackenzie
2019-10-06 20:21       ` Stefan Kangas
2019-10-11 19:32         ` Alan Mackenzie

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).