]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/net/rcirc.el (rcirc-channel-p): Simplify implementation
authorPhilip Kaludercic <philipk@posteo.net>
Mon, 9 Jun 2025 11:16:17 +0000 (13:16 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:01:25 +0000 (10:01 +0200)
(cherry picked from commit 2438aaf76413e7255136f9ec900f1900188a0887)

lisp/net/rcirc.el

index 9e1b930749d437c0f59c5e3c47862dbcce7c8ecd..e4192e2d7a425eda7548d224f63a5f3ed400ff52 100644 (file)
@@ -1588,10 +1588,7 @@ If ALL is non-nil, update prompts in all IRC buffers."
 
 (defun rcirc-channel-p (target)
   "Return t if TARGET is a channel name."
-  (and target
-       (not (zerop (length target)))
-       (or (eq (aref target 0) ?#)
-           (eq (aref target 0) ?&))))
+  (and (stringp target) (string-match-p (rx bos (or ?# ?&)) target)))
 
 (defcustom rcirc-log-directory (locate-user-emacs-file "rcirc-log")
   "Directory to keep IRC logfiles."