From 09d663a558f98effd144bfe74a8b44b52cbe0865 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sat, 19 Jun 2021 18:15:16 +0200 Subject: [PATCH] Command entering now separates cmd from params. --- lirc.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lirc.el b/lirc.el index 77a2d60..5301072 100644 --- a/lirc.el +++ b/lirc.el @@ -185,8 +185,8 @@ portion of the source component of the message, as LIRC doesn't use this.") (setcdr (assoc channel-name lirc-channel-list) users)) (defun lirc-add-channel-users (channel-name &rest users) - (let ((current-users (lirc-channel-get-users channel-name))) - (lirc-channel-set-users channel-name (append users current-users)))) + (let ((current-users (lirc-get-channel-users channel-name))) + (lirc-set-channel-users channel-name (append users current-users)))) (defun lirc-del-channel-users (channel-name &rest users) (let ((current-users (lirc-get-channel-users channel-name))) @@ -311,9 +311,16 @@ portion of the source component of the message, as LIRC doesn't use this.") (defun lirc-enter-string (string) (if (string-prefix-p "/" string) (pcase (substring string 1) - (cmd-str - (lirc-send-msg (lirc-msg nil nil cmd-str)))) - (error "Not implemented."))) + ((rx (: (let cmd-str (+ (not space)))) + (opt + (: (+ " ") + (let params-str (+ anything))))) + (lirc-send-msg (lirc-msg nil nil + cmd-str + (if params-str + (split-string params-str) + nil))))) + (lirc-send-msg (lirc-msg nil nil "PRIVMSG" lirc-current-channel string)))) (defun lirc-enter () "Enter current contents of line after prompt." -- 2.20.1