From 1185e528641cbce618db93aa6604899e79300522 Mon Sep 17 00:00:00 2001 From: Amin Bandali 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