* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt @ 2024-01-12 10:43 Emanuel Berg 0 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-12 10:43 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 9545 bytes --] Patch without whitespace changes. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0) of 2024-01-09 built on ebc Repository revision: 774c8ec74c98d69d56b2511a613145f2b69fb2eb Repository branch: master System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --enable-link-time-optimization --with-native-compilation=aot --with-x-toolkit=no --without-compress-install' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF WEBP X11 XDBE XIM XINPUT2 XPM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: erc-track-mode: t erc-track-minor-mode: t erc-netsplit-mode: t erc-menu-mode: t erc-list-mode: t erc-imenu-mode: t erc-match-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-log-mode: t erc-autojoin-mode: t erc-irccontrols-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-networks-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t transient-mark-mode: t auto-composition-mode: linux auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/incal/quicklisp/dists/quicklisp/software/slime-v2.28/slime-tests hides /home/incal/.emacs.d/elpa/slime-20231218.2206/slime-tests /home/incal/quicklisp/dists/quicklisp/software/slime-v2.28/slime hides /home/incal/.emacs.d/elpa/slime-20231218.2206/slime /home/incal/quicklisp/dists/quicklisp/software/slime-v2.28/slime-autoloads hides /home/incal/.emacs.d/elpa/slime-20231218.2206/slime-autoloads ~/.emacs.d/emacs-init/version hides /usr/local/share/emacs/30.0.50/lisp/version ~/.emacs.d/lisp/abbrev hides /usr/local/share/emacs/30.0.50/lisp/abbrev Features: (smerge-mode shadow emacsbug bug-reference erc-ibuffer ibuf-ext ibuffer ibuffer-loaddefs erc-notify erc-page erc-services erc-sound erc-speedbar speedbar ezimage dframe erc-truncate erc-xdcc erc-dcc w3m-save nnfolder completion dos-w32 find-cmd find-dired ada-eglot elint cl-print ada-mode ada-imenu align ada-skel wisi-skel eglot external-completion jsonrpc flymake diff ert ewoc ada-indent-user-options ada-core uniquify-files ada-mode-autoloads uniquify-files-autoloads gnat-compiler gnat-compiler-autoloads skeleton wisi-process-parse wisi-prj wisi wisi-fringe semantic/lex semantic/fw mode-local find-file wisi-parse-common wisi-autoloads loaddefs-gen tar-mode url-cache url-http url-auth url-gw finder-inf conf-mode flow-fill mm-archive grep vc-hg vc-git vc-bzr vc-dispatcher python w3m-symbol w3m-filter canlock shortdoc qp display-line-numbers tabify mailalias mule-util mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg gnus-dup gnus-ml disp-table cursor-sensor pop3 utf-7 nndraft nnmh nnml gnus-agent nnvirtual nntp gnus-cache network-stream erc-track erc-netsplit erc-menu erc-list erc-imenu term/linux cus-start global-keys yank xsel wrap-search wood w3m-version w3m-unisearch w3m-survivor w3m-sem w3m-keys w3m-swamp w3m-incal w3m-session vt version variance todo-did time-cmp pcase test-face survivor summary str-to-bits street today stats sort-list sort-incal sort slime-incal slime-fancy slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree advice slime-scratch slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-banner signal show-command sequence-string scale restart replace-list remote ref-lines re-make-list random quote-ref psea printer lpr piles package-style checkdoc lisp-mnt ny negative-subtraction navigate-fs-keys tramp-cmds tramp-cache tramp-sh native comp comp-cstr cl-extra model-ttt model mode-by-filename misc-incal minor-modes t-mouse messages message-incal message-header moggle measure match-data-format man-incal mailrc mail mail-zoho mail-to-many mail-insert mail-dataswamp list list-quoted-functions lisp-incal regexp inf-lisp ielm linux-shell lights latex tex-mode kill kill-path keys iterate-files info-incal html mhtml-mode cus-edit js c-ts-common hex help-incal help-fns radix-tree debug backtrace gnus-server gnus-score-incal gnus-incal-minimal smtpmail cite frame-size fill-incal file tramp trampver tramp-integration tramp-message help-mode tramp-compat tramp-loaddefs face w3m-form slime-presentations slime-repl slime-parse bridge slime etags fileloop xref project arc-mode archive-mode hyperspec sh-script executable org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-compat org-macs man gnus-cite gemini-mode time-stamp ffap erc-match diff-mode easy-mmode apt-sources-list apropos erc-show-modes erc-misc erc-man erc-log-incal cus-load erc-connect epwgen enum emacs-shell shell eshell em-hist esh-mode esh-var esh-cmd generator esh-ext esh-proc esh-io esh-arg esh-module esh-groups esh-opt esh-util elpher-incal bookmark pp socks nsm elpher elpa elisp revert-buffer ide nroff-mode css-mode treesit smie sgml-mode facemenu imenu eww xdg url-queue mm-url markdown-mode color noutline outline make-mode quit gnus-incal group group-summary find-command-zsh get-search-string erc-incal warnings erc-spell erc-ring erc-pcomplete pcomplete erc-log erc-kill erc-join erc-iterate erc-scroll erc-goodies erc-element erc-button erc-fill erc-stamp erc format-spec erc-backend erc-networks erc-common erc-compat erc-loaddefs gnus-score score-mode elide-head edit window-incal window-other tabs sudo-user-path echo-message ecat-incal dope dired-kill-ext dired-aux dired-jump-target dired-incal w3m-url files-x custom-vars search-regexp-in-files counter count console-keys compilation-incal comic-book-insult color-incal char caps-back c-and-cpp compile-incal compile comint ansi-osc ansi-color ring cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs buffer-menu switch-to-buffer switch-to-buffer-regexp buc browse gnus-srvr bmi bike math perm spell ispell dwim bibtex-next-volume bibtex-incal bibtex-field bibtex-book bibtex-autokey-insert issn-verify isbn-verify bibtex batch audio article w3m-download w3m-search file-write-to w3m-bookmark-more w3m-tabs w3m-bookmark w3m doc-view filenotify jka-compr image-mode exif timezone w3m-hist bookmark-w3m w3m-ems w3m-favicon w3m-image w3m-fb tab-line icons w3m-proc w3m-util thingatpt super scroll mode-line gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus comp-run comp-common xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util text-property-search time-date mail-utils range mm-util mail-prsvr wid-edit close align-incal string align-from-left abc rx elpher-autoloads gemini-mode-autoloads go-mode-autoloads lua-mode-autoloads markdown-mode-autoloads info slime-autoloads macrostep-autoloads sml-mode-autoloads w3m-load w3m-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 2284289 476222) (symbols 48 77310 39) (strings 32 428481 14571) (string-bytes 1 19241578) (vectors 16 138642) (vector-slots 8 3896275 228053) (floats 8 972 4000) (intervals 56 61703 8137) (buffers 976 291)) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-erc-cmd-GMSG-erc-cmd-AMSG-erc-cmd-GME-erc-cmd-AME.patch --] [-- Type: text/x-diff, Size: 2327 bytes --] From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Fri, 12 Jan 2024 11:37:28 +0100 Subject: [PATCH] `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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
[parent not found: <87v87yvnly.fsf@dataswamp.org>]
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] <87v87yvnly.fsf@dataswamp.org> @ 2024-01-12 12:08 ` Eli Zaretskii 2024-01-12 14:12 ` Emanuel Berg [not found] ` <834jfikb4d.fsf@gnu.org> 1 sibling, 1 reply; 45+ messages in thread From: Eli Zaretskii @ 2024-01-12 12:08 UTC (permalink / raw) To: Emanuel Berg; +Cc: emacs-erc, 68401 > Cc: emacs-erc@gnu.org > From: Emanuel Berg <incal@dataswamp.org> > Tags: patch > Date: Fri, 12 Jan 2024 11:43:05 +0100 > > Patch without whitespace changes. It still lacks a log message according to our conventions. > >From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 > From: Emanuel Berg <incal@dataswamp.org> > Date: Fri, 12 Jan 2024 11:37:28 +0100 > Subject: [PATCH] `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. This only gives the header line of a commit log message, but the "meat" is missing. Here's a random example of a valid commit log message (you can see more by typing "git log" from the shell prompt or "C-x v L" inside Emacs): Implement missing functions for custom-icon widget * lisp/cus-edit.el (custom-icon-reset-saved, custom-icon-mark-to-save) (custom-icon-state-set-and-redraw, custom-icon-reset-standard) (custom-icon-mark-to-reset-standard): New functions. (custom-icon, custom-icon-extended-menu): Register and add them to the menu. (Bug#66947) See CONTRIBUTE for more information about our conventions in this regard. > -(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: ") Our style is also to mention the interactive prompts in the doc string: "Send LINE to all channels on all networks you are on. Interactively, prompt for the line of text to send." > +(defun erc-cmd-AMSG (line) > + "Send LINE to all channels of the current network." Same here. > +(defun erc-cmd-GME (line) > + "Send LINE as an action to all channels on all networks you are on." And here. > +(defun erc-cmd-AME (line) > + "Send LINE as an action to all channels on the current network." And here. Thanks. ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-12 12:08 ` Eli Zaretskii @ 2024-01-12 14:12 ` Emanuel Berg 2024-01-12 14:39 ` Eli Zaretskii 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-12 14:12 UTC (permalink / raw) To: 68401 [-- Attachment #1: Type: text/plain, Size: 474 bytes --] Eli Zaretskii wrote: > Our style is also to mention the interactive prompts in the > doc string: > > "Send LINE to all channels on all networks you are on. > Interactively, prompt for the line of text to send." Here is a patch adding that, maybe if you apply it sequentially after the first it will work? I looked for a way to merge the two patches into one but didn't find one, but I take it that is possible with git? To create one patch out of all the commits? [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0002-Docstrings-for-interactive-use.patch --] [-- Type: text/x-diff, Size: 2218 bytes --] From 73f3cc5072bb8cc95ce5367cb8aef74e5b047f0d Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> 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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-12 14:12 ` Emanuel Berg @ 2024-01-12 14:39 ` Eli Zaretskii 2024-01-13 2:09 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Eli Zaretskii @ 2024-01-12 14:39 UTC (permalink / raw) To: Emanuel Berg; +Cc: 68401 > From: Emanuel Berg <incal@dataswamp.org> > Date: Fri, 12 Jan 2024 15:12:57 +0100 > > Eli Zaretskii wrote: > > > Our style is also to mention the interactive prompts in the > > doc string: > > > > "Send LINE to all channels on all networks you are on. > > Interactively, prompt for the line of text to send." > > Here is a patch adding that, maybe if you apply it > sequentially after the first it will work? It will, but it would be more convenient to have a single patch. > To create one patch out of all the commits? Yes, please. ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-12 14:39 ` Eli Zaretskii @ 2024-01-13 2:09 ` Emanuel Berg 2024-01-13 2:31 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-13 2:09 UTC (permalink / raw) To: 68401 [-- Attachment #1: Type: text/plain, Size: 175 bytes --] Eli Zaretskii wrote: >> 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 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-all.patch --] [-- Type: text/x-diff, Size: 4551 bytes --] From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> 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 <incal@dataswamp.org> 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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-13 2:09 ` Emanuel Berg @ 2024-01-13 2:31 ` Emanuel Berg 2024-01-13 2:45 ` Emanuel Berg 2024-01-13 7:23 ` Eli Zaretskii 0 siblings, 2 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-13 2:31 UTC (permalink / raw) To: 68401 [-- Attachment #1: Type: text/plain, Size: 377 bytes --] >>> 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. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-all.patch --] [-- Type: text/x-diff, Size: 4760 bytes --] From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> 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 <incal@dataswamp.org> 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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-13 2:31 ` Emanuel Berg @ 2024-01-13 2:45 ` Emanuel Berg 2024-01-13 7:23 ` Eli Zaretskii 1 sibling, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-13 2:45 UTC (permalink / raw) To: 68401 [-- Attachment #1: Type: text/plain, Size: 514 bytes --] >>>> 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. Re-did everything since that patch still consists of two patches. Now everything should be in one piece, in one patch. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Functions-for-ERC.patch --] [-- Type: text/x-diff, Size: 2706 bytes --] From fa8ae9dcc306d16cccdd6aa7c2bac242b90adbdb Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Sat, 13 Jan 2024 03:40:05 +0100 Subject: [PATCH] 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 | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 478683a77f5..aeb7722b563 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4016,16 +4016,44 @@ 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. +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 - (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. +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 + (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. +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))) + (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. +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))) + (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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-13 2:31 ` Emanuel Berg 2024-01-13 2:45 ` Emanuel Berg @ 2024-01-13 7:23 ` Eli Zaretskii 2024-01-14 9:11 ` Emanuel Berg 1 sibling, 1 reply; 45+ messages in thread From: Eli Zaretskii @ 2024-01-13 7:23 UTC (permalink / raw) To: Emanuel Berg; +Cc: 68401 > From: Emanuel Berg <incal@dataswamp.org> > Date: Sat, 13 Jan 2024 03:31:28 +0100 > > I didn't find a command to change the commit message of the > patch The command you are looking for is git commit --amend ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-13 7:23 ` Eli Zaretskii @ 2024-01-14 9:11 ` Emanuel Berg 0 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-14 9:11 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Eli Zaretskii wrote: >> I didn't find a command to change the commit message of the >> patch > > The command you are looking for is > > git commit --amend Thank you and JP for the help with git commands, here are the commands I accumulated only working on this small patch. But I think it doesn't take that long to become fluent with the git basics, after that overhead efforts are less frustrating. If one wants to `untabify' files on `save-buffer', but not in cases like this, this is more tricky but as a poor man's solution one can add exceptions to the function that does it, like this (defun untab-all () (unless (member major-mode '(emacs-lisp-mode makefile-gmake-mode makefile-mode) ) ; exceptions (untabify (point-min) (point-max))) nil) That last `nil' indicates it did not write the buffer to the disk, used by `before-save-hook' - so it is useful, even tho it looks funky in a defun. $ git checkout -b ib master ... $ git commit -a $ git format-patch master -M -o .ib M-x erc-bug RET Tags: patch C-c C-a (`mml-attach-file') C-c C-c (`message-send-and-exit') $ git log $ git format-patch -2 HEAD --stdout > last-two.patch $ git commit --amend $ git branch $ git branch -D ib -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
[parent not found: <834jfikb4d.fsf@gnu.org>]
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] ` <834jfikb4d.fsf@gnu.org> @ 2024-01-12 12:36 ` Emanuel Berg [not found] ` <87ply6vidl.fsf@dataswamp.org> [not found] ` <87mstavias.fsf@dataswamp.org> 2 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-12 12:36 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-erc, 68401 Eli Zaretskii wrote: > This only gives the header line of a commit log message, but > the "meat" is missing. Here's a random example of a valid It is valid, I know that since 'git commit' complained several times of non-empty lines, too long lines etc. > Our style is also to mention the interactive prompts in the > doc string: > > "Send LINE to all channels on all networks you are on. > Interactively, prompt for the line of text to send." If so the tools should say so but they don't. This is too inefficient for modern society. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
[parent not found: <87ply6vidl.fsf@dataswamp.org>]
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] ` <87ply6vidl.fsf@dataswamp.org> @ 2024-01-12 14:03 ` Eli Zaretskii 2024-01-12 14:30 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Eli Zaretskii @ 2024-01-12 14:03 UTC (permalink / raw) To: Emanuel Berg; +Cc: emacs-erc, 68401 > From: Emanuel Berg <incal@dataswamp.org> > Cc: 68401@debbugs.gnu.org, emacs-erc@gnu.org > Date: Fri, 12 Jan 2024 13:36:06 +0100 > > Eli Zaretskii wrote: > > > This only gives the header line of a commit log message, but > > the "meat" is missing. Here's a random example of a valid > > It is valid, I know that since 'git commit' complained several > times of non-empty lines, too long lines etc. That's just the beginning of good commit log messages. The other aspects are also required, and that's why they are described in CONTRIBUTE. We expect the contributors to follow those conventions, and we point out any deviations from them as part of the patch review process. > > Our style is also to mention the interactive prompts in the > > doc string: > > > > "Send LINE to all channels on all networks you are on. > > Interactively, prompt for the line of text to send." > > If so the tools should say so but they don't. This is too > inefficient for modern society. Likewise here: we request that contributors adhere to our conventions, even if the automated tools didn't yet catch up. That's why patch review requires human participation, instead of being an automated process: the tools are not yet powerful enough to make it completely computerized. ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-12 14:03 ` Eli Zaretskii @ 2024-01-12 14:30 ` Emanuel Berg 0 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-12 14:30 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Eli Zaretskii wrote: > The other aspects are also required, and that's why they are > described in CONTRIBUTE. We expect the contributors to > follow those conventions, and we point out any deviations > from them as part of the patch review process. Yeah, if this is how you choose to spend your time being active with Emacs, count me out. This kind of inefficiency is alien to modern society. Maybe someone is writing an interactive tool to produce correct commit messages, if so I'll wait for that. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
[parent not found: <87mstavias.fsf@dataswamp.org>]
[parent not found: <87wmseoskl.fsf@dataswamp.org>]
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] ` <87wmseoskl.fsf@dataswamp.org> @ 2024-01-19 2:58 ` J.P. 2024-01-22 10:18 ` Emanuel Berg 2024-01-23 13:42 ` Emanuel Berg 0 siblings, 2 replies; 45+ messages in thread From: J.P. @ 2024-01-19 2:58 UTC (permalink / raw) To: 68401; +Cc: Emanuel Berg, emacs-erc [-- Attachment #1: Type: text/plain, Size: 7826 bytes --] Emanuel Berg <incal@dataswamp.org> writes: >> From fa8ae9dcc306d16cccdd6aa7c2bac242b90adbdb Mon Sep 17 00:00:00 2001 > From: Emanuel Berg <incal@dataswamp.org> > Date: Sat, 13 Jan 2024 03:40:05 +0100 > Subject: [PATCH] Functions for ERC. Emacs doesn't seem to be very picky about a commit's subject line, but I'd prefer those for ERC that aren't mechanical or administrative in nature to be somewhat unique and distinguishable at a glance, such as Make erc-cmd-AMSG session-local, add /GMSG /AME /GME > `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) I believe the guidelines call for a commit body to be formatted as a change log entry, for example: * lisp/erc/erc.el (erc-cmd-AMSG): Make good on behavior described in the doc string by limiting damage to the current connection. (erc-cmd-GMSG, erc-cmd-GME, erc-cmd-AME): New functions, all IRC "slash commands". (Bug#68401) > --- > lisp/erc/erc.el | 38 +++++++++++++++++++++++++++++++++----- > 1 file changed, 33 insertions(+), 5 deletions(-) > > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 478683a77f5..aeb7722b563 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -4016,16 +4016,44 @@ 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. > +Interactively, prompt for the line of text to send." > + (interactive "sSend to all channels: ") I question the wisdom of having new slash commands serve double duty as interactive Emacs commands (at least those handling chat input). This reservation has nothing to do with M-x erc-cmd-FOO <RET> being less faithful (or whatever) to the traditional IRC experience than /FOO <RET>. Rather, it stems from a need to prioritize consistent feedback and promote maintainability by only having a single path for chat input to reach the server (except under special circumstances). Normally, when a user submits chat input at the prompt, ERC engages in a series of validation checks before pushing a message out the door. These steps are bypassed when someone invokes what's normally a slash command via M-x. For example, if you /DISCONNECT and issue an /AMSG at the prompt, you'll see "Process not running" in the echo area, and the input will remain there for further editing, killing, etc. However, if you run M-x erc-cmd-AMSG <RET>, the message will be inserted in all target buffers, even though nothing is actually sent, which is misleading. Obviously, we can't make `erc-cmd-AMSG' non-interactive because it's been `commandp' forever. But new related commands don't have to follow its (IMO flawed) example. As far as counterarguments go, the only one that comes to mind for making these `commandp' is that doing so also makes managing interactive menus for modules like `bufbar', `nickbar', and `button' easier. For example, at first glance, making `erc-cmd-KICK' interactive would appear to streamline its inclusion in `erc-nick-popup-alist' and obviate the need for an `erc-button-cmd-KICK'. However, if you look closely at this arrangement, you'll see that even if `erc-cmd-KICK' were made a proper Emacs command, a button-specific wrapper would still be necessary because it makes special accommodations for the potential lack of a channel context from which to draw membership rolls for completion. Such a thing isn't necessary when issuing a /KICK <TAB> at the prompt because the function `pcomplete/erc-mode/KICK' knows it's already running in a channel. > (setq line (erc-trim-string line)) It might be nice to remove at most one space, for cases where a user wants to send preformatted text. OTOH, normal /MSG doesn't do this, so perhaps we shouldn't here either. > (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))) Without first checking for connectivity, we run into another situation in which messages may be inserted but not sent, similar to the bit about commands being potentially "misleading," above. The most obvious way to solve this is to check for "physical" connectivity with something like: (erc-with-all-buffers-of-server nil #'erc-server-process-alive (when (and erc--target (erc--current-buffer-joined-p)) (erc-send-message line)))) Alternatively, you can check for "logical" connectivity, which is probably more in keeping with traditional design principles: (erc-with-all-buffers-of-server nil nil (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) (erc-send-message line)))) One minor downside of this second method is that IRC adjacent protocols and aberrant proxy servers that happen to skip 376/422 and also provide some (possibly &local) "control channel" won't be detected. (BTW, you won't be needing the `erc--target' in either example if you rebase atop the latest master.) > +(put 'erc-cmd-GMSG 'do-not-parse-args t) > + > +(defun erc-cmd-AMSG (line) > + "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 > + (lambda () (erc-channel-p (erc-default-target))) ^ Indentation. This macro is declared "indent 2" > (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. > +Interactively, prompt for the line of text to send." > + (interactive "sSend action to all channels: ") This command currently fails when invoked interactively. For example, if I run M-x erc-cmd-GME <RET> hi <RET> from any ERC buffer belonging to a connected session, nothing appears in the server logs or any ERC buffer. This needs addressing if you're intent on keeping these interactive, which I'm rather against for reasons previously noted. > + (erc-with-all-buffers-of-server nil > + (lambda () (erc-channel-p (erc-default-target))) > + (erc-cmd-ME line) )) This currently suffers from the same problem as /GMSG regarding disconnected buffers. However you address this, it's probably best to use the same approach for fixing both functions. > +(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. > +Interactively, prompt for the line of text to send." > + (interactive "sSend action to all channels on this network: ") This command also appears do to nothing when invoked via M-x. > + (erc-with-all-buffers-of-server erc-server-process > + (lambda () (erc-channel-p (erc-default-target))) ^ Indentation again. > + (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 The attached patch is a unit test for all four commands. It doesn't bother asserting M-x behavior (because see above). Please try to make it pass without changing the test itself (unless there's a bug). $ git am /tmp/0002-5.x-Add...etc.patch $ make -C test lisp/erc/erc-scenarios-misc-commands.log \ SELECTOR=erc-scenarios-misc-commands--AMSG-GMSG-AME-GME [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0002-5.x-Add-tests-for-ERC-slash-commands-AMSG-GMSG-etc.patch --] [-- Type: text/x-patch, Size: 13897 bytes --] From 0dfe03ad58e6d1edd47eace6faddeeb1733f6b37 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@neverwas.me> Date: Mon, 15 Jan 2024 22:40:44 -0800 Subject: [PATCH 2/2] [5.x] Add tests for ERC slash commands /AMSG, /GMSG, etc. * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. (Bug#68401) --- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.42.0 ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-19 2:58 ` J.P. @ 2024-01-22 10:18 ` Emanuel Berg 2024-01-22 15:11 ` J.P. 2024-01-23 13:42 ` Emanuel Berg 1 sibling, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-22 10:18 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: > Make erc-cmd-AMSG session-local, add /GMSG /AME /GME > > * lisp/erc/erc.el (erc-cmd-AMSG): Make good on behavior described in > the doc string by limiting damage to the current connection. > (erc-cmd-GMSG, erc-cmd-GME, erc-cmd-AME): New functions, all IRC > "slash commands". (Bug#68401) Okay, I'll use that instead. But let's agree on the source first. > I question the wisdom of having new slash commands serve > double duty as interactive Emacs commands (at least those > handling chat input). This reservation has nothing to do > with M-x erc-cmd-FOO <RET> being less faithful (or whatever) > to the traditional IRC experience than /FOO <RET>. Rather, > it stems from a need to prioritize consistent feedback and > promote maintainability by only having a single path for > chat input to reach the server (except under special > circumstances). I made them interactive as `erc-cmd-AMSG' is interactive, but let's remove it from the other three then. [ As a side note, Emacs has a problem with different interfaces doing too much and influencing the behavior of their functions. Interfaces should just be different ways of setting the formal parameters, after that the exact same thing should happen for the same data. ] >> (setq line (erc-trim-string line)) > > It might be nice to remove at most one space, for cases > where a user wants to send preformatted text. OTOH, normal > /MSG doesn't do this, so perhaps we shouldn't here either. Again, this is in the original `erc-cmd-AMSG'. I have no opinion, so you can decide it. "At most one space", what space should that be? Leading or trailing? This is nothing `erc-trim-string' can do BTW. But we can of course still remove whatever spaces we like. >> (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))) > > Without first checking for connectivity, we run into another > situation in which messages may be inserted but not sent, > similar to the bit about commands being potentially > "misleading," above. The most obvious way to solve this is > to check for "physical" connectivity with something like: > > (erc-with-all-buffers-of-server nil #'erc-server-process-alive > (when (and erc--target (erc--current-buffer-joined-p)) > (erc-send-message line)))) > > Alternatively, you can check for "logical" connectivity, > which is probably more in keeping with traditional design > principles: > > (erc-with-all-buffers-of-server nil nil > (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) > (erc-send-message line)))) > > One minor downside of this second method is that IRC > adjacent protocols and aberrant proxy servers that happen to > skip 376/422 and also provide some (possibly &local) > "control channel" won't be detected. (BTW, you won't be > needing the `erc--target' in either example if you rebase > atop the latest master.) Okay, but instead of having these checks embedded and hopefully correctly repeated four times, shouldn't we have two functions, say "erc-connected-physical-p" and "erc-connected-logical-p" and call either of those (or both) from the functions? >> +(put 'erc-cmd-GMSG 'do-not-parse-args t) >> + >> +(defun erc-cmd-AMSG (line) >> + "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 >> + (lambda () (erc-channel-p (erc-default-target))) > > ^ Indentation. This macro is declared "indent 2" Okay, fixed that. > rebase How do you do that, just 'git pull'? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-22 10:18 ` Emanuel Berg @ 2024-01-22 15:11 ` J.P. 2024-01-22 17:00 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: J.P. @ 2024-01-22 15:11 UTC (permalink / raw) To: bug-gnu-emacs; +Cc: emacs-erc Emanuel Berg <incal@dataswamp.org> writes: > J.P. wrote: > >> Make erc-cmd-AMSG session-local, add /GMSG /AME /GME >> >> * lisp/erc/erc.el (erc-cmd-AMSG): Make good on behavior described in >> the doc string by limiting damage to the current connection. >> (erc-cmd-GMSG, erc-cmd-GME, erc-cmd-AME): New functions, all IRC >> "slash commands". (Bug#68401) > > Okay, I'll use that instead. But let's agree on the > source first. > >> I question the wisdom of having new slash commands serve >> double duty as interactive Emacs commands (at least those >> handling chat input). This reservation has nothing to do >> with M-x erc-cmd-FOO <RET> being less faithful (or whatever) >> to the traditional IRC experience than /FOO <RET>. Rather, >> it stems from a need to prioritize consistent feedback and >> promote maintainability by only having a single path for >> chat input to reach the server (except under special >> circumstances). > > I made them interactive as `erc-cmd-AMSG' is interactive, but > let's remove it from the other three then. > > [ As a side note, Emacs has a problem with different > interfaces doing too much and influencing the behavior of > their functions. Interfaces should just be different ways of > setting the formal parameters, after that the exact same > thing should happen for the same data. ] > >>> (setq line (erc-trim-string line)) >> >> It might be nice to remove at most one space, for cases >> where a user wants to send preformatted text. OTOH, normal >> /MSG doesn't do this, so perhaps we shouldn't here either. > > Again, this is in the original `erc-cmd-AMSG'. I have no > opinion, so you can decide it. > > "At most one space", what space should that be? Leading or > trailing? Leading. See the test for `erc-extract-command-from-line' to understand the behavior of `do-not-parse-args', which determines LINE. Actually, if we're doing away with `commandp', there should be no reason for "at most one," only "exactly one" (IIRC). > This is nothing `erc-trim-string' can do BTW. But we > can of course still remove whatever spaces we like. I wasn't implying you ought to change `erc-trim-string' but rather that you can replace its call with an expression to remove a leading space. > >>> (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))) >> >> Without first checking for connectivity, we run into another >> situation in which messages may be inserted but not sent, >> similar to the bit about commands being potentially >> "misleading," above. The most obvious way to solve this is >> to check for "physical" connectivity with something like: >> >> (erc-with-all-buffers-of-server nil #'erc-server-process-alive >> (when (and erc--target (erc--current-buffer-joined-p)) >> (erc-send-message line)))) >> >> Alternatively, you can check for "logical" connectivity, >> which is probably more in keeping with traditional design >> principles: >> >> (erc-with-all-buffers-of-server nil nil >> (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) >> (erc-send-message line)))) >> >> One minor downside of this second method is that IRC >> adjacent protocols and aberrant proxy servers that happen to >> skip 376/422 and also provide some (possibly &local) >> "control channel" won't be detected. (BTW, you won't be >> needing the `erc--target' in either example if you rebase >> atop the latest master.) > > Okay, but instead of having these checks embedded and hopefully > correctly repeated four times, shouldn't we have two functions, say > "erc-connected-physical-p" and "erc-connected-logical-p" and call > either of those (or both) from the functions? If you want to factor out a common helper function, fine by me. AFAICT such a thing would need to include `erc-with-all-buffers-of-server' to be effective unless the predicates you've named alone result in meaningful code reuse. (Not sure how an `erc-connected-physical-p' would be any different than the existing 'erc-server-process-alive', though I suppose an `erc-connected-logical-p' could be useful if it just returns `erc-server-connected'.) >>> +(put 'erc-cmd-GMSG 'do-not-parse-args t) >>> + >>> +(defun erc-cmd-AMSG (line) >>> + "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 >>> + (lambda () (erc-channel-p (erc-default-target))) >> >> ^ Indentation. This macro is declared "indent 2" > > Okay, fixed that. > >> rebase > > How do you do that, just 'git pull'? Assuming you have your work on "my-branch" $ git checkout master $ git pull $ git rebase master my-branch. If you applied the unit-test patch atop your commit, you won't be able to "git commit --amend" your previous changes. See the "-i, --interactive" option for git-rebase(1), then maybe rearrange things so your patch comes *after* the test. You can always "git rebase --abort" if you mess up. And there's always #git on Libera. ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-22 15:11 ` J.P. @ 2024-01-22 17:00 ` Emanuel Berg 2024-01-22 19:23 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-22 17:00 UTC (permalink / raw) To: emacs-erc; +Cc: bug-gnu-emacs J.P. wrote: >>> It might be nice to remove at most one space, for cases >>> where a user wants to send preformatted text. OTOH, normal >>> /MSG doesn't do this, so perhaps we shouldn't here either. >> >> Again, this is in the original `erc-cmd-AMSG'. I have no >> opinion, so you can decide it. >> >> "At most one space", what space should that be? >> Leading or trailing? > > Leading. See the test for `erc-extract-command-from-line' to > understand the behavior of `do-not-parse-args', which > determines LINE. Actually, if we're doing away with > `commandp', there should be no reason for "at most one," > only "exactly one" (IIRC). So if and only if the initial char is a whitespace, it, and only it, should be dropped. E.g. " line string " should be transformed into " line string ". Also, at this point, only "erc-cmd-AMSG" and "erc-cmd-GMSG" has the trim line, and the reason is it is present in the original `erc-cmd-AMSG'. Should we also have the new one in `erc-cmd-AME' and `erc-cmd-GME'? >>>> (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))) >>> >>> Without first checking for connectivity, we run into >>> another situation in which messages may be inserted but >>> not sent, similar to the bit about commands being >>> potentially "misleading," above. The most obvious way to >>> solve this is to check for "physical" connectivity with >>> something like: >>> >>> (erc-with-all-buffers-of-server nil #'erc-server-process-alive >>> (when (and erc--target (erc--current-buffer-joined-p)) >>> (erc-send-message line)))) >>> >>> Alternatively, you can check for "logical" connectivity, >>> which is probably more in keeping with traditional design >>> principles: >>> >>> (erc-with-all-buffers-of-server nil nil >>> (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) >>> (erc-send-message line)))) >>> >>> One minor downside of this second method is that IRC >>> adjacent protocols and aberrant proxy servers that happen >>> to skip 376/422 and also provide some (possibly &local) >>> "control channel" won't be detected. (BTW, you won't be >>> needing the `erc--target' in either example if you rebase >>> atop the latest master.) >> >> Okay, but instead of having these checks embedded and >> hopefully correctly repeated four times, shouldn't we have >> two functions, say "erc-connected-physical-p" and >> "erc-connected-logical-p" and call either of those (or >> both) from the functions? > > If you want to factor out a common helper function, fine by > me. AFAICT such a thing would need to include > `erc-with-all-buffers-of-server' to be effective unless the > predicates you've named alone result in meaningful code > reuse. (Not sure how an `erc-connected-physical-p' would be > any different than the existing 'erc-server-process-alive', > though I suppose an `erc-connected-logical-p' could be > useful if it just returns `erc-server-connected'.) Okay, I'm on it, stay tuned. > If you applied the unit-test patch atop your commit, you > won't be able to "git commit --amend" your previous changes. > See the "-i, --interactive" option for git-rebase(1), then > maybe rearrange things so your patch comes *after* the test. > You can always "git rebase --abort" if you mess up. > And there's always #git on Libera. No, I didn't do the unit test, let's agree on the source first, after that it will be interesting to try it. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-22 17:00 ` Emanuel Berg @ 2024-01-22 19:23 ` Emanuel Berg [not found] ` <87y1ch851b.fsf@igel.home> 2024-01-22 21:27 ` J.P. 0 siblings, 2 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-22 19:23 UTC (permalink / raw) To: emacs-erc; +Cc: bug-gnu-emacs >>>> It might be nice to remove at most one space, for cases >>>> where a user wants to send preformatted text. OTOH, >>>> normal /MSG doesn't do this, so perhaps we shouldn't >>>> here either. >>> >>> Again, this is in the original `erc-cmd-AMSG'. I have no >>> opinion, so you can decide it. >>> >>> "At most one space", what space should that be? >>> Leading or trailing? >> >> Leading. See the test for `erc-extract-command-from-line' >> to understand the behavior of `do-not-parse-args', which >> determines LINE. Actually, if we're doing away with >> `commandp', there should be no reason for "at most one," >> only "exactly one" (IIRC). > > So if and only if the initial char is a whitespace, it, and > only it, should be dropped. E.g. " line string " should be > transformed into " line string ". (defun erc-drop-leading-whitespace (str) (if (string-match " \\(.*\\)" str) (match-string 1 str) str) ) >>>> Without first checking for connectivity, we run into >>>> another situation in which messages may be inserted but >>>> not sent, similar to the bit about commands being >>>> potentially "misleading," above. The most obvious way to >>>> solve this is to check for "physical" connectivity with >>>> something like: >>>> >>>> (erc-with-all-buffers-of-server nil #'erc-server-process-alive >>>> (when (and erc--target (erc--current-buffer-joined-p)) >>>> (erc-send-message line)))) If we can drop `erc--target' in the latest Emacs source as you say that means there is only this left (and (erc-server-process-alive) (erc--current-buffer-joined-p)) >>>> Alternatively, you can check for "logical" connectivity, >>>> which is probably more in keeping with traditional design >>>> principles: >>>> >>>> (erc-with-all-buffers-of-server nil nil >>>> (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) >>>> (erc-send-message line)))) If we again can drop `erc--target' and want `erc-server-connected' to be returned upon success we can do (and (erc--current-buffer-joined-p) erc-server-connected) If we unify those two tests it will be (defun erc-connected-and-joined-p () (and (erc-server-process-alive) (erc--current-buffer-joined-p) erc-server-connected)) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
[parent not found: <87y1ch851b.fsf@igel.home>]
* Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] ` <87y1ch851b.fsf@igel.home> @ 2024-01-22 21:05 ` Emanuel Berg 0 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-22 21:05 UTC (permalink / raw) To: emacs-erc; +Cc: bug-gnu-emacs Andreas Schwab wrote: >> (defun erc-drop-leading-whitespace (str) >> (if (string-match " \\(.*\\)" str) >> (match-string 1 str) >> str) ) > > (erc-drop-leading-whitespace "foo bar") => "bar" Ah, forgot the ^ and $, thank you. (defun erc-drop-leading-whitespace (str) (if (string-match "^ \\(.*\\)$" str) (match-string 1 str) str) ) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-22 19:23 ` Emanuel Berg [not found] ` <87y1ch851b.fsf@igel.home> @ 2024-01-22 21:27 ` J.P. 2024-01-23 4:25 ` Emanuel Berg 1 sibling, 1 reply; 45+ messages in thread From: J.P. @ 2024-01-22 21:27 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Emanuel Berg <incal@dataswamp.org> writes: >>>>> It might be nice to remove at most one space, for cases >>>>> where a user wants to send preformatted text. OTOH, >>>>> normal /MSG doesn't do this, so perhaps we shouldn't >>>>> here either. >>>> >>>> Again, this is in the original `erc-cmd-AMSG'. I have no >>>> opinion, so you can decide it. >>>> >>>> "At most one space", what space should that be? >>>> Leading or trailing? >>> >>> Leading. See the test for `erc-extract-command-from-line' >>> to understand the behavior of `do-not-parse-args', which >>> determines LINE. Actually, if we're doing away with >>> `commandp', there should be no reason for "at most one," >>> only "exactly one" (IIRC). >> >> So if and only if the initial char is a whitespace, it, and >> only it, should be dropped. E.g. " line string " should be >> transformed into " line string ". >> >> Also, at this point, only "erc-cmd-AMSG" and "erc-cmd-GMSG" >> has the trim line, and the reason is it is present in the >> original `erc-cmd-AMSG'. >> >> Should we also have the new one in `erc-cmd-AME' and >> `erc-cmd-GME'? Please look at the "source" of `erc-cmd-ME', which these commands both call, and you will (hopefully) have your answer. > Andreas Schwab wrote: > >> (defun erc-drop-leading-whitespace (str) > >> (if (string-match " \\(.*\\)" str) > >> (match-string 1 str) > >> str) ) > > > > (erc-drop-leading-whitespace "foo bar") => "bar" > Ah, forgot the ^ and $, thank you. > (defun erc-drop-leading-whitespace (str) > (if (string-match "^ \\(.*\\)$" str) > (match-string 1 str) > str) ) Why not use `string-prefix-p' and `substring' to accomplish this? Also, please name this using the internal "--" convention, something like `erc--drop-initial-space-char' or `erc--drop-single-leading-space'. >>>>> Without first checking for connectivity, we run into >>>>> another situation in which messages may be inserted but >>>>> not sent, similar to the bit about commands being >>>>> potentially "misleading," above. The most obvious way to >>>>> solve this is to check for "physical" connectivity with >>>>> something like: >>>>> >>>>> (erc-with-all-buffers-of-server nil #'erc-server-process-alive >>>>> (when (and erc--target (erc--current-buffer-joined-p)) >>>>> (erc-send-message line)))) > > If we can drop `erc--target' in the latest Emacs source as you > say that means there is only this left > > (and (erc-server-process-alive) (erc--current-buffer-joined-p)) Correct. >>>>> Alternatively, you can check for "logical" connectivity, >>>>> which is probably more in keeping with traditional design >>>>> principles: >>>>> >>>>> (erc-with-all-buffers-of-server nil nil >>>>> (when (and erc-server-connected erc--target (erc--current-buffer-joined-p)) >>>>> (erc-send-message line)))) > > If we again can drop `erc--target' and want > `erc-server-connected' to be returned upon success we can do > > (and (erc--current-buffer-joined-p) erc-server-connected) Correct. > If we unify those two tests it will be > > (defun erc-connected-and-joined-p () > (and (erc-server-process-alive) > (erc--current-buffer-joined-p) > erc-server-connected)) No! Well... it's superfluous and hand wavy, and we ought not conflate the two unless we're going into the chimera breeding business, in which case we'd want (and (erc--current-buffer-joined-p) (or erc-server-connected (erc-server-process-alive))) Regardless, the confusion here is my fault because I should never have mentioned `erc-server-process-alive' to begin with. The corner cases in which (when (erc-server-process-alive) (cl-assert erc-server-connected)) actually signals are rare, and we can safely ignore them, at least in this context. Although, it's worth noting that the reverse of (when erc-server-connected (cl-assert (erc-server-process-alive))) is an operating invariant that must never signal unless we're tearing down a session. But let's just drop the `erc-server-process-alive' business if you don't mind. Also, `erc-connected-and-joined-p' should be `erc--connected-and-joined-p' unless you can find at least one more person to +1 exporting it. ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-22 21:27 ` J.P. @ 2024-01-23 4:25 ` Emanuel Berg 2024-01-23 4:32 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-23 4:25 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: >> (defun erc-drop-leading-whitespace (str) >> (if (string-match "^ \\(.*\\)$" str) >> (match-string 1 str) >> str) ) > > Why not use `string-prefix-p' and `substring' to accomplish > this? Also, please name this using the internal "--" > convention, something like `erc--drop-initial-space-char' or > `erc--drop-single-leading-space'. Good idea to use `string-prefix-p' and `substring', but it hasn't anything to do with ERC at this point - it should be put in some string manipulation library and then ERC should `require' it. (drop-prefix "pre" "prefix") ; fix But, now I think I've done it all? Have a look to see if everyone is happy, if so I can start fiddling with the unit test patch. (defun drop-prefix (pf str) (if (string-prefix-p pf str) (substring str (length pf)) str)) (defun erc--connected-and-joined-p () (and (erc--current-buffer-joined-p) erc-server-connected)) (defun erc-cmd-GMSG (line) "Send LINE to all channels on all networks you are on." (setq line (drop-prefix " " line)) (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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. Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (drop-prefix " " line)) (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (erc-cmd-ME line)))) (put 'erc-cmd-AME 'do-not-parse-args t) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-23 4:25 ` Emanuel Berg @ 2024-01-23 4:32 ` Emanuel Berg 2024-01-23 6:20 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-23 4:32 UTC (permalink / raw) To: 68401; +Cc: emacs-erc >>> (defun erc-drop-leading-whitespace (str) >>> (if (string-match "^ \\(.*\\)$" str) >>> (match-string 1 str) >>> str) ) >> >> Why not use `string-prefix-p' and `substring' to accomplish >> this? Also, please name this using the internal "--" >> convention, something like `erc--drop-initial-space-char' >> or `erc--drop-single-leading-space'. > > Good idea to use `string-prefix-p' and `substring', but it > hasn't anything to do with ERC at this point - it should be > put in some string manipulation library and then ERC should > `require' it. [...] > > But, now I think I've done it all? > > Have a look to see if everyone is happy, if so I can start > fiddling with the unit test patch. ;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/erc/erc-misc.el ;; ;; Make erc-cmd-AMSG session-local, add /GMSG /AME /GME ;; ;; * lisp/erc/erc.el (erc-cmd-AMSG): Make good on behavior described in ;; the doc string by limiting damage to the current connection. ;; (erc-cmd-GMSG, erc-cmd-GME, erc-cmd-AME): New functions, all IRC ;; "slash commands". (Bug#68401) (require 'erc) (defun drop-prefix (pf str) (if (string-prefix-p pf str) (substring str (length pf)) str)) (defun erc--connected-and-joined-p () (and (erc--current-buffer-joined-p) erc-server-connected)) (defun erc-cmd-GMSG (line) "Send LINE to all channels on all networks you are on." (setq line (drop-prefix " " line)) (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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. Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (drop-prefix " " line)) (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (erc-cmd-ME line)))) (put 'erc-cmd-AME 'do-not-parse-args t) (provide 'erc-misc) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-23 4:32 ` Emanuel Berg @ 2024-01-23 6:20 ` Emanuel Berg 2024-01-23 13:31 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-23 6:20 UTC (permalink / raw) To: 68401; +Cc: emacs-erc >>>> (defun erc-drop-leading-whitespace (str) >>>> (if (string-match "^ \\(.*\\)$" str) >>>> (match-string 1 str) >>>> str) ) >>> >>> Why not use `string-prefix-p' and `substring' to >>> accomplish this? Also, please name this using the internal >>> "--" convention, something like >>> `erc--drop-initial-space-char' or >>> `erc--drop-single-leading-space'. >> >> Good idea to use `string-prefix-p' and `substring', but it >> hasn't anything to do with ERC at this point - it should be >> put in some string manipulation library and then ERC should >> `require' it. [...] Someone told me (thanks) there is already a `string-remove-prefix' to do this so that whole thing can be dropped. ;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/erc/erc-misc.el ;; ;; Make erc-cmd-AMSG session-local, add /GMSG /AME /GME ;; ;; * lisp/erc/erc.el (erc-cmd-AMSG): Make good on behavior described in ;; the doc string by limiting damage to the current connection. ;; (erc-cmd-GMSG, erc-cmd-GME, erc-cmd-AME): New functions, all IRC ;; "slash commands". (Bug#68401) (require 'erc) (defun erc--connected-and-joined-p () (and (erc--current-buffer-joined-p) erc-server-connected)) (defun erc-cmd-GMSG (line) "Send LINE to all channels on all networks you are on." (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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. Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (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." (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) (when (erc--connected-and-joined-p) (erc-cmd-ME line)))) (put 'erc-cmd-AME 'do-not-parse-args t) (provide 'erc-misc) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-23 6:20 ` Emanuel Berg @ 2024-01-23 13:31 ` Emanuel Berg 2024-01-24 0:36 ` J.P. 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-23 13:31 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 84 bytes --] Tags: patch Here is a patch with the latest version. I'll run the unit test now. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 2799 bytes --] From b4248461e88241cb81f64ea6c073dad82df8b48c Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands (Bug#68401) --- lisp/erc/erc.el | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 767a693a52e..e89733e7871 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4004,16 +4004,46 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) - (erc-send-message line))) + (lambda () (erc-channel-p (erc-default-target))) + (when (erc--connected-and-joined-p) + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) + (when (erc--connected-and-joined-p) + (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." + (erc-with-all-buffers-of-server nil + (lambda () (erc-channel-p (erc-default-target))) + (when (erc--connected-and-joined-p) + (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." + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) + (when (erc--connected-and-joined-p) + (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 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-23 13:31 ` Emanuel Berg @ 2024-01-24 0:36 ` J.P. 2024-01-24 0:56 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: J.P. @ 2024-01-24 0:36 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Emanuel Berg <incal@dataswamp.org> writes: > Tags: patch > > Here is a patch with the latest version. > > I'll run the unit test now. > >> From b4248461e88241cb81f64ea6c073dad82df8b48c Mon Sep 17 00:00:00 2001 > From: Emanuel Berg <incal@dataswamp.org> > Date: Tue, 23 Jan 2024 14:21:49 +0100 > Subject: [PATCH] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME > > * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc > string by only affecting the current connection. > (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands > (Bug#68401) > --- > lisp/erc/erc.el | 44 +++++++++++++++++++++++++++++++++++++------- > 1 file changed, 37 insertions(+), 7 deletions(-) > > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 767a693a52e..e89733e7871 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -4004,16 +4004,46 @@ 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: ") > - (setq line (erc-trim-string line)) > +(defun erc--connected-and-joined-p () > + (and (erc--current-buffer-joined-p) > + erc-server-connected)) I took your initial remarks advocating for a DRY helper and, in particular, this bit about error-proneness Okay, but instead of having these checks embedded and hopefully correctly repeated four times, shouldn't we ... to mean you wanted to factor out more than just a predicate, e.g., with something like (defun erc--run-in-joined-buffers (line-function line &optional proc) (erc-with-all-buffers-of-server proc #'erc--connected-and-joined-p (funcall line-function line))) (Not that I think such a thing is needed.) > + > +(defun erc-cmd-GMSG (line) > + "Send LINE to all channels on all networks you are on." > + (setq line (string-remove-prefix " " line)) > (erc-with-all-buffers-of-server nil > - (lambda () > - (erc-channel-p (erc-default-target))) > - (erc-send-message line))) > + (lambda () (erc-channel-p (erc-default-target))) > + (when (erc--connected-and-joined-p) > + (erc-send-message line)))) > +(put 'erc-cmd-GMSG 'do-not-parse-args t) I don't understand the point of adding your purpose-built predicate `erc--connected-and-joined-p' if you're not going to use it to replace (lambda () (erc-channel-p (erc-default-target))) completely. IOW, having both is redundant. If you're not already doing so, please try expanding your macro use sites to verify correctness. > + > +(defun erc-cmd-AMSG (line) > + "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 (string-remove-prefix " " line)) > + (erc-with-all-buffers-of-server erc-server-process > + (lambda () (erc-channel-p (erc-default-target))) > + (when (erc--connected-and-joined-p) > + (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." > + (erc-with-all-buffers-of-server nil > + (lambda () (erc-channel-p (erc-default-target))) > + (when (erc--connected-and-joined-p) > + (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." > + (erc-with-all-buffers-of-server erc-server-process > + (lambda () (erc-channel-p (erc-default-target))) > + (when (erc--connected-and-joined-p) > + (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 ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 0:36 ` J.P. @ 2024-01-24 0:56 ` Emanuel Berg 2024-01-24 1:38 ` J.P. 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 0:56 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: > I don't understand the point of adding your purpose-built > predicate `erc--connected-and-joined-p' if you're not going > to use it to replace > > (lambda () (erc-channel-p (erc-default-target))) > > completely. IOW, having both is redundant ?? (lambda () (erc-channel-p (erc-default-target))) has been there all along, you then told me to add the "logical" connectivity test. If we can just use the lambda, I'll be happy to drop the test. > If you're not already doing so, please try expanding your > macro use sites to verify correctness. ??? My "macro use sites" is what? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 0:56 ` Emanuel Berg @ 2024-01-24 1:38 ` J.P. 2024-01-24 2:01 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: J.P. @ 2024-01-24 1:38 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Emanuel Berg <incal@dataswamp.org> writes: > J.P. wrote: > >> I don't understand the point of adding your purpose-built >> predicate `erc--connected-and-joined-p' if you're not going >> to use it to replace >> >> (lambda () (erc-channel-p (erc-default-target))) >> >> completely. IOW, having both is redundant > Redundant from the POV of `erc--connected-and-joined-p' because it calls `erc--current-buffer-joined-p' (which see). Please compare that function's definition to the lambda. There are overlapping concerns there. That is, one "subsumes" the other, thus obviating the need for it. > ?? > > (lambda () (erc-channel-p (erc-default-target))) > > has been there all along, you then told me to add the > "logical" connectivity test. > > If we can just use the lambda, I'll be happy to drop the test. You can't just use the lambda, but you can lose it entirely in favor of your predicate. > >> If you're not already doing so, please try expanding your >> macro use sites to verify correctness. > > ??? > > My "macro use sites" is what? If you expand one of your `erc-with-all-buffers-of-server' forms with both the lambda and `erc--connected-and-joined-p' present, it should become clear why only the latter is needed. ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 1:38 ` J.P. @ 2024-01-24 2:01 ` Emanuel Berg 0 siblings, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 2:01 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 126 bytes --] tags: patch J.P. wrote: > You can't just use the lambda, but you can lose it entirely > in favor of your predicate. Done. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0005-Removed-lambda-connectivity-check-that-is-now-not-ne.patch --] [-- Type: text/x-diff, Size: 2315 bytes --] From fa37950454f6c7536c00a1cc7ec6c00a8b4b4b6b Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Wed, 24 Jan 2024 02:54:46 +0100 Subject: [PATCH 5/5] Removed lambda connectivity check that is now not needed Removed lambda, `erc-connected-and-joined-p' is used instead. * lisp/erc/erc.el (erc-cmd-AMSG, erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): this happened in these functions. (bug#68401) --- lisp/erc/erc.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e89733e7871..25401c15ae7 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4012,9 +4012,8 @@ erc-cmd-GMSG "Send LINE to all channels on all networks you are on." (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-send-message line)))) + #'erc--connected-and-joined-p + (erc-send-message line))) (put 'erc-cmd-GMSG 'do-not-parse-args t) (defun erc-cmd-AMSG (line) @@ -4023,25 +4022,22 @@ erc-cmd-AMSG (interactive "sSend to all channels on this network: ") (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server erc-server-process - (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-send-message line)))) + #'erc--connected-and-joined-p + (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." (erc-with-all-buffers-of-server nil - (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-cmd-ME line)))) + (erc--connected-and-joined-p) + (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." (erc-with-all-buffers-of-server erc-server-process - (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-cmd-ME line)))) + #'erc--connected-and-joined-p + (erc-cmd-ME line))) (put 'erc-cmd-AME 'do-not-parse-args t) (defun erc-cmd-SAY (line) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-19 2:58 ` J.P. 2024-01-22 10:18 ` Emanuel Berg @ 2024-01-23 13:42 ` Emanuel Berg 2024-01-24 0:34 ` J.P. 1 sibling, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-23 13:42 UTC (permalink / raw) To: 68401 J.P. wrote: > The attached patch is a unit test for all four commands. > It doesn't bother asserting M-x behavior (because see > above). Please try to make it pass without changing the test > itself (unless there's a bug). > > $ git am /tmp/0002-5.x-Add...etc.patch > > $ make -C test lisp/erc/erc-scenarios-misc-commands.log \ > SELECTOR=erc-scenarios-misc-commands--AMSG-GMSG-AME-GME The test failed (error "Failed awaiting: string: <alice> bob: Our queen and all") Here is the entire erc-scenarios-misc-commands.log Source file `/home/incal/src/emacs/lisp/emacs-lisp/bytecomp.el' newer than byte-compiled file; using older file Source file `/home/incal/src/emacs/lisp/erc/erc.el' newer than byte-compiled file; using older file Source file `/home/incal/src/emacs/lisp/erc/erc-common.el' newer than byte-compiled file; using older file Source file `/home/incal/src/emacs/lisp/auth-source.el' newer than byte-compiled file; using older file Running 1 tests (2024-01-23 14:35:36+0100, selector `erc-scenarios-misc-commands--AMSG-GMSG-AME-GME') Source file `/home/incal/src/emacs/lisp/erc/erc-button.el' newer than byte-compiled file; using older file Source file `/home/incal/src/emacs/lisp/erc/erc-track.el' newer than byte-compiled file; using older file Error running timer `erc-d--on-request': (error "Match failed: \"PRIVMSG #bar :1 foonet only\" (:exes (\"\\\\`PRIVMSG #bar :2 barnet only\") :dialog amsg-barnet)") Test erc-scenarios-misc-commands--AMSG-GMSG-AME-GME backtrace: Source file `/home/incal/src/emacs/lisp/help-fns.el' newer than byte-compiled file; using older file error("Failed awaiting: %s" "string: <alice> bob: Our queen and all" (if inverted (setq inverted nil) (error "Failed awaiting: %s" (forma (progn (if inverted (setq inverted nil) (error "Failed awaiting: %s" (if (eq -with-timeout-value- 'timeout) (progn (if inverted (setq inv (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-ti (let ((time-out (abs timeout)) (inverted (< timeout 0)) (result 'res (let ((ert--infos (cons (cons "Info: " (concat erc-d-t--wait-message (let* ((rxp (consp text)) (fun (if rxp #'search-forward-regexp #'sea (save-restriction (widen) (let* ((rxp (consp text)) (fun (if rxp #'s erc-d-t-search-for(10 "<alice> bob: Our queen and all" #<marker in n (let* ((pos (cdr (assq (current-buffer) positions))) (erc-d-t--wait- (closure ((positions (#<killed buffer> . #<marker in no buffer>) (#< funcall((closure ((positions (#<killed buffer> . #<marker in no buff (save-current-buffer (set-buffer "#foo") (funcall expect 10 "<tester (let ((ert--infos (cons (cons "Info: " "/AMSG only sent to issuing c (progn (erc-scenarios-common--add-silence) (let ((ert--infos (cons ( (unwind-protect (progn (erc-scenarios-common--add-silence) (let ((er (let* ((orig-autojoin-mode (and (boundp 'erc-autojoin-mode) erc-auto (closure (t) nil (let* ((orig-autojoin-mode (and (boundp 'erc-autojo #f(compiled-function () #<bytecode -0x199f34135bd6a333>)() handler-bind-1(#f(compiled-function () #<bytecode -0x199f34135bd6a33 ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name erc-scenarios-misc-commands--AMSG-GMS ert-run-or-rerun-test(#s(ert--stats :selector erc-scenarios-misc-com ert-run-tests(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME #f(comp ert-run-tests-batch(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME) ert-run-tests-batch-and-exit(erc-scenarios-misc-commands--AMSG-GMSG- eval((ert-run-tests-batch-and-exit 'erc-scenarios-misc-commands--AMS command-line-1(("-L" ":." "-l" "ert" "-l" "lisp/erc/erc-scenarios-mi command-line() normal-top-level() Test erc-scenarios-misc-commands--AMSG-GMSG-AME-GME condition: Info: /AMSG only sent to issuing context's server Info: string: <alice> bob: Our queen and all (error "Failed awaiting: string: <alice> bob: Our queen and all") Source file `/home/incal/src/emacs/lisp/vc/vc-git.el' newer than byte-compiled file; using older file FAILED 1/1 erc-scenarios-misc-commands--AMSG-GMSG-AME-GME (10.450133 sec) at lisp/erc/erc-scenarios-misc-commands.el:133 Ran 1 tests, 0 results as expected, 1 unexpected (2024-01-23 14:35:47+0100, 10.618589 sec) 1 unexpected results: FAILED erc-scenarios-misc-commands--AMSG-GMSG-AME-GME -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-23 13:42 ` Emanuel Berg @ 2024-01-24 0:34 ` J.P. 2024-01-24 1:28 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: J.P. @ 2024-01-24 0:34 UTC (permalink / raw) To: 68401; +Cc: emacs-erc Emanuel Berg <incal@dataswamp.org> writes: > J.P. wrote: > >> The attached patch is a unit test for all four commands. >> It doesn't bother asserting M-x behavior (because see >> above). Please try to make it pass without changing the test >> itself (unless there's a bug). >> >> $ git am /tmp/0002-5.x-Add...etc.patch >> >> $ make -C test lisp/erc/erc-scenarios-misc-commands.log \ >> SELECTOR=erc-scenarios-misc-commands--AMSG-GMSG-AME-GME > > The test failed > > (error "Failed awaiting: string: <alice> bob: Our queen and all") > > Here is the entire erc-scenarios-misc-commands.log > > Source file `/home/incal/src/emacs/lisp/emacs-lisp/bytecomp.el' newer than byte-compiled file; using older file ^~~~~~ hint $ ./src/emacs -Q -batch -l erc -eval "(print (list :minep? (fboundp 'erc-cmd-GMSG)))" > Source file `/home/incal/src/emacs/lisp/erc/erc.el' newer than byte-compiled file; using older file > Source file `/home/incal/src/emacs/lisp/erc/erc-common.el' newer than byte-compiled file; using older file > Source file `/home/incal/src/emacs/lisp/auth-source.el' newer than byte-compiled file; using older file > Running 1 tests (2024-01-23 14:35:36+0100, selector `erc-scenarios-misc-commands--AMSG-GMSG-AME-GME') > Source file `/home/incal/src/emacs/lisp/erc/erc-button.el' newer than byte-compiled file; using older file > Source file `/home/incal/src/emacs/lisp/erc/erc-track.el' newer than byte-compiled file; using older file > Error running timer `erc-d--on-request': (error "Match failed: \"PRIVMSG #bar :1 foonet only\" (:exes (\"\\\\`PRIVMSG #bar :2 barnet only\") :dialog amsg-barnet)") > Test erc-scenarios-misc-commands--AMSG-GMSG-AME-GME backtrace: > Source file `/home/incal/src/emacs/lisp/help-fns.el' newer than byte-compiled file; using older file > error("Failed awaiting: %s" "string: <alice> bob: Our queen and all" > (if inverted (setq inverted nil) (error "Failed awaiting: %s" (forma > (progn (if inverted (setq inverted nil) (error "Failed awaiting: %s" > (if (eq -with-timeout-value- 'timeout) (progn (if inverted (setq inv > (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-ti > (let ((time-out (abs timeout)) (inverted (< timeout 0)) (result 'res > (let ((ert--infos (cons (cons "Info: " (concat erc-d-t--wait-message > (let* ((rxp (consp text)) (fun (if rxp #'search-forward-regexp #'sea > (save-restriction (widen) (let* ((rxp (consp text)) (fun (if rxp #'s > erc-d-t-search-for(10 "<alice> bob: Our queen and all" #<marker in n > (let* ((pos (cdr (assq (current-buffer) positions))) (erc-d-t--wait- > (closure ((positions (#<killed buffer> . #<marker in no buffer>) (#< > funcall((closure ((positions (#<killed buffer> . #<marker in no buff > (save-current-buffer (set-buffer "#foo") (funcall expect 10 "<tester > (let ((ert--infos (cons (cons "Info: " "/AMSG only sent to issuing c > (progn (erc-scenarios-common--add-silence) (let ((ert--infos (cons ( > (unwind-protect (progn (erc-scenarios-common--add-silence) (let ((er > (let* ((orig-autojoin-mode (and (boundp 'erc-autojoin-mode) erc-auto > (closure (t) nil (let* ((orig-autojoin-mode (and (boundp 'erc-autojo > #f(compiled-function () #<bytecode -0x199f34135bd6a333>)() > handler-bind-1(#f(compiled-function () #<bytecode -0x199f34135bd6a33 > ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test > ert-run-test(#s(ert-test :name erc-scenarios-misc-commands--AMSG-GMS > ert-run-or-rerun-test(#s(ert--stats :selector erc-scenarios-misc-com > ert-run-tests(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME #f(comp > ert-run-tests-batch(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME) > ert-run-tests-batch-and-exit(erc-scenarios-misc-commands--AMSG-GMSG- > eval((ert-run-tests-batch-and-exit 'erc-scenarios-misc-commands--AMS > command-line-1(("-L" ":." "-l" "ert" "-l" "lisp/erc/erc-scenarios-mi > command-line() > normal-top-level() > Test erc-scenarios-misc-commands--AMSG-GMSG-AME-GME condition: > Info: /AMSG only sent to issuing context's server > Info: string: <alice> bob: Our queen and all > (error "Failed awaiting: string: <alice> bob: Our queen and all") > Source file `/home/incal/src/emacs/lisp/vc/vc-git.el' newer than byte-compiled file; using older file > FAILED 1/1 erc-scenarios-misc-commands--AMSG-GMSG-AME-GME (10.450133 sec) at lisp/erc/erc-scenarios-misc-commands.el:133 > > Ran 1 tests, 0 results as expected, 1 unexpected (2024-01-23 14:35:47+0100, 10.618589 sec) > > 1 unexpected results: > FAILED erc-scenarios-misc-commands--AMSG-GMSG-AME-GME ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 0:34 ` J.P. @ 2024-01-24 1:28 ` Emanuel Berg 2024-01-24 1:38 ` Emanuel Berg 2024-01-24 11:15 ` Emanuel Berg 0 siblings, 2 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 1:28 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: >> Source file >> `/home/incal/src/emacs/lisp/emacs-lisp/bytecomp.el' newer >> than byte-compiled file; using older file Yes, why? But that was it anyway $ rm **/*.elc and then the test pass. Running 1 tests (2024-01-24 02:16:59+0100, selector `erc-scenarios-misc-commands--AMSG-GMSG-AME-GME') passed 1/1 erc-scenarios-misc-commands--AMSG-GMSG-AME-GME (1.949450 sec) Ran 1 tests, 1 results as expected, 0 unexpected (2024-01-24 02:17:01+0100, 1.950114 sec) So what will happen now, I'll remove the logical connectivity checker and all calls to it and then do the whole patch thing again for the fifth or sixth time? I've lost track. This, for one page of code that is pretty trivial in nature and took 10~15 minutes to write, tops. It worked before we did all this and it works now. The changes we have introduced have been minimal and could have been formulated in three or four simple sentences. Like I said in the beginning of the thread to Eli, modern society won't ever, ever allow for this kind of inefficiency. And by modern, I mean - 1975 and onwards? But fine, no need to be frustrated about it, I got to practice the git commands over and over. Now let's hope we can make it happen this time around then. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 1:28 ` Emanuel Berg @ 2024-01-24 1:38 ` Emanuel Berg 2024-01-24 11:15 ` Emanuel Berg 1 sibling, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 1:38 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 182 bytes --] tags: patch > But fine, no need to be frustrated about it, I got to > practice the git commands over and over. Now let's hope we > can make it happen this time around then. Done. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0003-Remove-the-logical-connectivity-test.patch --] [-- Type: text/x-diff, Size: 2338 bytes --] From 01ab5bd44db814e4520306b85a57ad0e01140674 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Wed, 24 Jan 2024 02:31:04 +0100 Subject: [PATCH 3/3] Remove the logical connectivity test Test already there in another form. * lisp/erc/erc.el (erc-cmd-AMSG, erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): removed from these functions. (bug#68401) --- lisp/erc/erc.el | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e89733e7871..e375145e825 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4004,17 +4004,12 @@ erc--split-string-shell-cmd ;; Input commands handlers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun erc--connected-and-joined-p () - (and (erc--current-buffer-joined-p) - erc-server-connected)) - (defun erc-cmd-GMSG (line) "Send LINE to all channels on all networks you are on." (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-send-message line)))) + (erc-send-message line))) (put 'erc-cmd-GMSG 'do-not-parse-args t) (defun erc-cmd-AMSG (line) @@ -4024,24 +4019,21 @@ erc-cmd-AMSG (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-send-message line)))) + (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." (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-cmd-ME line)))) + (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." (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) - (when (erc--connected-and-joined-p) - (erc-cmd-ME line)))) + (erc-cmd-ME line))) (put 'erc-cmd-AME 'do-not-parse-args t) (defun erc-cmd-SAY (line) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 1:28 ` Emanuel Berg 2024-01-24 1:38 ` Emanuel Berg @ 2024-01-24 11:15 ` Emanuel Berg 2024-01-24 11:55 ` Emanuel Berg 1 sibling, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 11:15 UTC (permalink / raw) To: 68401; +Cc: emacs-erc > This, for one page of code that is pretty trivial in nature > and took 10~15 minutes to write, tops. It worked before we > did all this and it works now. The changes we have > introduced have been minimal and could have been formulated > in three or four simple sentences. Well, trivial or not, the code looks _much_ better now so those small changes really worked. > But fine, no need to be frustrated about it, I got to > practice the git commands over and over. Now let's hope we > can make it happen this time around then. Here [last] are the git commands used so far. There is actually only one thing that is painful still and that is launching 'git commit -a' from a terminal and have a new Emacs instance pop up with no link to your regular session, and then you have to type the log message there with no killing and yanking and no buffers available from where you just were, with everything ready which you now cannot access just when you need it. So if one could do that without launching a new instance, that would be really helpful to the workflow and reduce frustration. $ git checkout -b ib master [...] $ git commit -a $ git format-patch master -M -o .ib M-x erc-bug RET Tags: patch (pseudo header) C-c C-a (`mml-attach-file') C-c C-c (`message-send-and-exit') $ git log $ git format-patch -2 HEAD --stdout > last-two.patch $ git commit --amend $ git reflog $ git revert fa37950454f $ git branch $ git branch -D ib -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 11:15 ` Emanuel Berg @ 2024-01-24 11:55 ` Emanuel Berg 2024-02-05 0:52 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-01-24 11:55 UTC (permalink / raw) To: 68401; +Cc: emacs-erc > Well, trivial or not, the code looks _much_ better now so > those small changes really worked. The unit test worked with the new code as well, sweet. Now everything should be done, right? As a side note, touching upon the unit test, to not have to remove the log file manually with a filepath, you can do $ make -C test mostlyclean instead. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-01-24 11:55 ` Emanuel Berg @ 2024-02-05 0:52 ` Emanuel Berg 2024-02-06 3:44 ` J.P. 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-02-05 0:52 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 185 bytes --] Tags: patch Okay, thanks to a lot of help at #erc and #git I think this is one full patch for a single commit reflecting the desired change to the source. Let me know if it is okay. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0211-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 15895 bytes --] From b006669b078a4cf4aec2ea19de1a954d494ec19f Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH 211/211] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands (Bug#68401) --- lisp/erc/erc.el | 38 +++++++-- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 4 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 08dfa4b8f1b..15734b1010d 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4047,16 +4047,42 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + #'erc--connected-and-joined-p + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p (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." + (erc-with-all-buffers-of-server nil + (erc--connected-and-joined-p) + (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." + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p + (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. diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-05 0:52 ` Emanuel Berg @ 2024-02-06 3:44 ` J.P. 2024-02-11 1:58 ` Emanuel Berg 2024-02-11 2:27 ` Emanuel Berg 0 siblings, 2 replies; 45+ messages in thread From: J.P. @ 2024-02-06 3:44 UTC (permalink / raw) To: Emanuel Berg; +Cc: emacs-erc, 68401 Emanuel Berg <incal@dataswamp.org> writes: > Tags: patch > > Okay, thanks to a lot of help at #erc and #git I think this is > one full patch for a single commit reflecting the desired > change to the source. > > Let me know if it is okay. > >> From b006669b078a4cf4aec2ea19de1a954d494ec19f Mon Sep 17 00:00:00 2001 > From: Emanuel Berg <incal@dataswamp.org> > Date: Tue, 23 Jan 2024 14:21:49 +0100 > Subject: [PATCH 211/211] Make erc-cmd-AMSG session local; add /GMSG, /AME and > /GME > > * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc > string by only affecting the current connection. > (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands > (Bug#68401) Looks like you've combined ("fixed up") your patch with the provided test and data files [1]. That's fine, but its changes should be listed in the commit message as well: * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. In the future, maybe look into "squashing" to preserve messages. Also, consider adding an entry to etc/ERC-NEWS if you think people can benefit from these commands. [1] https://lists.gnu.org/archive/html/emacs-erc/2024-01/msg00038.html > --- > lisp/erc/erc.el | 38 +++++++-- > test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ > .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ > .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ > 4 files changed, 220 insertions(+), 6 deletions(-) > create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld > create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld > > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 08dfa4b8f1b..15734b1010d 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -4047,16 +4047,42 @@ 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: ") > - (setq line (erc-trim-string line)) > +(defun erc--connected-and-joined-p () > + (and (erc--current-buffer-joined-p) > + erc-server-connected)) > + > +(defun erc-cmd-GMSG (line) > + "Send LINE to all channels on all networks you are on." > + (setq line (string-remove-prefix " " line)) > (erc-with-all-buffers-of-server nil > - (lambda () > - (erc-channel-p (erc-default-target))) > + #'erc--connected-and-joined-p > + (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. > +Interactively, prompt for the line of text to send." > + (interactive "sSend to all channels on this network: ") > + (setq line (string-remove-prefix " " line)) > + (erc-with-all-buffers-of-server erc-server-process > + #'erc--connected-and-joined-p > (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." > + (erc-with-all-buffers-of-server nil > + (erc--connected-and-joined-p) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Seems one of these things is not like the others. Guessing that's unintentional. What's not great is that the test still passes in spite of this. It seems /GME is the only variant not covered, which I guess is my fault. Perhaps you should improve the test so it fails with the current patch applied and passes once it's fixed. > + (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." > + (erc-with-all-buffers-of-server erc-server-process > + #'erc--connected-and-joined-p > + (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. > > diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el > index d6ed53b5358..c6bb610b9df 100644 > --- a/test/lisp/erc/erc-scenarios-misc-commands.el > +++ b/test/lisp/erc/erc-scenarios-misc-commands.el > @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST > (should (string= (erc-server-user-host (erc-get-server-user "tester")) > "some.host.test.cc")))))) > > +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, > +;; the latter three introduced by bug#68401. It mainly asserts > +;; correct routing behavior, especially not sending or inserting > +;; messages in buffers belonging to disconnected sessions. Left > +;; unaddressed are interactions with the `command-indicator' module > +;; (`erc-noncommands-list') and whatever future `echo-message' > +;; implementation manifests out of bug#49860. > +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () > + (erc-scenarios-common-with-cleanup > + ((erc-scenarios-common-dialog "commands") > + (erc-server-flood-penalty 0.1) > + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) > + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) > + (expect (erc-d-t-make-expecter))) [...] Is this FIXME comment [2] regarding your paperwork accurate? [2] https://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/elpa-packages?id=e5075ab1#n805 ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-06 3:44 ` J.P. @ 2024-02-11 1:58 ` Emanuel Berg 2024-02-11 2:27 ` Emanuel Berg 1 sibling, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-02-11 1:58 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: >> * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc >> string by only affecting the current connection. >> (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands >> (Bug#68401) > > Looks like you've combined ("fixed up") your patch with the > provided test and data files. That's fine, but its changes > should be listed in the commit message as well: > > * test/lisp/erc/erc-scenarios-misc-commands.el > (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. > * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. > * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. Should those lines be added to the commit message? I was unaware of those messages, if they have appeared previously. Okay, I do that with 'git commit --amend', right? > In the future, maybe look into "squashing" to > preserve messages. I think that was what I did, using the following commands. I wrote them down after I did it, so maybe someone is missing. ib is my local branch. $ git log --graph --oneline --decorate -a $ git rebase -i HEAD~5 $ git commit --amend $ git rebase --onto origin/master 'ib^' ib $ git pull $ git format-patch master -M -o .ib I was told there was an easier way, using diff, since all that was called for was a commit that expressed the difference from the initial checkout to the current state of the source - ignoring the detour back and forth and their corresponding commits. So maybe there is an easier way than all those commands? > Also, consider adding an entry to etc/ERC-NEWS if you think > people can benefit from these commands. OK. >> + (erc--connected-and-joined-p) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Seems one of these things is not like the others. > Guessing that's unintentional. Ah, you are right, good that you saw it. If I change that in the source to the correct #'erc--connected-and-joined-p and commit that, we are back at the previous situation. Only now we have 2 commits instead of 5. Should I change the code, commit the change, and do the whole rebase stuff again to get a single patch? Or is there an easier way? > What's not great is that the test still passes in spite of > this. It seems /GME is the only variant not covered, which > I guess is my fault. Perhaps you should improve the test so > it fails with the current patch applied and passes once > it's fixed. I'm not familiar with those tests so it is better you do that part, I think. > Is this FIXME comment regarding your paperwork accurate? That had to do with my package on GNU ELPA [1] but that package has appeared so I suppose the paperwork issue has been solved. [1] https://dataswamp.org/~incal/emacs-init/wrap-search.el -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-06 3:44 ` J.P. 2024-02-11 1:58 ` Emanuel Berg @ 2024-02-11 2:27 ` Emanuel Berg 2024-02-11 3:30 ` Emanuel Berg 1 sibling, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-02-11 2:27 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 1564 bytes --] Tags: patch J.P. wrote: > Looks like you've combined ("fixed up") your patch with the > provided test and data files. That's fine, but its changes > should be listed in the commit message as well: > > * test/lisp/erc/erc-scenarios-misc-commands.el > (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. > * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. > * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. > > In the future, maybe look into "squashing" to preserve > messages. Also, consider adding an entry to etc/ERC-NEWS if > you think people can benefit from these commands. You are right, I did the rebase with squash instead of fixup and got the previous messages. The missing four lines above I inserted manually. I am unsure what order you should to the pull and the rebase commands? Maybe I did them the other way around last time. If you pull, it says there is no tracking data. When you rebase onto it says it is fine. But pulling again after that doesn't do anything. So maybe the initial pull actually did the pull, just saying tracking must be set as well? $ git log --graph --oneline --decorate -a $ git rebase -i HEAD~2 $ git commit --amend $ git pull $ git rebase --onto origin/master 'ib^' ib $ git format-patch master -M -o .ib Anyway here is the patch. If it is OK, I'll do it again to do the change to etc/ERC-NEWS since I forgot about that this time around (but I'm happy to do it again, since now I think the commands start to make a little more sense to me at least on a superficial level :P) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 16296 bytes --] From c2c2670d66ff691c05fbe0aed380005aa1506345 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH 301/301] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands (Bug#68401) Fixed bug in erc-cmd-GME * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, not (erc--connected-and-joined-p) (Bug#68401) Test and files added * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. --- lisp/erc/erc.el | 38 +++++++-- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 4 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 08dfa4b8f1b..3bd13f4a1a0 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4047,16 +4047,42 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + #'erc--connected-and-joined-p + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p (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." + (erc-with-all-buffers-of-server nil + #'erc--connected-and-joined-p + (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." + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p + (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. diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-11 2:27 ` Emanuel Berg @ 2024-02-11 3:30 ` Emanuel Berg 2024-02-11 3:52 ` Emanuel Berg 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-02-11 3:30 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 714 bytes --] Tags: patch > $ [edit etc/ERC-NEWS] > $ git commit -a > $ git log --graph --oneline --decorate -a > $ git rebase -i HEAD~2 > $ git pull > $ git rebase --onto origin/master 'ib^' ib > $ git format-patch master -M -o .ib > > Anyway here is the patch. If it is OK, I'll do it again to > do the change to etc/ERC-NEWS since I forgot about that Using the above commands, I produced a new patch but something didn't happen the same way as it did the other time around just now, because the patch got the same number 0301 and filename - weird - like the previous one. Maybe some mistake that I did? Anyway here is the patch, note that this is different from the one I just posted, it includes a note in etc/ERC-NEWS. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 16296 bytes --] From c2c2670d66ff691c05fbe0aed380005aa1506345 Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH 301/301] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands (Bug#68401) Fixed bug in erc-cmd-GME * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, not (erc--connected-and-joined-p) (Bug#68401) Test and files added * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. --- lisp/erc/erc.el | 38 +++++++-- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 4 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 08dfa4b8f1b..3bd13f4a1a0 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4047,16 +4047,42 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + #'erc--connected-and-joined-p + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p (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." + (erc-with-all-buffers-of-server nil + #'erc--connected-and-joined-p + (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." + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p + (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. diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-11 3:30 ` Emanuel Berg @ 2024-02-11 3:52 ` Emanuel Berg 2024-02-14 1:42 ` J.P. 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-02-11 3:52 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 277 bytes --] Tags: patch > Anyway here is the patch, note that this is different from > the one I just posted, it includes a note in etc/ERC-NEWS Okay, so it doesn't? Okay, but I have now verified that the patch includes that change, even tho it still has the same number and filename. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 17741 bytes --] From 737777da67f78a50d50b416b3ebba0e343c907aa Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH 301/301] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands (Bug#68401) Fixed bug in erc-cmd-GME * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, not (erc--connected-and-joined-p) (Bug#68401) Test and files added * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. Added a note on `erc-cmd-AMGS' and its three new friends * etc/ERC-NEWS: Mentioned here. --- etc/ERC-NEWS | 10 ++- lisp/erc/erc.el | 38 +++++++-- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 5 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 1e88500d169..a4ea1573d64 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -14,6 +14,12 @@ GNU Emacs since Emacs version 22.1. \f * Changes in ERC 5.6 +** Made `erc-cmd-AMSG' session local so it only affects the +current connection, this is now consistent with its docstring. +Also, the new IRC slash commands `erc-cmd-GMSG', +`erc-cmd-AME', and `erc-cmd-GME' were added and are available +as /GMSG, /AME, and /GME. + ** Module 'keep-place' has a more decorative cousin. Remember your place in ERC buffers a bit more easily with the help of a configurable, visible indicator. Optionally sync the indicator to @@ -1367,7 +1373,7 @@ reconnection attempts that ERC will make per server. in seconds, that ERC will wait between successive reconnect attempts. *** erc-server-send-ping-timeout: Determines when to consider a connection -stalled and restart it. The default is after 120 seconds. +stalled and restart it. The default is after 120 seconds. *** erc-system-name: Determines the system name to use when logging in. The default is to figure this out by calling `system-name'. @@ -2386,5 +2392,5 @@ Local variables: coding: utf-8 mode: outline mode: emacs-news -paragraph-separate: "[ \f]*$" +paragraph-separate: "[ \f]*$" end: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 08dfa4b8f1b..3bd13f4a1a0 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4047,16 +4047,42 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + #'erc--connected-and-joined-p + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p (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." + (erc-with-all-buffers-of-server nil + #'erc--connected-and-joined-p + (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." + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p + (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. diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-11 3:52 ` Emanuel Berg @ 2024-02-14 1:42 ` J.P. 2024-02-17 5:21 ` Emanuel Berg 2024-02-17 8:52 ` Emanuel Berg 0 siblings, 2 replies; 45+ messages in thread From: J.P. @ 2024-02-14 1:42 UTC (permalink / raw) To: 68401; +Cc: Emanuel Berg, emacs-erc [-- Attachment #1: Type: text/plain, Size: 9268 bytes --] Emanuel Berg <incal@dataswamp.org> writes: > Tags: patch > >> Anyway here is the patch, note that this is different from >> the one I just posted, it includes a note in etc/ERC-NEWS > > Okay, so it doesn't? > > Okay, but I have now verified that the patch includes that > change, even tho it still has the same number and filename. > >> From 737777da67f78a50d50b416b3ebba0e343c907aa Mon Sep 17 00:00:00 2001 > From: Emanuel Berg <incal@dataswamp.org> > Date: Tue, 23 Jan 2024 14:21:49 +0100 > Subject: [PATCH 301/301] Make erc-cmd-AMSG session local; add /GMSG, /AME and > /GME > > * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc > string by only affecting the current connection. > (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands ^ ^ From CONTRIBUTE: Some commenting rules in the GNU coding standards also apply to ChangeLog entries: they must be in English, and be complete sentences starting with a capital and ending with a period (except the summary line should not end in a period). > > Fixed bug in erc-cmd-GME > > * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, > not (erc--connected-and-joined-p) > (Bug#68401) This last item appears to describe an incremental patch revision only known to this discussion thread on the tracker. These log messages are instead meant to reflect the entirety of the proposed changeset relative to what's currently on master. However, something like this might still be helpful in the body of a discussion post (email). > > Test and files added > > * test/lisp/erc/erc-scenarios-misc-commands.el > (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. > * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. > * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. > > Added a note on `erc-cmd-AMGS' and its three new friends > > * etc/ERC-NEWS: Mentioned here. FWIW, other Emacs commit messages don't seem to have these interspersed sub-headers, like "Fixed bug in erc-cmd-GME" and "Test and files added". And based on Each entry in a change log describes either an individual change or the smallest batch of changes that belong together, also known as a changeset. It is a good idea to start the change log entry with a header line: a single line that ... [1] and Separate unrelated change log entries with blank lines. Don’t put blank lines between individual changes of an entry. [1] it's my impression that's only done for "unrelated" entries in the same patch. As it would seem your changes all affect the same (logical) area of the code base and provide similar functionality as part of the same feature set, I'd sooner remove them. Still, I do often see somewhat arbitrary blanks breaking up groups of items belonging to the same entry, just without their own header lines. So who really knows? [1] https://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html [2] https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html > --- > etc/ERC-NEWS | 10 ++- > lisp/erc/erc.el | 38 +++++++-- > test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ > .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ > .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ > 5 files changed, 228 insertions(+), 8 deletions(-) > create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld > create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld > > diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS > index 1e88500d169..a4ea1573d64 100644 > --- a/etc/ERC-NEWS > +++ b/etc/ERC-NEWS > @@ -14,6 +14,12 @@ GNU Emacs since Emacs version 22.1. > \f > * Changes in ERC 5.6 > > +** Made `erc-cmd-AMSG' session local so it only affects the > +current connection, this is now consistent with its docstring. From CONTRIBUTE: Try to start each NEWS entry with a sentence that summarizes the entry and takes just one line -- this will allow reading NEWS in Outline mode after hiding the body of each entry. Also, bug fixes aren't really announced unless they threaten to cause widespread churn or introduce potentially debilitating breakage, so you can probably just leave that out and only mention the new commands. > +Also, the new IRC slash commands `erc-cmd-GMSG', > +`erc-cmd-AME', and `erc-cmd-GME' were added and are available ^~~~~~~~~~~~^ For etc/*NEWS, I believe they prefer single 'quotes' for literal text rather than traditional ones with an opening backtick. > + > ** Module 'keep-place' has a more decorative cousin. > Remember your place in ERC buffers a bit more easily with the help of > a configurable, visible indicator. Optionally sync the indicator to > @@ -1367,7 +1373,7 @@ reconnection attempts that ERC will make per server. > in seconds, that ERC will wait between successive reconnect attempts. > > *** erc-server-send-ping-timeout: Determines when to consider a connection > -stalled and restart it. The default is after 120 seconds. > +stalled and restart it. The default is after 120 seconds. ~~~ Please collapse the expanded TAB into a single space. > > *** erc-system-name: Determines the system name to use when logging in. > The default is to figure this out by calling `system-name'. > @@ -2386,5 +2392,5 @@ Local variables: > coding: utf-8 > mode: outline > mode: emacs-news > -paragraph-separate: "[ \f]*$" > +paragraph-separate: "[ \f]*$" ^ I believe the TAB here is intentional, so please undo this hunk. > end: > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 08dfa4b8f1b..3bd13f4a1a0 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -4047,16 +4047,42 @@ 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: ") > - (setq line (erc-trim-string line)) > +(defun erc--connected-and-joined-p () > + (and (erc--current-buffer-joined-p) > + erc-server-connected)) > + > +(defun erc-cmd-GMSG (line) > + "Send LINE to all channels on all networks you are on." > + (setq line (string-remove-prefix " " line)) > (erc-with-all-buffers-of-server nil > - (lambda () > - (erc-channel-p (erc-default-target))) > + #'erc--connected-and-joined-p > + (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. > +Interactively, prompt for the line of text to send." > + (interactive "sSend to all channels on this network: ") > + (setq line (string-remove-prefix " " line)) > + (erc-with-all-buffers-of-server erc-server-process > + #'erc--connected-and-joined-p > (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." > + (erc-with-all-buffers-of-server nil > + #'erc--connected-and-joined-p > + (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." > + (erc-with-all-buffers-of-server erc-server-process > + #'erc--connected-and-joined-p > + (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. > > diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el > index d6ed53b5358..c6bb610b9df 100644 > --- a/test/lisp/erc/erc-scenarios-misc-commands.el > +++ b/test/lisp/erc/erc-scenarios-misc-commands.el > @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST > (should (string= (erc-server-user-host (erc-get-server-user "tester")) > "some.host.test.cc")))))) > [...] Emanuel Berg <incal@dataswamp.org> writes: > J.P. wrote: > >> What's not great is that the test still passes in spite of >> this. It seems /GME is the only variant not covered, which >> I guess is my fault. Perhaps you should improve the test so >> it fails with the current patch applied and passes once >> it's fixed. > > I'm not familiar with those tests so it is better you do > that part, I think. For reference, I have attached the revised test covering /GME. Don't bother reincorporating it if you don't know how; I can do so when installing. > >> Is this FIXME comment regarding your paperwork accurate? > > That had to do with my package on GNU ELPA [1] but that > package has appeared so I suppose the paperwork issue has > been solved. I have confirmed this with the copyright clerk. Thanks. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-5.x-Add-tests-for-ERC-slash-commands-AMSG-GMSG-etc.patch --] [-- Type: text/x-patch, Size: 14416 bytes --] From e021f3c5e9990776af99bd6938b300bcef101719 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@neverwas.me> Date: Mon, 15 Jan 2024 22:40:44 -0800 Subject: [PATCH] [5.x] Add tests for ERC slash commands /AMSG, /GMSG, etc. * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. (Bug#68401) --- test/lisp/erc/erc-scenarios-misc-commands.el | 90 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 54 +++++++++++ .../erc/resources/commands/amsg-foonet.eld | 56 ++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..da6855caf57 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,94 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG and /GME sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets") + (erc-scenarios-common-say "/gme 6 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "* tester 6 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG and /GME only sent to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "* tester 6 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 7 all live nets") + (erc-scenarios-common-say "/gme 8 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 7 all live nets") + (funcall expect -0.1 "* tester 8 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 7 all live nets") + (funcall expect 10 "* tester 8 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..53b3e18651a --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,54 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets")) + +((privmsg-6 10 "PRIVMSG #bar :\1ACTION 6 all nets\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..eb3d84d646a --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,56 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets")) + +((privmsg-6 10 "PRIVMSG #foo :\1ACTION 6 all nets\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :7 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.")) + +((privmsg-6 10 "PRIVMSG #foo :\1ACTION 8 all live nets\1") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.43.0 ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-14 1:42 ` J.P. @ 2024-02-17 5:21 ` Emanuel Berg 2024-02-17 8:52 ` Emanuel Berg 1 sibling, 0 replies; 45+ messages in thread From: Emanuel Berg @ 2024-02-17 5:21 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: >> (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands > ^ ^ > From CONTRIBUTE: > > Some commenting rules in the GNU coding standards also > apply to ChangeLog entries: they must be in English, and > be complete sentences starting with a capital and ending > with a period (except the summary line should not end in > a period). What do you mean, should that be "New IRC slash commands."? If so, maybe I can change it with 'git commit --amend'. But how do I then generate a new patch, just with 'git format-patch master -M -o .ib'? >> Fixed bug in erc-cmd-GME >> >> * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, >> not (erc--connected-and-joined-p) >> (Bug#68401) > > This last item appears to describe an incremental patch > revision only known to this discussion thread on the > tracker. These log messages are instead meant to reflect the > entirety of the proposed changeset relative to what's > currently on master. However, something like this might > still be helpful in the body of a discussion post (email). What should the commit message be then for such changes? Nothing at all? Then It will complain it doesn't work. I can write a bogus message, then squash the commits and remove it from the final one, I guess. >> Test and files added >> >> * test/lisp/erc/erc-scenarios-misc-commands.el >> (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. >> * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. >> * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. >> >> Added a note on `erc-cmd-AMGS' and its three new friends >> >> * etc/ERC-NEWS: Mentioned here. > > FWIW, other Emacs commit messages don't seem to have these > interspersed sub-headers, like "Fixed bug in erc-cmd-GME" > and "Test and files added". They are from the squashed commits. You told me to use it instead of fixup since that would keep the commit messages. I can remove them like above, maybe, if that's what you are saying? If so, please provide a commit message exactly the way it should be since this has been back and forth so many times by now. > Also, bug fixes aren't really announced unless they threaten > to cause widespread churn or introduce potentially > debilitating breakage, so you can probably just leave that > out and only mention the new commands. Okay. >> +Also, the new IRC slash commands `erc-cmd-GMSG', >> +`erc-cmd-AME', and `erc-cmd-GME' were added and are available > ^~~~~~~~~~~~^ > > For etc/*NEWS, I believe they prefer single 'quotes' for > literal text rather than traditional ones with an > opening backtick. Again, maybe it is easier it you just supply the whole message exactly as intended as this back and forth one million times is not getting us anywhere. >> + >> ** Module 'keep-place' has a more decorative cousin. >> Remember your place in ERC buffers a bit more easily with the help of >> a configurable, visible indicator. Optionally sync the indicator to >> @@ -1367,7 +1373,7 @@ reconnection attempts that ERC will make per server. >> in seconds, that ERC will wait between successive reconnect attempts. >> >> *** erc-server-send-ping-timeout: Determines when to consider a connection >> -stalled and restart it. The default is after 120 seconds. >> +stalled and restart it. The default is after 120 seconds. > ~~~ > > Please collapse the expanded TAB into a single space. >> >> *** erc-system-name: Determines the system name to use when logging in. >> The default is to figure this out by calling `system-name'. >> @@ -2386,5 +2392,5 @@ Local variables: >> coding: utf-8 >> mode: outline >> mode: emacs-news >> -paragraph-separate: "[ \f]*$" >> +paragraph-separate: "[ \f]*$" > ^ > I believe the TAB here is intentional, so please undo this hunk. Oh, no! It is the same thing that happened with the Elisp file, tabs were changed into spaces when I saved. I only disabled that for Elisp so it did happen again for etc/ERC-NEWS as that isn't Elips. But if it were just two cases, maybe I can change it them back manually. After commiting that, should I do the whole chain again? Is that the preferred way, really? One would feel there would be an easier way, but if it so, that's what it is. $ git log --graph --oneline --decorate -a $ git rebase -i HEAD~2 $ git pull $ git rebase --onto origin/master 'ib^' ib $ git format-patch master -M -o .ib ? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-14 1:42 ` J.P. 2024-02-17 5:21 ` Emanuel Berg @ 2024-02-17 8:52 ` Emanuel Berg 2024-02-21 1:11 ` J.P. [not found] ` <87ttm2boza.fsf@neverwas.me> 1 sibling, 2 replies; 45+ messages in thread From: Emanuel Berg @ 2024-02-17 8:52 UTC (permalink / raw) To: 68401; +Cc: emacs-erc [-- Attachment #1: Type: text/plain, Size: 1420 bytes --] Tags: patch J.P. wrote: >> (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): new IRC slash commands > ^ ^ > [...] >> * lisp/erc/erc.el (erc-cmd-GME): should be #'erc--connected-and-joined-p, >> not (erc--connected-and-joined-p) >> (Bug#68401) > > This last item appears to describe an incremental patch revision only > known to this discussion thread on the tracker [...] > > FWIW, other Emacs commit messages don't seem to have these > interspersed sub-headers [...] > > Try to start each NEWS entry with a sentence [...] > >> +Also, the new IRC slash commands `erc-cmd-GMSG', >> +`erc-cmd-AME', and `erc-cmd-GME' were added and are available > ^~~~~~~~~~~~^ > > For etc/*NEWS, I believe they prefer single 'quotes' [...] > >> -stalled and restart it. The default is after 120 seconds. >> +stalled and restart it. The default is after 120 seconds. > ~~~ > > Please collapse the expanded TAB into a single space [...] >> -paragraph-separate: "[ \f]*$" >> +paragraph-separate: "[ \f]*$" > ^ > I believe the TAB here is intentional, so please undo > this hunk. I sent a reply to this but it hasn't appeared yet, it seems. Anyway, I finally understood all of what you asked for, I think, so you can disregard that post and instead have a look at the below patch, hopefully it covers it. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0368-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch --] [-- Type: text/x-diff, Size: 17739 bytes --] From 608cfa6c663b419735cc8dd2e17a31ad389dc6be Mon Sep 17 00:00:00 2001 From: Emanuel Berg <incal@dataswamp.org> Date: Tue, 23 Jan 2024 14:21:49 +0100 Subject: [PATCH 368/368] Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME * lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc string by only affecting the current connection. (erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): New IRC slash commands. * test/lisp/erc/erc-scenarios-misc-commands.el (erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test. * test/lisp/erc/resources/commands/amsg-barnet.eld: New file. * test/lisp/erc/resources/commands/amsg-foonet.eld: New file. * etc/ERC-NEWS: Mentioned here. (Bug#68401) --- etc/ERC-NEWS | 8 +- lisp/erc/erc.el | 38 +++++++-- test/lisp/erc/erc-scenarios-misc-commands.el | 84 +++++++++++++++++++ .../erc/resources/commands/amsg-barnet.eld | 52 ++++++++++++ .../erc/resources/commands/amsg-foonet.eld | 52 ++++++++++++ 5 files changed, 226 insertions(+), 8 deletions(-) create mode 100644 test/lisp/erc/resources/commands/amsg-barnet.eld create mode 100644 test/lisp/erc/resources/commands/amsg-foonet.eld diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index b2aceaa9f39..23e706c4fea 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -14,6 +14,10 @@ GNU Emacs since Emacs version 22.1. \f * Changes in ERC 5.6 +** New IRC slash commands. +The IRC slash commands 'erc-cmd-AME', 'erc-cmd-GME', and +'erc-cmd-GMSG' were added and are available as /AME, /GME, and /GMSG. + ** Module 'keep-place' has a more decorative cousin. Remember your place in ERC buffers a bit more easily with the help of a configurable, visible indicator. Optionally sync the indicator to @@ -1377,7 +1381,7 @@ reconnection attempts that ERC will make per server. in seconds, that ERC will wait between successive reconnect attempts. *** erc-server-send-ping-timeout: Determines when to consider a connection -stalled and restart it. The default is after 120 seconds. +stalled and restart it. The default is after 120 seconds. *** erc-system-name: Determines the system name to use when logging in. The default is to figure this out by calling `system-name'. @@ -2338,7 +2342,7 @@ in XEmacs. Please use M-x customize-variable RET erc-modules RET to change the default if it does not suite your needs. -** THe symbol used in `erc-nickserv-passwords' for debian.org IRC servers +** The symbol used in `erc-nickserv-passwords' for debian.org IRC servers (formerly called OpenProjects, now FreeNode) has changed from openprojects to freenode. You may need to update your configuration for a successful automatic nickserv identification. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index f250584e47a..4911e4994ca 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4045,16 +4045,42 @@ 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: ") - (setq line (erc-trim-string line)) +(defun erc--connected-and-joined-p () + (and (erc--current-buffer-joined-p) + erc-server-connected)) + +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (setq line (string-remove-prefix " " line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + #'erc--connected-and-joined-p + (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. +Interactively, prompt for the line of text to send." + (interactive "sSend to all channels on this network: ") + (setq line (string-remove-prefix " " line)) + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p (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." + (erc-with-all-buffers-of-server nil + #'erc--connected-and-joined-p + (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." + (erc-with-all-buffers-of-server erc-server-process + #'erc--connected-and-joined-p + (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. diff --git a/test/lisp/erc/erc-scenarios-misc-commands.el b/test/lisp/erc/erc-scenarios-misc-commands.el index d6ed53b5358..c6bb610b9df 100644 --- a/test/lisp/erc/erc-scenarios-misc-commands.el +++ b/test/lisp/erc/erc-scenarios-misc-commands.el @@ -123,4 +123,88 @@ erc-scenarios-misc-commands--VHOST (should (string= (erc-server-user-host (erc-get-server-user "tester")) "some.host.test.cc")))))) +;; This tests four related slash commands, /AMSG, /GMSG, /AME, /GME, +;; the latter three introduced by bug#68401. It mainly asserts +;; correct routing behavior, especially not sending or inserting +;; messages in buffers belonging to disconnected sessions. Left +;; unaddressed are interactions with the `command-indicator' module +;; (`erc-noncommands-list') and whatever future `echo-message' +;; implementation manifests out of bug#49860. +(ert-deftest erc-scenarios-misc-commands--AMSG-GMSG-AME-GME () + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "commands") + (erc-server-flood-penalty 0.1) + (dumb-server-foonet (erc-d-run "localhost" t "srv-foonet" 'amsg-foonet)) + (dumb-server-barnet (erc-d-run "localhost" t "srv-barnet" 'amsg-barnet)) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet and join #foo") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-foonet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#foo"))) + + (ert-info ("Connect to barnet and join #bar") + (with-current-buffer + (erc :server "127.0.0.1" + :port (process-contact dumb-server-barnet :service) + :nick "tester") + (funcall expect 10 "debug mode") + (erc-cmd-JOIN "#bar"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#foo")) + (funcall expect 10 "welcome")) + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#bar")) + (funcall expect 10 "welcome")) + + (ert-info ("/AMSG only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/amsg 1 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/amsg 2 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 1 foonet only") + (funcall expect 10 "<alice> bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 2 barnet only") + (funcall expect 10 "<joe> mike: And secretly to greet"))) + + (ert-info ("/AME only sent to issuing context's server") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/ame 3 foonet only")) + (with-current-buffer "barnet" + (erc-scenarios-common-say "/ame 4 barnet only")) + (with-current-buffer "#foo" + (funcall expect 10 "* tester 3 foonet only") + (funcall expect 10 "<alice> bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 "<joe> mike: That same Berowne"))) + + (ert-info ("/GMSG sent to all servers") + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 5 all nets")) + (with-current-buffer "#bar" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<joe> mike: Mehercle! if their sons"))) + + (ert-info ("/GMSG sent only to connected servers") + (with-current-buffer "barnet" + (erc-cmd-QUIT "") + (funcall expect 10 "ERC finished")) + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 5 all nets") + (funcall expect 10 "<alice> bob: Stand you!")) + (with-current-buffer "foonet" + (erc-scenarios-common-say "/gmsg 6 all live nets")) + ;; Message *not* inserted in disconnected buffer. + (with-current-buffer "#bar" + (funcall expect -0.1 "<tester> 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 "<tester> 6 all live nets") + (funcall expect 10 "<bob> alice: Live, and be prosperous;")))) + ;;; erc-scenarios-misc-commands.el ends here diff --git a/test/lisp/erc/resources/commands/amsg-barnet.eld b/test/lisp/erc/resources/commands/amsg-barnet.eld new file mode 100644 index 00000000000..a1d58b3d402 --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-barnet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Tue, 04 May 2021 05:06:19 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 253 tester 0 :unregistered connections") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.barnet.org 221 tester +i") + (0 ":irc.barnet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #bar") + (0 ":tester!~u@jnu48g2wrycbw.irc JOIN #bar") + (0 ":irc.barnet.org 353 tester = #bar :@mike joe tester") + (0 ":irc.barnet.org 366 tester #bar :End of NAMES list")) + +((mode-bar 10 "MODE #bar") + (0 ":irc.barnet.org 324 tester #bar +nt") + (0 ":irc.barnet.org 329 tester #bar 1620104779") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :tester, welcome!") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Whipp'd first, sir, and hang'd after.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: We have yet many among us can gripe as hard as Cassibelan; I do not say I am one, but I have a hand. Why tribute ? why should we pay tribute ? If C sar can hide the sun from us with a blanket, or put the moon in his pocket, we will pay him tribute for light; else, sir, no more tribute, pray you now.")) + +((privmsg-2 10 "PRIVMSG #bar :2 barnet only") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: Double and treble admonition, and still forfeit in the same kind ? This would make mercy swear, and play the tyrant.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: And secretly to greet the empress' friends.")) + +((privmsg-4 10 "PRIVMSG #bar :\1ACTION 4 barnet only\1") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: You have not been inquired after: I have sat here all day.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: That same Berowne I'll torture ere I go.")) + +((privmsg-5 10 "PRIVMSG #bar :5 all nets") + (0.1 ":mike!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :joe: For mine own part,no offence to the general, nor any man of quality,I hope to be saved.") + (0.1 ":joe!~u@kd7gmjbnbkn8c.irc PRIVMSG #bar :mike: Mehercle! if their sons be ingenuous, they shall want no instruction; if their daughters be capable, I will put it to them. But, vir sapit qui pauca loquitur. A soul feminine saluteth us.")) + +((quit 5 "QUIT :\2ERC\2") + (0 ":tester!~u@jnu48g2wrycbw.irc QUIT :Quit")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/commands/amsg-foonet.eld b/test/lisp/erc/resources/commands/amsg-foonet.eld new file mode 100644 index 00000000000..d5cf15ddf7c --- /dev/null +++ b/test/lisp/erc/resources/commands/amsg-foonet.eld @@ -0,0 +1,52 @@ +;; -*- mode: lisp-data; -*- +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :unknown") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) + +((join 10 "JOIN #foo") + (0 ":tester!~u@9g6b728983yd2.irc JOIN #foo") + (0 ":irc.foonet.org 353 tester = #foo :alice tester @bob") + (0 ":irc.foonet.org 366 tester #foo :End of NAMES list")) + +((mode-foo 10 "MODE #foo") + (0 ":irc.foonet.org 324 tester #foo +nt") + (0 ":irc.foonet.org 329 tester #foo 1620104779") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :tester, welcome!") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: But, as it seems, did violence on herself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Well, this is the forest of Arden.")) + +((privmsg-1 10 "PRIVMSG #foo :1 foonet only") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Signior Iachimo will not from it. Pray, let us follow 'em.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Our queen and all her elves come here anon.")) + +((privmsg-3 10 "PRIVMSG #foo :\1ACTION 3 foonet only\1") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: The ground is bloody; search about the churchyard.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: You have discharged this honestly: keep it to yourself. Many likelihoods informed me of this before, which hung so tottering in the balance that I could neither believe nor misdoubt. Pray you, leave me: stall this in your bosom; and I thank you for your honest care. I will speak with you further anon.")) + +((privmsg-5 10 "PRIVMSG #foo :5 all nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Give me that mattock, and the wrenching iron.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: Stand you! You have land enough of your own; but he added to your having, gave you some ground.")) + +((privmsg-6 10 "PRIVMSG #foo :6 all live nets") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Excellent workman! Thou canst not paint a man so bad as is thyself.") + (0.1 ":alice!~u@rz2v467q4rwhy.irc PRIVMSG #foo :bob: And will you, being a man of your breeding, be married under a bush, like a beggar ? Get you to church, and have a good priest that can tell you what marriage is: this fellow will but join you together as they join wainscot; then one of you will prove a shrunk panel, and like green timber, warp, warp.") + (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #foo :alice: Live, and be prosperous; and farewell, good fellow.")) -- 2.39.2 [-- Attachment #3: Type: text/plain, Size: 61 bytes --] -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply related [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-17 8:52 ` Emanuel Berg @ 2024-02-21 1:11 ` J.P. [not found] ` <87ttm2boza.fsf@neverwas.me> 1 sibling, 0 replies; 45+ messages in thread From: J.P. @ 2024-02-21 1:11 UTC (permalink / raw) To: Emanuel Berg; +Cc: emacs-erc, 68401 Emanuel Berg <incal@dataswamp.org> writes: > I sent a reply to this but it hasn't appeared yet, it seems. > Anyway, I finally understood all of what you asked for, > I think, so you can disregard that post and instead have > a look at the below patch, hopefully it covers it. Yes, this should be fine. Thanks. ^ permalink raw reply [flat|nested] 45+ messages in thread
[parent not found: <87ttm2boza.fsf@neverwas.me>]
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt [not found] ` <87ttm2boza.fsf@neverwas.me> @ 2024-02-21 1:16 ` Emanuel Berg 2024-03-01 0:18 ` J.P. 0 siblings, 1 reply; 45+ messages in thread From: Emanuel Berg @ 2024-02-21 1:16 UTC (permalink / raw) To: 68401; +Cc: emacs-erc J.P. wrote: >> I sent a reply to this but it hasn't appeared yet, it >> seems. Anyway, I finally understood all of what you asked >> for, I think, so you can disregard that post and instead >> have a look at the below patch, hopefully it covers it. > > Yes, this should be fine. Thanks. \o/ -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 45+ messages in thread
* bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt 2024-02-21 1:16 ` Emanuel Berg @ 2024-03-01 0:18 ` J.P. 0 siblings, 0 replies; 45+ messages in thread From: J.P. @ 2024-03-01 0:18 UTC (permalink / raw) To: 68401-done; +Cc: Emanuel Berg, emacs-erc Emanuel Berg <incal@dataswamp.org> writes: > J.P. wrote: > >>> I sent a reply to this but it hasn't appeared yet, it >>> seems. Anyway, I finally understood all of what you asked >>> for, I think, so you can disregard that post and instead >>> have a look at the below patch, hopefully it covers it. >> >> Yes, this should be fine. Thanks. > > \o/ This has been installed as 15a140a2466 Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME Thanks and closing. ^ permalink raw reply [flat|nested] 45+ messages in thread
end of thread, other threads:[~2024-03-01 0:18 UTC | newest] Thread overview: 45+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-01-12 10:43 bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Emanuel Berg [not found] <87v87yvnly.fsf@dataswamp.org> 2024-01-12 12:08 ` Eli Zaretskii 2024-01-12 14:12 ` Emanuel Berg 2024-01-12 14:39 ` Eli Zaretskii 2024-01-13 2:09 ` Emanuel Berg 2024-01-13 2:31 ` Emanuel Berg 2024-01-13 2:45 ` Emanuel Berg 2024-01-13 7:23 ` Eli Zaretskii 2024-01-14 9:11 ` Emanuel Berg [not found] ` <834jfikb4d.fsf@gnu.org> 2024-01-12 12:36 ` Emanuel Berg [not found] ` <87ply6vidl.fsf@dataswamp.org> 2024-01-12 14:03 ` Eli Zaretskii 2024-01-12 14:30 ` Emanuel Berg [not found] ` <87mstavias.fsf@dataswamp.org> [not found] ` <87wmseoskl.fsf@dataswamp.org> 2024-01-19 2:58 ` J.P. 2024-01-22 10:18 ` Emanuel Berg 2024-01-22 15:11 ` J.P. 2024-01-22 17:00 ` Emanuel Berg 2024-01-22 19:23 ` Emanuel Berg [not found] ` <87y1ch851b.fsf@igel.home> 2024-01-22 21:05 ` Emanuel Berg 2024-01-22 21:27 ` J.P. 2024-01-23 4:25 ` Emanuel Berg 2024-01-23 4:32 ` Emanuel Berg 2024-01-23 6:20 ` Emanuel Berg 2024-01-23 13:31 ` Emanuel Berg 2024-01-24 0:36 ` J.P. 2024-01-24 0:56 ` Emanuel Berg 2024-01-24 1:38 ` J.P. 2024-01-24 2:01 ` Emanuel Berg 2024-01-23 13:42 ` Emanuel Berg 2024-01-24 0:34 ` J.P. 2024-01-24 1:28 ` Emanuel Berg 2024-01-24 1:38 ` Emanuel Berg 2024-01-24 11:15 ` Emanuel Berg 2024-01-24 11:55 ` Emanuel Berg 2024-02-05 0:52 ` Emanuel Berg 2024-02-06 3:44 ` J.P. 2024-02-11 1:58 ` Emanuel Berg 2024-02-11 2:27 ` Emanuel Berg 2024-02-11 3:30 ` Emanuel Berg 2024-02-11 3:52 ` Emanuel Berg 2024-02-14 1:42 ` J.P. 2024-02-17 5:21 ` Emanuel Berg 2024-02-17 8:52 ` Emanuel Berg 2024-02-21 1:11 ` J.P. [not found] ` <87ttm2boza.fsf@neverwas.me> 2024-02-21 1:16 ` Emanuel Berg 2024-03-01 0:18 ` J.P.
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.