From 66b315c9c94c871de2c70b92ac69ef86f19d8a2f Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Thu, 4 Feb 2016 14:24:18 +1100 Subject: Make erc work when subword-mode is switched on * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): New functions to do word-based things when subword-mode is switched on. * lisp/erc/erc-button.el (erc-button-add-nickname-buttons): Use them (bug#17558). --- lisp/erc/erc-button.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lisp/erc/erc-button.el') diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index e1ccea90dd1..7d509196330 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -300,14 +300,14 @@ specified by `erc-button-alist'." (when (or (eq t form) (eval form)) (goto-char (point-min)) - (while (forward-word 1) - (setq bounds (bounds-of-thing-at-point 'word)) - (setq word (buffer-substring-no-properties - (car bounds) (cdr bounds))) - (when (or (and (erc-server-buffer-p) (erc-get-server-user word)) - (and erc-channel-users (erc-get-channel-user word))) - (erc-button-add-button (car bounds) (cdr bounds) - fun t (list word))))))) + (while (erc-forward-word) + (when (setq bounds (erc-bounds-of-word-at-point)) + (setq word (buffer-substring-no-properties + (car bounds) (cdr bounds))) + (when (or (and (erc-server-buffer-p) (erc-get-server-user word)) + (and erc-channel-users (erc-get-channel-user word))) + (erc-button-add-button (car bounds) (cdr bounds) + fun t (list word)))))))) (defun erc-button-add-buttons-1 (regexp entry) "Search through the buffer for matches to ENTRY and add buttons." -- cgit v1.2.3