bug#38257: 27.0.50; ERC does not match or highlight nick surrounded by parens

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38257: 27.0.50; ERC does not match or highlight nick surrounded by parens

Amin Bandali-4

As the title says, ERC currently does not match
or highlight nicks when surrounded by a pair of
parens.  This has resulted in me not getting
notified of several important messages and
missing them.

I’ll send a patch fixing this shortly.

--
Amin Bandali
Free Software Activist | GNU Maintainer & Webmaster
GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
https://bandali.eu.org



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Here’s a patch that fixes the issue for me:


From 10f1fb7ccfb3e76dbd5df44f3f0e2780d24ba99b Mon Sep 17 00:00:00 2001
From: Amin Bandali <[hidden email]>
Date: Mon, 18 Nov 2019 10:24:48 -0500
Subject: [PATCH] Fix ERC not matching nicks surrounded parens (bug#38257)

* lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
Omit parens, as they're not valid nick characters, per RFC 2812
section 2.3.1.
---
 lisp/erc/erc-button.el | 2 --
 lisp/erc/erc-match.el  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index ec70260146..3dc4e92a46 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -223,8 +223,6 @@ erc-button-keymap
 
 (defvar erc-button-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index e9ed735516..e87076dbe3 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -246,8 +246,6 @@ erc-match-exclude-server-buffer
 ;; just put it in erc.el
 (defvar erc-match-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
--
2.23.0

Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Here’s a v2 that fixes the issue for
apostrophes as well, with a slightly tweaked
commit message.


From 1185e528641cbce618db93aa6604899e79300522 Mon Sep 17 00:00:00 2001
From: Amin Bandali <[hidden email]>
Date: Mon, 18 Nov 2019 10:24:48 -0500
Subject: [PATCH v2] Improve ERC's matching of nicks (bug#38257)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
Omit (, ), and '; as they're not valid nick characters, per RFC 2812
section 2.3.1.  This enables correct matching/highlighting of nicks
when they’re surrounded by parens, like (nick), and when adjacent to
an apostrophy, like nick's.
---
 lisp/erc/erc-button.el | 3 ---
 lisp/erc/erc-match.el  | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index ec70260146..002b99520a 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -223,14 +223,11 @@ erc-button-keymap
 
 (defvar erc-button-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index e9ed735516..336040a374 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -246,14 +246,11 @@ erc-match-exclude-server-buffer
 ;; just put it in erc.el
 (defvar erc-match-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
--
2.23.0

Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Lars Ingebrigtsen
Amin Bandali <[hidden email]> writes:

> * lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
> Omit (, ), and '; as they're not valid nick characters, per RFC 2812
> section 2.3.1.  This enables correct matching/highlighting of nicks
> when they’re surrounded by parens, like (nick), and when adjacent to
> an apostrophy, like nick's.

I haven't tried this patch, but doesn't this syntax table apply to all
buttons in erc, including URLs?  So an URL like
http://foo.bar/zot'foo would no longer be recognised properly?  (I'm not
sure that it should, to be honest...)

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#38257: Missed notif > broken buttons

Corwin Brust
In reply to this post by Amin Bandali-4
Chiming in to say that I've applied the patch in my local and I hope it will be applied/accepted. 

The functionality provided by buttons is essentially convenience.  Missing a notification can have real impact on my life.

Regards,
--
Corwin
corwin.brust (skype)
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
In reply to this post by Lars Ingebrigtsen
Lars Ingebrigtsen <[hidden email]> writes:

[...]
>
> I haven't tried this patch, but doesn't this syntax table apply to all
> buttons in erc, including URLs?  So an URL like
> http://foo.bar/zot'foo would no longer be recognised properly?  (I'm not
> sure that it should, to be honest...)

It does indeed, and it didn't quite occur to me
when writing the patch; whoops.

But like Corwin, I too personally much rather
be notified of my nick getting highlighted in
exchange for losing some convenience with
respect to clickable links.

That said, from a brief chat with Tom Tromey in
#erc on freenode today, I agree with him that
one probably shouldn't make changes to syntax
tables lightly, without first considering all
possible cases.  I wonder if you or Tom would
be so kind to do such an audit for this change.
I'd also be open to other ways of doing this if
there's a better way.  I guess in general it is
kind of tricky to deal with these characters in
URLs.  At least one person I talked to earlier
today said they would expect the apostrophe to
be part of the URL (i.e. not a word boundary).
It may be even more tricky or more subjective
for parens.

Thoughts?



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Lars Ingebrigtsen
Amin Bandali <[hidden email]> writes:

> That said, from a brief chat with Tom Tromey in
> #erc on freenode today, I agree with him that
> one probably shouldn't make changes to syntax
> tables lightly, without first considering all
> possible cases.  I wonder if you or Tom would
> be so kind to do such an audit for this change.
> I'd also be open to other ways of doing this if
> there's a better way.  I guess in general it is
> kind of tricky to deal with these characters in
> URLs.  At least one person I talked to earlier
> today said they would expect the apostrophe to
> be part of the URL (i.e. not a word boundary).
> It may be even more tricky or more subjective
> for parens.
>
> Thoughts?

In general, you can't use syntax tables to give satisfactory URL DWIM
recognition.  Both of these things are common:

  There's a web page (http://foo.bar)

and

  There's a web page http://foo.bar/lala_(yes)

The latter is very common with Wikipedia URLs.

So I think for this to work with erc, I think it would make sense to
separate out the URL recognition in erc from other buttons, and base it
on browse-url-button-regexp instead, which has worked out these kinks
and is pretty DWIM.

And then you can change the syntax table to make the other, simpler
buttons (for nicks etc) work.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Lars Ingebrigtsen
Lars Ingebrigtsen <[hidden email]> writes:

> So I think for this to work with erc, I think it would make sense to
> separate out the URL recognition in erc from other buttons, and base it
> on browse-url-button-regexp instead, which has worked out these kinks
> and is pretty DWIM.

(Note that I'm not familiar with how erc does URL recognition, so what I
wrote may be totally irrelevant.  :-))

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
In reply to this post by Lars Ingebrigtsen
Lars Ingebrigtsen <[hidden email]> writes:

[...]

>
> So I think for this to work with erc, I think
> it would make sense to separate out the URL
> recognition in erc from other buttons, and
> base it on browse-url-button-regexp instead,
> which has worked out these kinks and is
> pretty DWIM.
>
> And then you can change the syntax table to
> make the other, simpler buttons (for nicks
> etc) work.

Nice, I think that would make sense.  FWIW, I'm
not familiar with how ERC does URL recognition
either, but I'll try to look into it soon-ish.
In the mean time, if anyone else is familiar
with this already, your help would be much
appreciated. :)

Also, I'll keep on using my patch on my local
checkout and will report back if I notice any
serious issues.  So far it's been working
pretty nicely here, minus the URL buttons.



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Amin Bandali <[hidden email]> writes:

> Lars Ingebrigtsen <[hidden email]> writes:
>
> [...]
>>
>> So I think for this to work with erc, I think
>> it would make sense to separate out the URL
>> recognition in erc from other buttons, and
>> base it on browse-url-button-regexp instead,
>> which has worked out these kinks and is
>> pretty DWIM.
>>
>> And then you can change the syntax table to
>> make the other, simpler buttons (for nicks
>> etc) work.
>
> Nice, I think that would make sense.  FWIW, I'm
> not familiar with how ERC does URL recognition
> either, but I'll try to look into it soon-ish.
> In the mean time, if anyone else is familiar
> with this already, your help would be much
> appreciated. :)
>
So I had a bit of time on my hands again, and looked into erc-button per
Lars’s suggestion.  Turns out there’s a C-h v erc-button-url-regexp RET.
Replacing it with C-h v browse-url-button-regexp RET seems to improve
things with surrounding pair of parens.  In particular, the closing
paren isn’t wrongly buttonized anymore, which is nice.

I think the only nice-to-have at this point would be if quotes without a
matching one were buttonized as part of the address, e.g. the one from
Lars’s earlier example.

For instance, currently in all the following examples buttonizing ends
right before the quote (i.e. the t is the last clickable character):

- https://example.org/test"x
- https://example.org/test'x
- https://example.org/test’x
- https://example.org/test"
- https://example.org/test'
- https://example.org/test’

Note that the current behaviour is *not* a side-effect of my patch.

>
> Also, I'll keep on using my patch on my local
> checkout and will report back if I notice any
> serious issues.  So far it's been working
> pretty nicely here, minus the URL buttons.
>

Quick update: I’ve been using my patch every day for the past ~40 days,
and I haven’t had any issues with it so far.

                                 * * *

Finally, the updated patch (against master, but I’m hoping since it
hasn’t diverged from emacs-27 much yet, it should still apply there):


From 940d5e41ad5449bf0b0214b941de54ebbd5df546 Mon Sep 17 00:00:00 2001
From: Amin Bandali <[hidden email]>
Date: Mon, 18 Nov 2019 10:24:48 -0500
Subject: [PATCH v2] Improve ERC's matching of nicks and URLs (bug#38257)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
Omit (, ), and '; as they're not valid nick characters, per RFC 2812
section 2.3.1.  This enables correct matching/highlighting of nicks
when they’re surrounded by parens, like (nick), and when adjacent to
an apostrophy, like nick's.
* lisp/erc/erc-button.el (erc-button-url-regexp): Use the regexp from
browse-url-button-regexp, which among other things, seems to handle
surrounding pair of parens better.
---
 lisp/erc/erc-button.el | 11 +++--------
 lisp/erc/erc-match.el  |  3 ---
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index ec70260146..ae7a6e6bf3 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -41,6 +41,7 @@
 (require 'erc)
 (require 'wid-edit)
 (require 'erc-fill)
+(require 'browse-url)
 
 ;;; Minor Mode
 
@@ -87,12 +88,9 @@ erc-button-mouse-face
   :type 'face
   :group 'erc-faces)
 
-(defcustom erc-button-url-regexp
-  (concat "\\(www\\.\\|\\(s?https?\\|"
-          "ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)"
-          "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?"
-          "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,()]+[-a-zA-Z0-9_=#$@~`%&*+\\/()]")
+(defcustom erc-button-url-regexp browse-url-button-regexp
   "Regular expression that matches URLs."
+  :version "27.1"
   :group 'erc-button
   :type 'regexp)
 
@@ -223,14 +221,11 @@ erc-button-keymap
 
 (defvar erc-button-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index e9ed735516..336040a374 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -246,14 +246,11 @@ erc-match-exclude-server-buffer
 ;; just put it in erc.el
 (defvar erc-match-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
--
2.23.0



--
Amin Bandali
Free Software Activist | GNU Maintainer & Webmaster
GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
https://bandali.eu.org

signature.asc (873 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Emacs - Bugs mailing list
Amin Bandali wrote:

> So I had a bit of time on my hands again, and
> looked into erc-button per
> Lars’s suggestion. [...]

Good to hear that you work on ERC, I use it
every day and I hope many other do as well.
I'm preparing for my Hong Kong thing, but after
that God willing the first thing I'll do is
start ERC and type "Amin's solution is more
than good for government work", and I'll see
his name's genitive in a pleasant color :)

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal





Reply | Threaded
Open this post in threaded view
|

bug#38257: Still working well for me (GNU 26.3 Windows 10)

Corwin Brust
In reply to this post by Amin Bandali-4
I've been running with the patch since Nov with no issues.  As I said before, missing message notifs bites.  I hope this can be applied soon!

--
Corwin
612-217-1742
612-298-0615 (fax)
612-695-4276 (mobile)
corwin.brust (skype)
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Eli Zaretskii
In reply to this post by Amin Bandali-4
> From: Amin Bandali <[hidden email]>
> Date: Sat, 28 Dec 2019 23:30:19 -0500
> Cc: [hidden email], Emanuel Berg <[hidden email]>
>
> Finally, the updated patch (against master, but I’m hoping since it
> hasn’t diverged from emacs-27 much yet, it should still apply there):

It's fine with me to push this to the emacs-27 branch.  But I think
perhaps the backward-incompatible change in the syntax table should be
mentioned in NEWS, even though this is according to the RFCs?

Lars, do you have any comments?

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Eli Zaretskii <[hidden email]> writes:

>> From: Amin Bandali <[hidden email]>
>> Date: Sat, 28 Dec 2019 23:30:19 -0500
>> Cc: [hidden email], Emanuel Berg <[hidden email]>
>>
>> Finally, the updated patch (against master, but I’m hoping since it
>> hasn’t diverged from emacs-27 much yet, it should still apply there):
>
> It's fine with me to push this to the emacs-27 branch.  But I think
> perhaps the backward-incompatible change in the syntax table should be
> mentioned in NEWS, even though this is according to the RFCs?
>
> Lars, do you have any comments?
>
> Thanks.
>
Thank you for the feedback, Eli.  I’ve attached below an updated patch
with two NEWS entries and minor typo/format fixes in the commit message.
If there are no objections I’ll push this to emacs-27 after a few days.


From 19e6cd8b04ecdb34c6f7e227332a90ede4cc84d6 Mon Sep 17 00:00:00 2001
From: Amin Bandali <[hidden email]>
Date: Mon, 18 Nov 2019 10:24:48 -0500
Subject: [PATCH v3] Improve ERC's matching of nicks and URLs (bug#38257)

* lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
Omit (, ), and '; as they're not valid nick characters, per RFC 2812
section 2.3.1.  This enables correct matching/highlighting of nicks
when they're surrounded by parens, like (nick), and when adjacent to
an apostrophe, like nick's.
* lisp/erc/erc-button.el (erc-button-url-regexp): Use the regexp from
browse-url-button-regexp, which among other things, seems to handle
surrounding pair of parens better.
---
 etc/NEWS               | 12 ++++++++++++
 lisp/erc/erc-button.el | 11 +++--------
 lisp/erc/erc-match.el  |  3 ---
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 6d4a6119af..02d9135571 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1569,6 +1569,18 @@ and its value has been changed to Duck Duck Go.
 The user option to use instead to alter text to be sent is now
 'erc-pre-send-functions'.
 
+---
+*** Improve matching/highlighting of nicknames
+Open and close parenthesis and apostrophe are not considered valid
+nick characters anymore, matching the given grammar in RFC 2812
+section 2.3.1.  This enables correct matching and highlighting of
+nicks when they are surrounded by parentheses, like (nick), and when
+adjacent to an apostrophe, like nick's.
+
+---
+*** Set 'erc-button-url-regexp' to 'browse-url-button-regexp'
+which better handles surrounding pair of parentheses.
+
 ** EUDC
 
 ---
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 6e30b3a793..e4f5a19091 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -41,6 +41,7 @@
 (require 'erc)
 (require 'wid-edit)
 (require 'erc-fill)
+(require 'browse-url)
 
 ;;; Minor Mode
 
@@ -87,12 +88,9 @@ erc-button-mouse-face
   :type 'face
   :group 'erc-faces)
 
-(defcustom erc-button-url-regexp
-  (concat "\\(www\\.\\|\\(s?https?\\|"
-          "ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)"
-          "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?"
-          "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,()]+[-a-zA-Z0-9_=#$@~`%&*+\\/()]")
+(defcustom erc-button-url-regexp browse-url-button-regexp
   "Regular expression that matches URLs."
+  :version "27.1"
   :group 'erc-button
   :type 'regexp)
 
@@ -223,14 +221,11 @@ erc-button-keymap
 
 (defvar erc-button-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index 7a824cce9f..8b9ab33128 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -246,14 +246,11 @@ erc-match-exclude-server-buffer
 ;; just put it in erc.el
 (defvar erc-match-syntax-table
   (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\( "w" table)
-    (modify-syntax-entry ?\) "w" table)
     (modify-syntax-entry ?\[ "w" table)
     (modify-syntax-entry ?\] "w" table)
     (modify-syntax-entry ?\{ "w" table)
     (modify-syntax-entry ?\} "w" table)
     (modify-syntax-entry ?` "w" table)
-    (modify-syntax-entry ?' "w" table)
     (modify-syntax-entry ?^ "w" table)
     (modify-syntax-entry ?- "w" table)
     (modify-syntax-entry ?_ "w" table)
--
2.23.0


signature.asc (873 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Emacs - Bugs mailing list
Amin Bandali wrote:

> * lisp/erc/erc-{button,match}.el
> (erc-{button,match}-syntax-table): Omit (, ),
> and '; as they're not valid nick characters,
> per RFC 2812 section 2.3.1. This enables
> correct matching/highlighting of nicks when
> they're surrounded by parens, like (nick),
> and when adjacent to an apostrophe,
> like nick's.
> * lisp/erc/erc-button.el
> (erc-button-url-regexp): Use the regexp from
> browse-url-button-regexp, which among other
> things, seems to handle surrounding pair of
> parens better.
> ---
>  etc/NEWS               | 12 ++++++++++++
>  lisp/erc/erc-button.el | 11 +++--------
>  lisp/erc/erc-match.el  |  3 ---
>  3 files changed, 15 insertions(+), 11 deletions(-)

It is just amazing how this has been handled,
to care so much for the IRC client and also to
be able to strengthen the reasons for the
policy by finding one RFC!

> -(defcustom erc-button-url-regexp
> -  (concat "\\(www\\.\\|\\(s?https?\\|"
> -       "ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)"
> -       "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?"
> -       "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,()]+[-a-zA-Z0-9_=#$@~`%&*+\\/()]")
> +(defcustom erc-button-url-regexp browse-url-button-regexp
>    "Regular expression that matches URLs."
> +  :version "27.1"
>    :group 'erc-button
>    :type 'regexp)

Here I wonder why does the erc-button has this?
Don't Gnus, Emacs-w3m, man mode, virtually every
mode that is about communicating have
a tendency to come across hyperlinks?

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Emanuel Berg <[hidden email]> writes:

[...]
>
> It is just amazing how this has been handled,
> to care so much for the IRC client and also to
> be able to strengthen the reasons for the
> policy by finding one RFC!
>

:-) Thanks, Emanuel.

>
[...]
> Here I wonder why does the erc-button has this?
> Don't Gnus, Emacs-w3m, man mode, virtually every
> mode that is about communicating have
> a tendency to come across hyperlinks?
>

Historical reasons, I’d imagine?

Doing a git-blame, it seems that ‘browse-url-button-regexp’ was
introduced in a32e1feb438e793a8378671c7124d226b58f65f0 [0], where Lars
refactored ‘gnus-button-url-regexp’ out from “lisp/gnus/gnus-art.el”
over to ‘browse-url-button-regexp’ in “lisp/net/browse-url.el”,
presumably for the very reason of other packages being able to use it
for controlling what’s considered a button.

[0]: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a32e1feb438e793a8378671c7124d226b58f65f0

signature.asc (873 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Eli Zaretskii
In reply to this post by Amin Bandali-4
> From: Amin Bandali <[hidden email]>
> Cc: [hidden email],  [hidden email],  [hidden email]
> Date: Thu, 09 Jan 2020 02:14:14 -0500
>
> Thank you for the feedback, Eli.  I’ve attached below an updated patch
> with two NEWS entries and minor typo/format fixes in the commit message.
> If there are no objections I’ll push this to emacs-27 after a few days.

Thanks, this is OK, with the following not fixed:

> +*** Improve matching/highlighting of nicknames

This should end with a period, as a complete sentence.



Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Amin Bandali-4
Eli Zaretskii <[hidden email]> writes:

>> From: Amin Bandali <[hidden email]>
>> Cc: [hidden email],  [hidden email],  [hidden email]
>> Date: Thu, 09 Jan 2020 02:14:14 -0500
>>
>> Thank you for the feedback, Eli.  I’ve attached below an updated patch
>> with two NEWS entries and minor typo/format fixes in the commit message.
>> If there are no objections I’ll push this to emacs-27 after a few days.
>
> Thanks, this is OK, with the following not fixed:
>
>> +*** Improve matching/highlighting of nicknames
>
> This should end with a period, as a complete sentence.
>
Thank you, Eli!  Fixed that, and pushed to emacs-27 as
37e0d00c143ddb6d5e978eb1d3ac9c1d1aba3860 [0].

[0]: https://git.sv.gnu.org/cgit/emacs.git/commit/?id=37e0d00c143ddb6d5e978eb1d3ac9c1d1aba3860

signature.asc (873 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38257: Acknowledgement (27.0.50; ERC does not match or highlight nick surrounded by parens)

Stefan Kangas
Amin Bandali <[hidden email]> writes:

> Eli Zaretskii <[hidden email]> writes:
>
>>> From: Amin Bandali <[hidden email]>
>>> Cc: [hidden email],  [hidden email],  [hidden email]
>>> Date: Thu, 09 Jan 2020 02:14:14 -0500
>>>
>>> Thank you for the feedback, Eli.  I’ve attached below an updated patch
>>> with two NEWS entries and minor typo/format fixes in the commit message.
>>> If there are no objections I’ll push this to emacs-27 after a few days.
>>
>> Thanks, this is OK, with the following not fixed:
>>
>>> +*** Improve matching/highlighting of nicknames
>>
>> This should end with a period, as a complete sentence.
>>
>
> Thank you, Eli!  Fixed that, and pushed to emacs-27 as
> 37e0d00c143ddb6d5e978eb1d3ac9c1d1aba3860 [0].

Should the bug also be closed, or is there anything more to do?

Best regards,
Stefan Kangas