Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt

From: Emanuel Berg <[email-masked]>
Date: Sat, 13 Jan 2024 03:31:28 +0100

>>> To create one patch out of all the commits?
>>
>> Yes, please.
>
> Maybe it can be done like this. 
>
> $ git format-patch -2 HEAD --stdout > 0001-all.patch

I didn't find a command to change the commit message of the
patch but I think one can just as well do that manually by
editing the patch like any other file.

Here is the modified version with everything, I think.

>From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001
From: Emanuel Berg <[email-masked]>
Date: Fri, 12 Jan 2024 11:37:28 +0100
Subject: [PATCH 1/2] Functions for ERC.

`erc-cmd-GMSG', `erc-cmd-GME' and `erc-cmd-AME' was added.
`erc-cmd-AMSG' was changed so that it does what the docstring says.
* lisp/erc/erc.el: functions were added/modified to/in this file.

bug#68401
---
 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 <[email-masked]>
Date: Fri, 12 Jan 2024 15:03:10 +0100
Subject: [PATCH 2/2] Docstrings for interactive use added.

* lisp/erc/erc.el: docstrings added here

bug#68401

---
 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

-- 
underground experts united
https://dataswamp.org/~incal