From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 11:37:28 +0100 Subject: [PATCH 1/2] `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. --- lisp/erc/erc.el | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 478683a77f5..06791bce520 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4016,16 +4016,40 @@ erc--split-string-shell-cmd ;; Input commands handlers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun erc-cmd-AMSG (line) - "Send LINE to all channels of the current server that you are on." - (interactive "sSend to all channels you're on: ") +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (interactive "sSend to all channels: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + (lambda () (erc-channel-p (erc-default-target))) + (erc-send-message line))) +(put 'erc-cmd-GMSG 'do-not-parse-args t) + +(defun erc-cmd-AMSG (line) + "Send LINE to all channels of the current network." + (interactive "sSend to all channels on this network: ") + (setq line (erc-trim-string line)) + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) (erc-send-message line))) (put 'erc-cmd-AMSG 'do-not-parse-args t) +(defun erc-cmd-GME (line) + "Send LINE as an action to all channels on all networks you are on." + (interactive "sSend action to all channels: ") + (erc-with-all-buffers-of-server nil + (lambda () (erc-channel-p (erc-default-target))) + (erc-cmd-ME line) )) +(put 'erc-cmd-GME 'do-not-parse-args t) + +(defun erc-cmd-AME (line) + "Send LINE as an action to all channels on the current network." + (interactive "sSend action to all channels on this network: ") + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) + (erc-cmd-ME line) )) +(put 'erc-cmd-AME 'do-not-parse-args t) + (defun erc-cmd-SAY (line) "Send LINE to the current query or channel as a message, not a command. -- 2.39.2 From 73f3cc5072bb8cc95ce5367cb8aef74e5b047f0d Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 15:03:10 +0100 Subject: [PATCH 2/2] Docstrings for interactive use. --- lisp/erc/erc.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 06791bce520..aeb7722b563 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4017,7 +4017,8 @@ erc--split-string-shell-cmd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun erc-cmd-GMSG (line) - "Send LINE to all channels on all networks you are on." + "Send LINE to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server nil @@ -4026,7 +4027,8 @@ erc-cmd-GMSG (put 'erc-cmd-GMSG 'do-not-parse-args t) (defun erc-cmd-AMSG (line) - "Send LINE to all channels of the current network." + "Send LINE to all channels of the current network. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server erc-server-process @@ -4035,7 +4037,8 @@ erc-cmd-AMSG (put 'erc-cmd-AMSG 'do-not-parse-args t) (defun erc-cmd-GME (line) - "Send LINE as an action to all channels on all networks you are on." + "Send LINE as an action to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels: ") (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) @@ -4043,7 +4046,8 @@ erc-cmd-GME (put 'erc-cmd-GME 'do-not-parse-args t) (defun erc-cmd-AME (line) - "Send LINE as an action to all channels on the current network." + "Send LINE as an action to all channels on the current network. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels on this network: ") (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) -- 2.39.2