From 8db980e433bce0307802663379b84acb51051200 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 8 May 2023 09:29:25 +0200 Subject: count chars: use mastodon-toot-handle-regex --- lisp/mastodon-toot.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 3fd445c..3d8c1f3 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1539,10 +1539,7 @@ CW is the content warning, which contributes to the character count." (replace-match "xxxxxxxxxxxxxxxxxxxxxxx")) ; 23 x's ;; handle @handles (goto-char (point-min)) - (while (search-forward-regexp (concat "\\(?2:@[^ @\n]+\\)" ; a handle only - "\\(@[^ \n]+\\)?" ; with poss domain - "\\b") - nil t) + (while (search-forward-regexp mastodon-toot-handle-regex nil t) (replace-match (match-string 2))) ; replace with handle only (+ (length cw) (length (buffer-substring (point-min) (point-max)))))) -- cgit v1.2.3