From unknown Mon Jun 16 23:43:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#68401 <68401@debbugs.gnu.org> To: bug#68401 <68401@debbugs.gnu.org> Subject: Status: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Reply-To: bug#68401 <68401@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:43:03 +0000 retitle 68401 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cm= d-GME', `erc-cmd-AME'. 2nd attempt reassign 68401 emacs submitter 68401 Emanuel Berg severity 68401 normal tag 68401 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 05:43:22 2024 Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 10:43:22 +0000 Received: from localhost ([127.0.0.1]:35006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOF0T-0000hN-NG for submit@debbugs.gnu.org; Fri, 12 Jan 2024 05:43:22 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOF0O-0000gf-5i for submit@debbugs.gnu.org; Fri, 12 Jan 2024 05:43:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOF0K-0001qt-Ei for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 05:43:12 -0500 Received: from srv.dataswamp.org ([95.217.107.122] helo=dataswamp.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOF0H-0006J0-5Z for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 05:43:12 -0500 Received: from dataswamp.org (localhost [127.0.0.1]) by dataswamp.org (OpenSMTPD) with ESMTP id 1d9858c2 for ; Fri, 12 Jan 2024 10:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=dataswamp.org; h=from:to :subject:date:message-id:mime-version:content-type; s=9287606; bh=IQiKkS0IMn46DGbVe2txJjdrxdc=; b=Ok3K8kANxEESDfDPFNvjZ5ZpFkvm W2echFAkkDc0AK/T7+4LhqMAYg/9oDd+RicxRtFZpV3dywB2zNveFFxFWIAHs64K 0bz4gSbc6hXWu6g2Sa0DWUucbFm3ZJniR1zHBbW6KVRON0RVtG86vORazp71X5Pe oCvZtb7aqXmu+C8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=dataswamp.org; h=from:to :subject:date:message-id:mime-version:content-type; q=dns; s= 9287606; b=vbLr89h0JKwk6yb5EPKmK9OJHVybl/TfOEfq0pvkkLSwdMmPayPa3 c9/rEr4bAb1+rKpy0b2r2+PNJask0DAzUvYgT+tPUdEkK4eKDfunEHf7VLwgvXqd HdMWpOG0d3ww2Tu/MEUcwy3oWSeAgt+cwL6cizyBpoiRvrxOActkBc= Received: from ebc (localhost [127.0.0.1]) by dataswamp.org (OpenSMTPD) with ESMTP id 254ab436 for ; Fri, 12 Jan 2024 10:43:05 +0000 (UTC) From: Emanuel Berg To: bug-gnu-emacs@gnu.org Subject: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt X-Debbugs-CC: emacs-erc@gnu.org Mail-Copies-To: never Tags: patch Date: Fri, 12 Jan 2024 11:43:05 +0100 Message-ID: <87v87yvnly.fsf@dataswamp.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=95.217.107.122; envelope-from=incal@dataswamp.org; helo=dataswamp.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain 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)) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-erc-cmd-GMSG-erc-cmd-AMSG-erc-cmd-GME-erc-cmd-AME.patch >From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 07:08:45 2024 Received: (at 68401) by debbugs.gnu.org; 12 Jan 2024 12:08:46 +0000 Received: from localhost ([127.0.0.1]:35075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOGL7-0003SW-JM for submit@debbugs.gnu.org; Fri, 12 Jan 2024 07:08:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOGL5-0003SJ-Ei for 68401@debbugs.gnu.org; Fri, 12 Jan 2024 07:08:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOGL0-0007K5-7N; Fri, 12 Jan 2024 07:08:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=y0YCLd1j8/M1hZyLGJQqk9v11/EHfyiJpKK+pS7TlWI=; b=qvclRgQaoy4y 5qH/RdQAovEVnhthDVH0fO8qzcYN10A6t/3WrUTrFLL2oh+36qNaToYIqvYQdOjDnJKrXQaIYvw0m LrUDj7ozjKWV71KBj2Dex+h7s3NmpqFOEm/89vGFn5AXWjrEKuAeFMlroUB/WXUeDv4cTg0l0qDRl V3TyqG+EqkgKGoPSOOgO5MCFbg/SGQUGOk9aUPfQs4xVNN42nyH//RelNRKzPOK5IQJ3hKropnfuN Zfdi6NdCAoWEohAwHcBVXJCRk0SISWCv6hk910gLzeXy0idgFx+7QPnult9xdkxKmlehU45B4FPN1 Z9iI0yFT0a4u98q59Pvn0w==; Date: Fri, 12 Jan 2024 14:08:18 +0200 Message-Id: <834jfikb4d.fsf@gnu.org> From: Eli Zaretskii To: Emanuel Berg In-Reply-To: <87v87yvnly.fsf@dataswamp.org> (message from Emanuel Berg on Fri, 12 Jan 2024 11:43:05 +0100) Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt References: <87v87yvnly.fsf@dataswamp.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org, 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: emacs-erc@gnu.org > From: Emanuel Berg > 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 > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 07:36:13 2024 Received: (at 68401) by debbugs.gnu.org; 12 Jan 2024 12:36:14 +0000 Received: from localhost ([127.0.0.1]:35104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOGlh-00011y-Kw for submit@debbugs.gnu.org; Fri, 12 Jan 2024 07:36:13 -0500 Received: from srv.dataswamp.org ([95.217.107.122]:2761 helo=dataswamp.org ident=hhs8vmowhltr5sxvum1l) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOGlc-00011l-BX for 68401@debbugs.gnu.org; Fri, 12 Jan 2024 07:36:11 -0500 Received: from dataswamp.org (localhost [127.0.0.1]) by dataswamp.org (OpenSMTPD) with ESMTP id 52b88cba; Fri, 12 Jan 2024 12:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=dataswamp.org; h=from:to :cc:subject:in-reply-to:references:date:message-id:mime-version :content-type; s=9287606; bh=eGHdUmpuJjj2Hbq25p7AU8D5v7g=; b=jtf Bg444sNSmuYaedWEeuXq6FJl7NmsqGWGQ1ItpnNFDeKlnVMmW9aPgMO0zwulyKUm grnn8WIaf6rmwLFwUexJR7B1/s/WRTf1tMwUkWe1rtebzQ1913nqG3V6WNqW7FJk NvHmSeQYnv1f/c4AnwRYDV9BB64q+Sqyh/zQ4Klo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=dataswamp.org; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; q=dns; s=9287606; b=pCbAX0zGIeeFoDPeWCE7qXMYYbrXq PC/4Fyj7GtDqIsrMBno2l6X5EKam4DwxQgvf3DsyK2LdDjtnSmwLvbZzbyJVgLkM to5mWUsyxdWL/gIpf4BeaBw7dUUIKPs/rLljAT+X+Rxjh+G46RAE9gDw2je8ifrN gqzgxsGvJxXw+I= Received: from ebc (localhost [127.0.0.1]) by dataswamp.org (OpenSMTPD) with ESMTP id 297320a6; Fri, 12 Jan 2024 12:36:08 +0000 (UTC) From: Emanuel Berg To: Eli Zaretskii Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <834jfikb4d.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2024 14:08:18 +0200") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> Mail-Copies-To: never Date: Fri, 12 Jan 2024 13:36:06 +0100 Message-ID: <87ply6vidl.fsf@dataswamp.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org, 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 09:03:32 2024 Received: (at 68401) by debbugs.gnu.org; 12 Jan 2024 14:03:32 +0000 Received: from localhost ([127.0.0.1]:35221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOI8C-0002k3-Gm for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:03:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOI87-0002jl-KL for 68401@debbugs.gnu.org; Fri, 12 Jan 2024 09:03:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOI83-0006Uu-8U; Fri, 12 Jan 2024 09:03:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=LGbV2LH+8l72Y8aZe2ecGkvmAV35lL2An90kavpWhhY=; b=hJSkUTU23NbI T6hdbvfIPTedS9ycBGjqdTISfYJ496nbSJpWVbD3l5vKrmBCc1UMgto6+O4QnJwYe1ARxVOhJ/gum +SN8VtAqeivzw/n37BP7zQz8oT0oVUWQWtqhW+QKp5NciLKx5b5LXRXk8Y2vG13zypdKxpLrM/GJF 8oNWdpK4jcSTJ6hou1Gc8wg+r/l6aRT9nyhQ5G/8QvzW6vczPSIJ1ZlgKQ+0RKOjJLmn3ahm81368 WNJ+zLu2tW7RmTRnsgZxPcwhEcsEO0FbG6DLJdUPP83XMTVnkVfz6QnMjgCpduQD4tQjvx377cuPq p+Tf+ifKNoATH/H80Yulkg==; Date: Fri, 12 Jan 2024 16:03:09 +0200 Message-Id: <83wmseir8i.fsf@gnu.org> From: Eli Zaretskii To: Emanuel Berg In-Reply-To: <87ply6vidl.fsf@dataswamp.org> (message from Emanuel Berg on Fri, 12 Jan 2024 13:36:06 +0100) Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87ply6vidl.fsf@dataswamp.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org, 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Emanuel Berg > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 09:13:18 2024 Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 14:13:18 +0000 Received: from localhost ([127.0.0.1]:35242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIHe-00030Q-0G for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:13:18 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIHa-000307-PD for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:13:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOIHW-0005d5-MU for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 09:13:10 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOIHU-0002zY-Gy for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 09:13:10 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOIHR-0008Yi-RH for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 15:13:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Date: Fri, 12 Jan 2024 15:12:57 +0100 Message-ID: <87edemvdw6.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:AHyAb5fhQVocpACSFva9ycnALO4= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Docstrings-for-interactive-use.patch >From 73f3cc5072bb8cc95ce5367cb8aef74e5b047f0d Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 15:03:10 +0100 Subject: [PATCH 2/2] Docstrings for interactive use. --- lisp/erc/erc.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 06791bce520..aeb7722b563 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4017,7 +4017,8 @@ erc--split-string-shell-cmd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun erc-cmd-GMSG (line) - "Send LINE to all channels on all networks you are on." + "Send LINE to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server nil @@ -4026,7 +4027,8 @@ erc-cmd-GMSG (put 'erc-cmd-GMSG 'do-not-parse-args t) (defun erc-cmd-AMSG (line) - "Send LINE to all channels of the current network." + "Send LINE to all channels of the current network. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server erc-server-process @@ -4035,7 +4037,8 @@ erc-cmd-AMSG (put 'erc-cmd-AMSG 'do-not-parse-args t) (defun erc-cmd-GME (line) - "Send LINE as an action to all channels on all networks you are on." + "Send LINE as an action to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels: ") (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) @@ -4043,7 +4046,8 @@ erc-cmd-GME (put 'erc-cmd-GME 'do-not-parse-args t) (defun erc-cmd-AME (line) - "Send LINE as an action to all channels on the current network." + "Send LINE as an action to all channels on the current network. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels on this network: ") (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) -- 2.39.2 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 09:30:58 2024 Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 14:30:58 +0000 Received: from localhost ([127.0.0.1]:35280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIYk-0007qG-1t for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:30:58 -0500 Received: from lists.gnu.org ([2001:470:142::17]:38612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIYi-0007gI-5N for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:30:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOIYc-0006DI-VQ for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 09:30:50 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOIYb-0003OS-7S for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 09:30:50 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOIYX-0001cd-V0 for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 15:30:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Fri, 12 Jan 2024 15:30:30 +0100 Message-ID: <87bk9qvd2x.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87ply6vidl.fsf@dataswamp.org> <83wmseir8i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:1fBOHDzsibO9wF+VVRlA3LCk/iM= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 09:39:40 2024 Received: (at 68401) by debbugs.gnu.org; 12 Jan 2024 14:39:40 +0000 Received: from localhost ([127.0.0.1]:35301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIh9-0000cZ-QK for submit@debbugs.gnu.org; Fri, 12 Jan 2024 09:39:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOIh6-0000cL-QS for 68401@debbugs.gnu.org; Fri, 12 Jan 2024 09:39:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOIh2-0007Up-If; Fri, 12 Jan 2024 09:39:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=P3uVEflA9hiospbLmtn7smh5cC5JRePC9GCFlLJotF8=; b=sBLdXOMaGc0u R2esfs2leoE36sEOp5fBW5nWhzlLepF8FomDybKBND8GRoI/owo4wax1hNKtWTaRyX8Zx3diTh6Jw V6OXrQBHi7X287gIlYXztPLLv7RPvy+KrZMtGbNbPTEdkWFmsci9tYAm0nsE6/p9UwUWw/IjEeczJ 55+uLZSukR5nYW0FFoeOP61TRBrTnMy99p3LSCi9FEwquVQsB2Shxp9O12NG0aR+oDYbAUBQEHRdZ ox1lc12/v/bTFuMQiV3V8ZRTGoO9SoDnXEdquP0cyLvHWEONUJBhZLwlis/2CWq3nP0LFQmyeho07 42o6niER2k7ZVJB0hPAHHw==; Date: Fri, 12 Jan 2024 16:39:20 +0200 Message-Id: <83mstaipk7.fsf@gnu.org> From: Eli Zaretskii To: Emanuel Berg In-Reply-To: <87edemvdw6.fsf@dataswamp.org> (message from Emanuel Berg on Fri, 12 Jan 2024 15:12:57 +0100) Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68401 Cc: 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Emanuel Berg > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 18:02:50 2024 Received: (at control) by debbugs.gnu.org; 12 Jan 2024 23:02:50 +0000 Received: from localhost ([127.0.0.1]:37951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOQY6-0005qa-FZ for submit@debbugs.gnu.org; Fri, 12 Jan 2024 18:02:50 -0500 Received: from mail-108-mta242.mxroute.com ([136.175.108.242]:33383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOQY3-0005qN-SV for control@debbugs.gnu.org; Fri, 12 Jan 2024 18:02:49 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta242.mxroute.com (ZoneMTA) with ESMTPSA id 18cffe9dd1b0003727.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 12 Jan 2024 23:02:45 +0000 X-Zone-Loop: df6e2387a1f2954642ed27888d8019846a1ad753675f X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pVesJRiyfmWpV15QcSVXhePbhPNc46xGqv/+hgk9sFo=; b=jHylECsX3wzieREXKwy5zmO3KR 5oyckwQ92+U5IPoInS3PzsddTm5DtIppZxpsKKjTNKNrdQGdO+RNdcVS+pxvRp0PcAdNDUMJmUBAI a3/GWsfHSop4lt3tImzL6HyYBzcojxzMNgJZE8ANU3B/b9gfMEPlMHMphnXjnyD/DvIf5ef+Ag8el 1cxzmUADg1Kob0UXOLWy33aRPd75voDCORg04Dp8K7fT5axLy16aoLMYP6HpkaMKWKOFKLi8pTOvx P0roU7JjQdJuhwqAq7bTyBnQE6ZntGvJAoPtwcPNXvR8Ho3HgV+G8z9E+SGanvym9YYOzxzeTVaGW fVGliTxg==; From: "J.P." To: control@debbugs.gnu.org Subject: control message for bug #68401 Date: Fri, 12 Jan 2024 15:02:42 -0800 Message-ID: <874jfi9mul.fsf@neverwas.me> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 68401 68395 quit From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 21:09:38 2024 Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 02:09:38 +0000 Received: from localhost ([127.0.0.1]:38045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOTSr-0000dH-MF for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:09:38 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOTSp-0000d3-9B for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:09:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOTSZ-0000kL-Rt for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:09:20 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOTSW-0005wb-1m for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:09:19 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOTST-0004S9-67 for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 03:09:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Date: Sat, 13 Jan 2024 03:09:05 +0100 Message-ID: <8734v2ugqm.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> <83mstaipk7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:xj51JyjyrrwWgn4Fe3TiocNnAvk= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-all.patch >From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 11:37:28 +0100 Subject: [PATCH 1/2] `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. --- lisp/erc/erc.el | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 478683a77f5..06791bce520 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4016,16 +4016,40 @@ erc--split-string-shell-cmd ;; Input commands handlers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun erc-cmd-AMSG (line) - "Send LINE to all channels of the current server that you are on." - (interactive "sSend to all channels you're on: ") +(defun erc-cmd-GMSG (line) + "Send LINE to all channels on all networks you are on." + (interactive "sSend to all channels: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server nil - (lambda () - (erc-channel-p (erc-default-target))) + (lambda () (erc-channel-p (erc-default-target))) + (erc-send-message line))) +(put 'erc-cmd-GMSG 'do-not-parse-args t) + +(defun erc-cmd-AMSG (line) + "Send LINE to all channels of the current network." + (interactive "sSend to all channels on this network: ") + (setq line (erc-trim-string line)) + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) (erc-send-message line))) (put 'erc-cmd-AMSG 'do-not-parse-args t) +(defun erc-cmd-GME (line) + "Send LINE as an action to all channels on all networks you are on." + (interactive "sSend action to all channels: ") + (erc-with-all-buffers-of-server nil + (lambda () (erc-channel-p (erc-default-target))) + (erc-cmd-ME line) )) +(put 'erc-cmd-GME 'do-not-parse-args t) + +(defun erc-cmd-AME (line) + "Send LINE as an action to all channels on the current network." + (interactive "sSend action to all channels on this network: ") + (erc-with-all-buffers-of-server erc-server-process + (lambda () (erc-channel-p (erc-default-target))) + (erc-cmd-ME line) )) +(put 'erc-cmd-AME 'do-not-parse-args t) + (defun erc-cmd-SAY (line) "Send LINE to the current query or channel as a message, not a command. -- 2.39.2 >From 73f3cc5072bb8cc95ce5367cb8aef74e5b047f0d Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 15:03:10 +0100 Subject: [PATCH 2/2] Docstrings for interactive use. --- lisp/erc/erc.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 06791bce520..aeb7722b563 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4017,7 +4017,8 @@ erc--split-string-shell-cmd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun erc-cmd-GMSG (line) - "Send LINE to all channels on all networks you are on." + "Send LINE to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server nil @@ -4026,7 +4027,8 @@ erc-cmd-GMSG (put 'erc-cmd-GMSG 'do-not-parse-args t) (defun erc-cmd-AMSG (line) - "Send LINE to all channels of the current network." + "Send LINE to all channels of the current network. +Interactively, prompt for the line of text to send." (interactive "sSend to all channels on this network: ") (setq line (erc-trim-string line)) (erc-with-all-buffers-of-server erc-server-process @@ -4035,7 +4037,8 @@ erc-cmd-AMSG (put 'erc-cmd-AMSG 'do-not-parse-args t) (defun erc-cmd-GME (line) - "Send LINE as an action to all channels on all networks you are on." + "Send LINE as an action to all channels on all networks you are on. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels: ") (erc-with-all-buffers-of-server nil (lambda () (erc-channel-p (erc-default-target))) @@ -4043,7 +4046,8 @@ erc-cmd-GME (put 'erc-cmd-GME 'do-not-parse-args t) (defun erc-cmd-AME (line) - "Send LINE as an action to all channels on the current network." + "Send LINE as an action to all channels on the current network. +Interactively, prompt for the line of text to send." (interactive "sSend action to all channels on this network: ") (erc-with-all-buffers-of-server erc-server-process (lambda () (erc-channel-p (erc-default-target))) -- 2.39.2 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 21:31:47 2024 Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 02:31:47 +0000 Received: from localhost ([127.0.0.1]:38059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOToJ-0006T6-48 for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:31:47 -0500 Received: from lists.gnu.org ([2001:470:142::17]:41444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOToH-0006OO-DN for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:31:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOToD-0004UU-A9 for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:31:41 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOToB-0001kl-8g for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:31:41 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOTo8-000AA3-87 for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 03:31:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Date: Sat, 13 Jan 2024 03:31:28 +0100 Message-ID: <87zfxat14v.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> <83mstaipk7.fsf@gnu.org> <8734v2ugqm.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:dpAUVrg/sbxceW0GDhma72L4v9o= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain >>> 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-all.patch >From a2345b8eb22af2d5a052c1e22a19aeffc48544b2 Mon Sep 17 00:00:00 2001 From: Emanuel Berg Date: Fri, 12 Jan 2024 11:37:28 +0100 Subject: [PATCH 1/2] 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 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 21:46:03 2024 Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 02:46:03 +0000 Received: from localhost ([127.0.0.1]:38063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOU26-0000K9-W9 for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:46:03 -0500 Received: from lists.gnu.org ([2001:470:142::17]:35162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOU23-00007n-T4 for submit@debbugs.gnu.org; Fri, 12 Jan 2024 21:46:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOU1z-0008C2-2j for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:45:55 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOU1x-0001OC-9s for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 21:45:54 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOU1u-0006QG-WD for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 03:45:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Date: Sat, 13 Jan 2024 03:45:43 +0100 Message-ID: <874jfiq7c8.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> <83mstaipk7.fsf@gnu.org> <8734v2ugqm.fsf@dataswamp.org> <87zfxat14v.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:Zsos+piUzgA+0QsLqZDWe/pd6PI= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain >>>> 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Functions-for-ERC.patch >From fa8ae9dcc306d16cccdd6aa7c2bac242b90adbdb Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 13 02:23:35 2024 Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 07:23:35 +0000 Received: from localhost ([127.0.0.1]:38269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOYMc-0005lW-KK for submit@debbugs.gnu.org; Sat, 13 Jan 2024 02:23:35 -0500 Received: from lists.gnu.org ([2001:470:142::17]:60542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOYMa-0005lI-KK for submit@debbugs.gnu.org; Sat, 13 Jan 2024 02:23:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOYMW-000102-9a for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 02:23:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOYMV-0006Bw-11; Sat, 13 Jan 2024 02:23:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GQbPX2pqk9Ez+18miIZbRRBaDdeudl+gUl6MYbgxZ38=; b=pN3eRUUUwCe+ qULQcUIasskA8IvZH63VE8xNkSG4prjwYeUz/8yBdN8iqTmSM+2U4UTdaQKJN/kHHSYk2AjBcbAE7 tZDLYIsnzO6XhJlLg1wUvMjH2kNGOXqpVraKK0w5zrC7+GFCKS24kjke5m9n2914vxPDmyuMECnmo pkdLeQiY+x4Rp9TdvBUGmylX60H9cn5D6G6rENSjDd3zvS9WcEw3SX1rKqx0Us+TcwbEvjeuogPA8 YtBKgcYp8Xf01jFJMmaJYfPF7R+HZn+r1PHBq3lO7cCES5X19293qSWXgbI/nR0lohsGISm0N/n84 uHFywbyqoeNImvTNWmFbDA==; Date: Sat, 13 Jan 2024 09:23:01 +0200 Message-Id: <83o7dphf3e.fsf@gnu.org> From: Eli Zaretskii To: Emanuel Berg In-Reply-To: <87zfxat14v.fsf@dataswamp.org> (message from Emanuel Berg on Sat, 13 Jan 2024 03:31:28 +0100) Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> <83mstaipk7.fsf@gnu.org> <8734v2ugqm.fsf@dataswamp.org> <87zfxat14v.fsf@dataswamp.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Emanuel Berg > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 14 04:11:34 2024 Received: (at submit) by debbugs.gnu.org; 14 Jan 2024 09:11:34 +0000 Received: from localhost ([127.0.0.1]:41672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOwWk-0004jY-D2 for submit@debbugs.gnu.org; Sun, 14 Jan 2024 04:11:34 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOwWi-0004jL-1K for submit@debbugs.gnu.org; Sun, 14 Jan 2024 04:11:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOwWd-0003EH-IU for bug-gnu-emacs@gnu.org; Sun, 14 Jan 2024 04:11:27 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOwWb-0001tJ-SE for bug-gnu-emacs@gnu.org; Sun, 14 Jan 2024 04:11:27 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rOwWX-0001Pb-NE for bug-gnu-emacs@gnu.org; Sun, 14 Jan 2024 10:11:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sun, 14 Jan 2024 10:11:04 +0100 Message-ID: <87frz0p9ef.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf__6528.35318339697$1705061373$gmane$org@gnu.org> <87edemvdw6.fsf@dataswamp.org> <83mstaipk7.fsf@gnu.org> <8734v2ugqm.fsf@dataswamp.org> <87zfxat14v.fsf@dataswamp.org> <83o7dphf3e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:hBqdaVXIb5YUxdyZgEUwNmJMNac= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 18 21:59:03 2024 Received: (at 68401) by debbugs.gnu.org; 19 Jan 2024 02:59:03 +0000 Received: from localhost ([127.0.0.1]:57109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQf5x-0007uE-Md for submit@debbugs.gnu.org; Thu, 18 Jan 2024 21:59:03 -0500 Received: from mail-108-mta6.mxroute.com ([136.175.108.6]:37585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQf5u-0007u4-Vs for 68401@debbugs.gnu.org; Thu, 18 Jan 2024 21:59:00 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta6.mxroute.com (ZoneMTA) with ESMTPSA id 18d1fa8394d0003727.002 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 19 Jan 2024 02:58:54 +0000 X-Zone-Loop: d6346032d40c15b211a58f9163a046ff31e0400c1847 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6YBlaKpmyE4W9/4HR/zZKgieeTWGag9tQWC47gWCeI8=; b=KuCO1594tefUkhfIzEnRF4xCAO kGqqCBZ3PV9io/OMjLvHoSVyD57J/AAmBiMXTvWbnlDlep81QHIJtOlv789Fw+P5cjqYFtDTLjOpb SsdSh5BLhFRLUhWkOBBYXVSLwcclWPN4Dq4YpxvmAf/4d2Wf9g7E6tjtHWOVHqU0v+SFxlBMSBtlF bOEAqkNhAXVJPkxNxgtP2VGc6syyDJF6OSJCEeIQApOmDA5d/xWAjGVIKUisRJKnWP3HudA/Y+f8M qCrZnh7OCx6lRe6gHeUb+fMn6NbRXHPPi+fMdzlvNkbYIbJBO5Wh7odXFGojtul1e49WypfaNZwZ3 HLcBhgLw==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87wmseoskl.fsf@dataswamp.org> (Emanuel Berg's message of "Sat, 13 Jan 2024 03:50:02 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> Date: Thu, 18 Jan 2024 18:58:51 -0800 Message-ID: <87plxyowpg.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: Emanuel Berg , emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Emanuel Berg writes: >> From fa8ae9dcc306d16cccdd6aa7c2bac242b90adbdb Mon Sep 17 00:00:00 2001 > From: Emanuel Berg > 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 being less faithful (or whatever) to the traditional IRC experience than /FOO . 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 , 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 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 hi 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-5.x-Add-tests-for-ERC-slash-commands-AMSG-GMSG-etc.patch >From 0dfe03ad58e6d1edd47eace6faddeeb1733f6b37 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 05:18:43 2024 Received: (at submit) by debbugs.gnu.org; 22 Jan 2024 10:18:43 +0000 Received: from localhost ([127.0.0.1]:39920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRrO7-0000S1-0X for submit@debbugs.gnu.org; Mon, 22 Jan 2024 05:18:43 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRrO5-0000Ro-GV for submit@debbugs.gnu.org; Mon, 22 Jan 2024 05:18:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRrNw-0007Mq-7m for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 05:18:32 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRrNu-0001J3-Bt for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 05:18:31 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rRrNr-0005Uf-E3 for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 11:18:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Mon, 22 Jan 2024 11:18:19 +0100 Message-ID: <87wms1k6xg.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:50eZ73/lbB+Vw1CDpJWXBLVjL6I= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 being less faithful (or whatever) > to the traditional IRC experience than /FOO . 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 10:11:39 2024 Received: (at submit) by debbugs.gnu.org; 22 Jan 2024 15:11:39 +0000 Received: from localhost ([127.0.0.1]:41517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRvxa-0006dB-6s for submit@debbugs.gnu.org; Mon, 22 Jan 2024 10:11:39 -0500 Received: from lists.gnu.org ([2001:470:142::17]:57738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRvxW-0006cs-LM for submit@debbugs.gnu.org; Mon, 22 Jan 2024 10:11:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRvxM-00043a-Uf for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 10:11:24 -0500 Received: from mail-108-mta196.mxroute.com ([136.175.108.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRvxK-0003UP-Pf for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 10:11:24 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta196.mxroute.com (ZoneMTA) with ESMTPSA id 18d31b9d1080003727.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 22 Jan 2024 15:11:17 +0000 X-Zone-Loop: b7f4a5577e192cb043981fd2537ae0691990a8fecfd5 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=93/dn6w3gIm5gHMbEY3RJtu1r4c8C+qj5bj1/Pm20+4=; b=RbYcqImYMgXszDqDiC9XnJK/P5 aIfBHT44+ZmH6aHrTmDYRMXZfSrRGp+FOkvXl0umE9SqXpO3QePiTYlgkzMDgI9gwof7u4HIRodeO t1EHXGY1gC1Far/s5ZXsAPiVUSs42jGUy9F0wKlHlNPTbOBCfDoD9gMZC+Qa9Eazd3E3xwrx7x1os zdOjgG+FnFqpFEKscIf3DFz8HL9Rn+SVXSJTBHwHTh+uumKnc4xhemjIg1A94FOKLTTDdkZc32BZ+ FXRhMmA/5vPSAY+v2YVbYoE1aEoqurXTpJl9dq+OPai6gaOXWzClLwTpWOPKqYkCtdsYPbfGq5gwJ 8eItNIbQ==; From: "J.P." To: bug-gnu-emacs@gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87wms1k6xg.fsf@dataswamp.org> (Emanuel Berg's message of "Mon, 22 Jan 2024 11:18:19 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> Date: Mon, 22 Jan 2024 07:11:14 -0800 Message-ID: <87plxt2yjx.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me Received-SPF: pass client-ip=136.175.108.196; envelope-from=jp@neverwas.me; helo=mail-108-mta196.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Emanuel Berg 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 being less faithful (or whatever) >> to the traditional IRC experience than /FOO . 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 16:27:45 2024 Received: (at 68401) by debbugs.gnu.org; 22 Jan 2024 21:27:45 +0000 Received: from localhost ([127.0.0.1]:41848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS1pY-0008Ed-Of for submit@debbugs.gnu.org; Mon, 22 Jan 2024 16:27:45 -0500 Received: from mail-108-mta216.mxroute.com ([136.175.108.216]:38799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS1pT-0008ER-IT for 68401@debbugs.gnu.org; Mon, 22 Jan 2024 16:27:43 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta216.mxroute.com (ZoneMTA) with ESMTPSA id 18d331242fa0003727.001 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 22 Jan 2024 21:27:31 +0000 X-Zone-Loop: f6e85c3d1ec63b4360d8281641d1ae7564453cfb453b X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HZpOUcwjIdO8mbH3VqA6S0OoukiEhvTZw+PT5MZcjiw=; b=aw8QTmyW1XuwCWu8c6+jqMcw7I Cw5NgLs9YBI4FOhuYrfZhVTdMymGYQD3U0zOPFhQXmxSFo2pGckxE9e35SoaPwWqfBRY06mXfd1kz xJwL0Q+LCn0f4ELLHsk4ZnMuUODW2s67xOIXjZTLow4HvV5ynK4gVVH77/mVOUFoFKiuIGaZCQfaR cA/V2SNQkYOF81voigHbX2jS/OPb/tZ4IlVQqUOtjunuZi7VmBgk1Cq3QlobQZGgfg8vOF+bo4/m0 aPHqKCg/AWWHX/B39AS380dhop1+5u/7AO41W5jtrWEYtEIeZMZ61uZQS5XYQ4wN/knx9bfSw9B8P KA6uEgOw==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87r0i9jhp6.fsf@dataswamp.org> (Emanuel Berg's message of "Mon, 22 Jan 2024 20:23:17 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> Date: Mon, 22 Jan 2024 13:27:28 -0800 Message-ID: <87zfwxxdmn.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 23:25:29 2024 Received: (at submit) by debbugs.gnu.org; 23 Jan 2024 04:25:29 +0000 Received: from localhost ([127.0.0.1]:42044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS8Lp-0002nc-4s for submit@debbugs.gnu.org; Mon, 22 Jan 2024 23:25:29 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS8Ln-0002nN-0b for submit@debbugs.gnu.org; Mon, 22 Jan 2024 23:25:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rS8Lc-0008Iz-H7 for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 23:25:16 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rS8La-0003CT-Es for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 23:25:16 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rS8LY-0008Hl-80 for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 05:25:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Tue, 23 Jan 2024 05:25:05 +0100 Message-ID: <87zfwwism6.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:22teQamj6xxM4cuvROAa6sr+qHA= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 22 23:33:00 2024 Received: (at submit) by debbugs.gnu.org; 23 Jan 2024 04:33:00 +0000 Received: from localhost ([127.0.0.1]:42049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS8T6-0002yv-56 for submit@debbugs.gnu.org; Mon, 22 Jan 2024 23:33:00 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rS8T1-0002yf-UI for submit@debbugs.gnu.org; Mon, 22 Jan 2024 23:32:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rS8Ss-00014m-5n for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 23:32:46 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rS8Sp-00044W-0j for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 23:32:45 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rS8Sm-0006pV-Nz for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 05:32:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Tue, 23 Jan 2024 05:32:35 +0100 Message-ID: <87wms0is9o.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:9rmOqpgKXbQIlWMaIFVis4fP0io= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) >>> (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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 01:21:00 2024 Received: (at submit) by debbugs.gnu.org; 23 Jan 2024 06:21:00 +0000 Received: from localhost ([127.0.0.1]:42092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSA9b-0005rg-OR for submit@debbugs.gnu.org; Tue, 23 Jan 2024 01:21:00 -0500 Received: from lists.gnu.org ([2001:470:142::17]:49146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSA9Z-0005rQ-Gk for submit@debbugs.gnu.org; Tue, 23 Jan 2024 01:20:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSA9P-0008Rv-MT for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 01:20:47 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSA9M-0005Og-Rg for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 01:20:46 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSA9J-0004WG-IN for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 07:20:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Tue, 23 Jan 2024 07:20:34 +0100 Message-ID: <87sf2oin9p.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:dwffGbhy8MverD9mioEB4laSoC0= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) >>>> (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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 08:32:00 2024 Received: (at submit) by debbugs.gnu.org; 23 Jan 2024 13:32:01 +0000 Received: from localhost ([127.0.0.1]:42430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSGsi-0006V3-Hi for submit@debbugs.gnu.org; Tue, 23 Jan 2024 08:32:00 -0500 Received: from lists.gnu.org ([2001:470:142::17]:36726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSGsh-0006Uo-0r for submit@debbugs.gnu.org; Tue, 23 Jan 2024 08:31:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSGsW-0001Gi-PJ for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 08:31:48 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSGsS-00065k-3W for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 08:31:48 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSGsL-0000I8-8G for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 14:31:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Tue, 23 Jan 2024 14:31:24 +0100 Message-ID: <87le8gi3bn.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> <87sf2oin9p.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:6oo4bjiA+8jH9I5vBimwiGLPhgg= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Tags: patch Here is a patch with the latest version. I'll run the unit test now. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From b4248461e88241cb81f64ea6c073dad82df8b48c Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 08:42:53 2024 Received: (at submit) by debbugs.gnu.org; 23 Jan 2024 13:42:53 +0000 Received: from localhost ([127.0.0.1]:42445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSH3F-0006mv-2Z for submit@debbugs.gnu.org; Tue, 23 Jan 2024 08:42:53 -0500 Received: from lists.gnu.org ([2001:470:142::17]:32962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSH3D-0006mj-69 for submit@debbugs.gnu.org; Tue, 23 Jan 2024 08:42:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSH33-0005NA-4a for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 08:42:41 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSH31-0008CK-3T for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 08:42:40 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSH2z-0005UV-7G for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 14:42:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Date: Tue, 23 Jan 2024 14:42:19 +0100 Message-ID: <87il3ki2tg.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:ITva74fcHMBclzzBOV6kSFxGBIw= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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: 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: 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 " bob: Our queen and all" # . #) (#< funcall((closure ((positions (# . #)() handler-bind-1(#f(compiled-function () # bob: Our queen and all (error "Failed awaiting: string: 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 19:34:30 2024 Received: (at 68401) by debbugs.gnu.org; 24 Jan 2024 00:34:30 +0000 Received: from localhost ([127.0.0.1]:44182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRDq-00006G-0a for submit@debbugs.gnu.org; Tue, 23 Jan 2024 19:34:30 -0500 Received: from mail-108-mta201.mxroute.com ([136.175.108.201]:43955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRDm-000065-PN for 68401@debbugs.gnu.org; Tue, 23 Jan 2024 19:34:27 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta201.mxroute.com (ZoneMTA) with ESMTPSA id 18d38e3a7510003727.001 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 24 Jan 2024 00:34:20 +0000 X-Zone-Loop: 8253a50d68d7acbf92abbb522297f538c9ed531793ac X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jiQUL7Q1IjHK2w5Hwx9vapJZE+WyEfEYDuZLep7xt8U=; b=HJ0IPdspN6S3nu0bEpswhVQoB3 E3zDc2fAp7z9m5dv3b5Kn5Dsv9WzOLQTR+EMtLyxDtTodm0BKbM4n9oj01vpDQTj5VUbuyC8fkBUw t14yVU7D1isMQpGWKbwdjDAkEF+fEg/HwedvPrPUOGv7WyHqsCqb+C00WzHG575LfIJP71zUP4IFT uzPV8K/89WQQ/KsH/Ta2FZH1M7Obkc3KKcpXZCJfeGMjvrhj053+lRZfVJDlVbdqhoV+s74Oe9W0d PuMi8Fd1fWWc+qPRmikqmshk8451KpUSrFM0BabPHCK+Et+mxHMrhmgI2oHe8FLnSsM9NNPWLPsSp uhIUj8IQ==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87il3ki2tg.fsf@dataswamp.org> (Emanuel Berg's message of "Tue, 23 Jan 2024 14:42:19 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> Date: Tue, 23 Jan 2024 16:34:17 -0800 Message-ID: <87il3jh8mu.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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: 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: 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 " bob: Our queen and all" # (let* ((pos (cdr (assq (current-buffer) positions))) (erc-d-t--wait- > (closure ((positions (# . #) (#< > funcall((closure ((positions (# . # (save-current-buffer (set-buffer "#foo") (funcall expect 10 " (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 () #)() > handler-bind-1(#f(compiled-function () # 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: bob: Our queen and all > (error "Failed awaiting: string: 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 19:36:19 2024 Received: (at 68401) by debbugs.gnu.org; 24 Jan 2024 00:36:19 +0000 Received: from localhost ([127.0.0.1]:44187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRFa-00009A-O7 for submit@debbugs.gnu.org; Tue, 23 Jan 2024 19:36:19 -0500 Received: from mail-108-mta254.mxroute.com ([136.175.108.254]:33013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRFY-000093-W5 for 68401@debbugs.gnu.org; Tue, 23 Jan 2024 19:36:17 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta254.mxroute.com (ZoneMTA) with ESMTPSA id 18d38e550680003727.001 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 24 Jan 2024 00:36:08 +0000 X-Zone-Loop: a87e17d3a2aa6ee336349d139d21ebc2551a92c8f6bc X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=o0u5NYYHHDrwR9RMrqGomCtLPYj9bqToHDpH7XQ9i8g=; b=OP+OrZaLLEkDxOsuNu7ZzsIeLW zVQvfwSNJ9ij32KWDDqd7JS8aafpIjMgZTKVClG2edjhrHq3ZN4gBSikskiBeTbg3sa45+qAflDPd nhAQ9stG2hdk/4xdXYZhjQ56KiIEKmN/9KFHCx1XZ/XK+uRLr01c9LRxoVjVYvgi4VZeGSNNBu6j+ LETg85k99xirWKO29MJfJch7xWlx5mqiRz3aonMyOe/9DIEgEsvYAunbWFp6JNtVoIJMpI/+viMfD WwmntbmeZe0JiA71SXIeF+EzzIkdpyUUWo2XdSFmkQIByo/WYNh/x/8maMCUAKBpJO5gFdal59aOP BEAb1X6w==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87le8gi3bn.fsf@dataswamp.org> (Emanuel Berg's message of "Tue, 23 Jan 2024 14:31:24 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> <87sf2oin9p.fsf@dataswamp.org> <87le8gi3bn.fsf@dataswamp.org> Date: Tue, 23 Jan 2024 16:36:06 -0800 Message-ID: <87bk9bh8jt.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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 > 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 19:56:54 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 00:56:54 +0000 Received: from localhost ([127.0.0.1]:44204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRZW-0000ir-3P for submit@debbugs.gnu.org; Tue, 23 Jan 2024 19:56:54 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSRZU-0000ib-8w for submit@debbugs.gnu.org; Tue, 23 Jan 2024 19:56:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSRZK-0001bH-16 for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 19:56:42 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSRZI-0007Xo-64 for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 19:56:41 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSRZF-0000Nd-I1 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 01:56:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 01:56:29 +0100 Message-ID: <87o7dbh7lu.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> <87sf2oin9p.fsf@dataswamp.org> <87le8gi3bn.fsf@dataswamp.org> <87bk9bh8jt.fsf__34675.6314321951$1706056632$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:vhKbWsPix81HbTx9cxTJI1rYZAo= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 20:29:02 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 01:29:02 +0000 Received: from localhost ([127.0.0.1]:44221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSS4c-0001YP-A7 for submit@debbugs.gnu.org; Tue, 23 Jan 2024 20:29:02 -0500 Received: from lists.gnu.org ([2001:470:142::17]:36890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSS4a-0001Xu-Kp for submit@debbugs.gnu.org; Tue, 23 Jan 2024 20:29:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSS4Q-000547-Cz for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 20:28:50 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSS4O-0003sV-NT for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 20:28:50 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSS4M-0009ck-M5 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 02:28:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 02:28:35 +0100 Message-ID: <87il3jh64c.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:rf/O8b9oq02lp6UHit8SMgctpw8= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 20:38:45 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 01:38:45 +0000 Received: from localhost ([127.0.0.1]:44230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSE0-0001qc-V6 for submit@debbugs.gnu.org; Tue, 23 Jan 2024 20:38:45 -0500 Received: from lists.gnu.org ([2001:470:142::17]:53656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSDz-0001qL-0X for submit@debbugs.gnu.org; Tue, 23 Jan 2024 20:38:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSSDn-0000u6-1R for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 20:38:31 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSSDl-0005Fj-4Y for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 20:38:30 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSSDi-00020E-2j for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 02:38:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 02:38:15 +0100 Message-ID: <87frynh5o8.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:Q0AujCFy4ZMgVZnbfOUszN8LwPE= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0003-Remove-the-logical-connectivity-test.patch >From 01ab5bd44db814e4520306b85a57ad0e01140674 Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 20:38:21 2024 Received: (at 68401) by debbugs.gnu.org; 24 Jan 2024 01:38:22 +0000 Received: from localhost ([127.0.0.1]:44227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSDd-0001ps-FV for submit@debbugs.gnu.org; Tue, 23 Jan 2024 20:38:21 -0500 Received: from mail-108-mta226.mxroute.com ([136.175.108.226]:39813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSDa-0001pi-T6 for 68401@debbugs.gnu.org; Tue, 23 Jan 2024 20:38:20 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta226.mxroute.com (ZoneMTA) with ESMTPSA id 18d391e1c1a0003727.001 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 24 Jan 2024 01:38:11 +0000 X-Zone-Loop: 3510aeba559bf93fb30a2cdff502cee08196013fb97d X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pM5HflBTRFYkJcXVYPFXyCfLyYznj0efh7x6nKSFWWM=; b=irDMWcRdD6GQC0nPusTmrx+Wpv l0ovkeGTRpv47+ixwa6vm2gDL2TtViNGtBEMMcnk7Sih3Nm45yP3NgcbK93HBzgo73AYsEXoetHrK blJk3/31958GCQtqfXtu+C7xcyqC6OHwQZji82/m8qa44/RrkwaF3dv6QTfK6Cxk5xSme33ICQVNE MZPKcX2l3uGrw8NY95guAUVgnmElEv4O34m12E7jEpFBbIXuz1nLbcQRKeuqEtCtQX8Z6SFV6KUan 8jz6nCp8lap5I9fboREwB423y7pBSniv9lJmm6AtafezfBD54ehJk0BD5Sey/TrgdR0DIsxhrHomS neFhiJ1Q==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87o7dbh7lu.fsf@dataswamp.org> (Emanuel Berg's message of "Wed, 24 Jan 2024 01:56:29 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> <87sf2oin9p.fsf@dataswamp.org> <87le8gi3bn.fsf@dataswamp.org> <87bk9bh8jt.fsf__34675.6314321951$1706056632$gmane$org@neverwas.me> <87o7dbh7lu.fsf@dataswamp.org> Date: Tue, 23 Jan 2024 17:38:07 -0800 Message-ID: <87v87jecjk.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 21:01:44 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 02:01:44 +0000 Received: from localhost ([127.0.0.1]:44241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSaF-0002VR-Ty for submit@debbugs.gnu.org; Tue, 23 Jan 2024 21:01:44 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSSaD-0002VE-Rn for submit@debbugs.gnu.org; Tue, 23 Jan 2024 21:01:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSSa3-0005HQ-CG for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 21:01:31 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSSa0-0008Df-A5 for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 21:01:31 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSSZy-000A1w-7d for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 03:01:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 03:01:11 +0100 Message-ID: <87bk9bh4m0.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87wms1k6xg.fsf@dataswamp.org> <87plxt2yjx.fsf@neverwas.me> <87ttn5job9.fsf@dataswamp.org> <87r0i9jhp6.fsf@dataswamp.org> <87zfwxxdmn.fsf__6793.81943061657$1705958905$gmane$org@neverwas.me> <87zfwwism6.fsf@dataswamp.org> <87wms0is9o.fsf@dataswamp.org> <87sf2oin9p.fsf@dataswamp.org> <87le8gi3bn.fsf@dataswamp.org> <87bk9bh8jt.fsf__34675.6314321951$1706056632$gmane$org@neverwas.me> <87o7dbh7lu.fsf@dataswamp.org> <87v87jecjk.fsf__16981.322218065$1706060379$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:sPphguj99oPlxdWJvCoO0Q0jmjE= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain tags: patch J.P. wrote: > You can't just use the lambda, but you can lose it entirely > in favor of your predicate. Done. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0005-Removed-lambda-connectivity-check-that-is-now-not-ne.patch >From fa37950454f6c7536c00a1cc7ec6c00a8b4b4b6b Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 06:16:00 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 11:16:00 +0000 Received: from localhost ([127.0.0.1]:44592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSbEQ-0006Bj-4V for submit@debbugs.gnu.org; Wed, 24 Jan 2024 06:15:59 -0500 Received: from lists.gnu.org ([2001:470:142::17]:45428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSbEO-0006BQ-A3 for submit@debbugs.gnu.org; Wed, 24 Jan 2024 06:15:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSbED-0004qs-Jc for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 06:15:33 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSbEB-00068x-Hf for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 06:15:33 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSbE9-0001LN-Lg for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 12:15:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 12:15:20 +0100 Message-ID: <87jznzf0dz.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:EdaWxz1/vd4UAsI/xY5tMIguulw= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) > 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 24 06:56:11 2024 Received: (at submit) by debbugs.gnu.org; 24 Jan 2024 11:56:11 +0000 Received: from localhost ([127.0.0.1]:44614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSbrT-0007gk-Fv for submit@debbugs.gnu.org; Wed, 24 Jan 2024 06:56:11 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSbrS-0007gD-1H for submit@debbugs.gnu.org; Wed, 24 Jan 2024 06:56:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSbrG-00069J-BM for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 06:55:54 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSbrE-0005Co-PM for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 06:55:54 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSbrC-0003kv-Se for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 12:55:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 24 Jan 2024 12:55:40 +0100 Message-ID: <87h6j3eyir.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:BssmRbsKaAoz2woLwNVDru+w0sc= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 19:53:03 2024 Received: (at submit) by debbugs.gnu.org; 5 Feb 2024 00:53:03 +0000 Received: from localhost ([127.0.0.1]:50289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWnEM-00042V-8S for submit@debbugs.gnu.org; Sun, 04 Feb 2024 19:53:03 -0500 Received: from lists.gnu.org ([2001:470:142::17]:54004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWnEI-000421-Ob for submit@debbugs.gnu.org; Sun, 04 Feb 2024 19:53:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWnE1-00054j-6D for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2024 19:52:41 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWnDu-0001Ro-LA for bug-gnu-emacs@gnu.org; Sun, 04 Feb 2024 19:52:40 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rWnDr-000ADo-DA for bug-gnu-emacs@gnu.org; Mon, 05 Feb 2024 01:52:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Mon, 05 Feb 2024 01:52:24 +0100 Message-ID: <87a5of68c7.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:PeYtyTrMMmLFJXiXK8PQkHHBgEw= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0211-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From b006669b078a4cf4aec2ea19de1a954d494ec19f Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 22:45:06 2024 Received: (at 68401) by debbugs.gnu.org; 6 Feb 2024 03:45:06 +0000 Received: from localhost ([127.0.0.1]:53024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXCOP-0005Ln-UB for submit@debbugs.gnu.org; Mon, 05 Feb 2024 22:45:06 -0500 Received: from mail-108-mta75.mxroute.com ([136.175.108.75]:33291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXCON-0005Lf-EL for 68401@debbugs.gnu.org; Mon, 05 Feb 2024 22:45:04 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta75.mxroute.com (ZoneMTA) with ESMTPSA id 18d7c84a91c0000466.002 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 06 Feb 2024 03:44:45 +0000 X-Zone-Loop: 179deb34df1119f6427808f27e5fe11a668cf782a5a8 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AK8SwBVLyuQdDcJkprwtyG6Atit/VS4TPtKEqySIBKU=; b=Ic2/WYbuDC1enl0rPyHrc6knXE J7UYhEm+sPe+oQ7BhFqpiaEOhkis4iID3CFBHvbYAcFe4szdWJ0F7LmMzf/ymVdC+1F1LPsA8quky 8S4yJz6Pg3tsDokRosVsyOEZ6RYlZtBik2iDJYKSGhYdfLjKokk3iYYROWFohpEy/wGnYkOHQM/fn H/IWbgtcqjZ4NNBOsZarQqnypNPC5qYCIt6add8VmrNNLQ8Kn7JMHugChfoIuOZd4/A+hSLCW62wX 5+UgYyzeGN02Pk8arw1xEXnmhV38l29DOP89u2uLWTLjet0XoacQH1joVlThJmSD9L8XmC9kQGUgw aByMP9Dw==; From: "J.P." To: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87a5of68c7.fsf@dataswamp.org> (Emanuel Berg's message of "Mon, 05 Feb 2024 01:52:24 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> Date: Mon, 05 Feb 2024 19:44:36 -0800 Message-ID: <87h6im9ryz.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org, 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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 > 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 20:58:52 2024 Received: (at submit) by debbugs.gnu.org; 11 Feb 2024 01:58:52 +0000 Received: from localhost ([127.0.0.1]:34848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYz7L-0001HS-Lu for submit@debbugs.gnu.org; Sat, 10 Feb 2024 20:58:52 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYz7I-0001Gz-JK for submit@debbugs.gnu.org; Sat, 10 Feb 2024 20:58:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYz6x-0000JB-2U for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 20:58:27 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYz6v-0006FC-73 for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 20:58:26 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rYz6p-0006sx-Rs for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 02:58:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sun, 11 Feb 2024 02:58:11 +0100 Message-ID: <87jznb4v9o.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:rMc77vz/4BNryh5Db3NL03TGHAA= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 21:28:41 2024 Received: (at submit) by debbugs.gnu.org; 11 Feb 2024 02:28:41 +0000 Received: from localhost ([127.0.0.1]:36991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYzaB-0002f1-LN for submit@debbugs.gnu.org; Sat, 10 Feb 2024 21:28:41 -0500 Received: from lists.gnu.org ([2001:470:142::17]:57282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYza9-0002ec-2P for submit@debbugs.gnu.org; Sat, 10 Feb 2024 21:28:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYzZl-0003tB-VF for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 21:28:13 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYzZg-0004Uv-1i for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 21:28:13 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rYzZd-000Ac8-35 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 03:28:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sun, 11 Feb 2024 03:27:57 +0100 Message-ID: <87h6if4tw2.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:qvWXy0b6RWLJqPAzbKTFcfEE1fI= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From c2c2670d66ff691c05fbe0aed380005aa1506345 Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 22:31:32 2024 Received: (at submit) by debbugs.gnu.org; 11 Feb 2024 03:31:32 +0000 Received: from localhost ([127.0.0.1]:41571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ0Z0-0005im-Ps for submit@debbugs.gnu.org; Sat, 10 Feb 2024 22:31:31 -0500 Received: from lists.gnu.org ([2001:470:142::17]:54416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ0Yy-0005iM-7d for submit@debbugs.gnu.org; Sat, 10 Feb 2024 22:31:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZ0YY-0003Rk-HQ for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:31:04 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZ0YU-0007Fe-MV for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:31:02 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rZ0YR-0000sb-QB for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 04:30:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sun, 11 Feb 2024 04:30:47 +0100 Message-ID: <87eddj4qzc.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:hiu9cDS0a1FLr/gg0pJ3USvY1ys= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From c2c2670d66ff691c05fbe0aed380005aa1506345 Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 22:55:20 2024 Received: (at submit) by debbugs.gnu.org; 11 Feb 2024 03:55:21 +0000 Received: from localhost ([127.0.0.1]:42985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ0w3-0006mS-Mx for submit@debbugs.gnu.org; Sat, 10 Feb 2024 22:55:20 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ0u5-0006hx-F0 for submit@debbugs.gnu.org; Sat, 10 Feb 2024 22:53:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZ0tk-0005dP-6W for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:52:56 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZ0th-00021j-4P for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 22:52:55 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rZ0te-0005jL-GZ for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 04:52:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sun, 11 Feb 2024 04:52:37 +0100 Message-ID: <87a5o74pyy.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:RTSbP49gi/JgdPsC/w7tNo41VjY= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0301-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From 737777da67f78a50d50b416b3ebba0e343c907aa Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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. * 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: "[ ]*$" +paragraph-separate: "[ ]*$" 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 13 20:42:37 2024 Received: (at 68401) by debbugs.gnu.org; 14 Feb 2024 01:42:37 +0000 Received: from localhost ([127.0.0.1]:48963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra4IF-0003bI-FN for submit@debbugs.gnu.org; Tue, 13 Feb 2024 20:42:37 -0500 Received: from mail-108-mta110.mxroute.com ([136.175.108.110]:38425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra4IB-0003b6-KG for 68401@debbugs.gnu.org; Tue, 13 Feb 2024 20:42:34 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta110.mxroute.com (ZoneMTA) with ESMTPSA id 18da54751e50000466.002 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 14 Feb 2024 01:42:11 +0000 X-Zone-Loop: b0987953b7e8dcd76831877ab5d3a7872ce729f6e172 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=drDxQGpdAmPhd31TudUNo8r5EjXhfGwzMkkHmtw2Iqo=; b=VX0vMvO9+SpYJXn40/kPw1MDPW Lxz09400rNfF9EmUVnF8N7e7L5W/OPncGg02gm27nyt+ecyHPswFPXzJ1vT2n0aKFwJNy4uaMPxL5 6QKQeCUusscX2814v6+tygAwypfilOoRsUI9MwhQBhz2YJKhUAQPzwIKQkIoLAxhWZVULHmz2EaEm YwWBpaw/EsmBt1jVQ8pg+QnS4WRGa32k/aw+EkgrxYDu8NRGg3C0id+EC5JtqisQuTm6jrsGDrznw JZg/yyPLp/NLzbP3SoDWNs2QpAmo005sA4sb5PaKtrXPvFsbzwVJURrxJrXIBN2oA9bnBipo2hImh CIBC7aYg==; From: "J.P." To: 68401@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87a5o74pyy.fsf@dataswamp.org> (Emanuel Berg's message of "Sun, 11 Feb 2024 04:52:37 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> Date: Tue, 13 Feb 2024 17:42:07 -0800 Message-ID: <87eddfhle8.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 68401 Cc: Emanuel Berg , emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Emanuel Berg 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 > 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=E2=80=99t 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. > > * Changes in ERC 5.6 >=20=20 > +** 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. >=20=20 > *** erc-server-send-ping-timeout: Determines when to consider a connecti= on > -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. >=20=20 > *** 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: "[ ]*$" > +paragraph-separate: "[ ]*$" ^ 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 > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;; >=20=20 > -(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) >=20=20 > +(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. >=20=20 > 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=3D (erc-server-user-host (erc-get-server-user "t= ester")) > "some.host.test.cc")))))) >=20=20 [...] Emanuel Berg 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-5.x-Add-tests-for-ERC-slash-commands-AMSG-GMSG-etc.patch >From e021f3c5e9990776af99bd6938b300bcef101719 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 "* tester 6 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 "* tester 6 all nets") + (funcall expect 10 " 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 " 7 all live nets") + (funcall expect -0.1 "* tester 8 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 7 all live nets") + (funcall expect 10 "* tester 8 all live nets") + (funcall expect 10 " 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 13:22:28 2024 Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:22:28 +0000 Received: from localhost ([127.0.0.1]:37062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblo3-00032d-K3 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:22:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:53956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblRh-0001mW-3S for submit@debbugs.gnu.org; Sun, 18 Feb 2024 12:59:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbD8t-0006ZM-SB for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 00:21:39 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbD8s-0004SX-3j for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 00:21:39 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rbD8p-0000x5-2M for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 06:21:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sat, 17 Feb 2024 06:21:18 +0100 Message-ID: <8734tr4qep.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> <87eddfhle8.fsf__42581.6363118187$1707874989$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:Ya+wjjtFvLNF9C4MexPDgTy3a+4= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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: "[ ]*$" >> +paragraph-separate: "[ ]*$" > ^ > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 13:24:17 2024 Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:24:17 +0000 Received: from localhost ([127.0.0.1]:37334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblpn-0003M4-Lr for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:24:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:53956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblRX-0001mW-5n for submit@debbugs.gnu.org; Sun, 18 Feb 2024 12:59:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbGRM-0004f1-2W for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 03:52:56 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbGRJ-0002jL-30 for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 03:52:55 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rbGRH-0006YX-77 for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 09:52:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Sat, 17 Feb 2024 09:52:43 +0100 Message-ID: <87wmr3321w.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> <87eddfhle8.fsf__42581.6363118187$1707874989$gmane$org@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:0ve8Kh0Jk/AMNW+5te/eo4bcDmI= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain 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: "[ ]*$" >> +paragraph-separate: "[ ]*$" > ^ > 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0368-Make-erc-cmd-AMSG-session-local-add-GMSG-AME-and-GME.patch >From 608cfa6c663b419735cc8dd2e17a31ad389dc6be Mon Sep 17 00:00:00 2001 From: Emanuel Berg 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. * 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 " 1 foonet only") + (funcall expect 10 " bob: Our queen and all")) + (with-current-buffer "#bar" + (funcall expect 10 " 2 barnet only") + (funcall expect 10 " 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 " bob: You have discharged this")) + (with-current-buffer "#bar" + (funcall expect 10 "* tester 4 barnet only") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 5 all nets") + (funcall expect 10 " 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 " 6 all live nets"))) + + (with-current-buffer "#foo" + (funcall expect 10 " 6 all live nets") + (funcall expect 10 " 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 --=-=-= Content-Type: text/plain -- underground experts united https://dataswamp.org/~incal --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 20:12:11 2024 Received: (at 68401) by debbugs.gnu.org; 21 Feb 2024 01:12:11 +0000 Received: from localhost ([127.0.0.1]:47365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcb9f-0002uC-8U for submit@debbugs.gnu.org; Tue, 20 Feb 2024 20:12:11 -0500 Received: from mail-108-mta110.mxroute.com ([136.175.108.110]:34693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcb9Z-0002u0-AG for 68401@debbugs.gnu.org; Tue, 20 Feb 2024 20:12:10 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta110.mxroute.com (ZoneMTA) with ESMTPSA id 18dc937e8700000466.002 for <68401@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 21 Feb 2024 01:11:40 +0000 X-Zone-Loop: ebbcb8b0c2a5a7eb7d1cb1a2e5288b5dc34c3266a18d X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5SDG58DxDRtx8Z2/Rrz65juYzAthIQT8pvCQiSH8ekI=; b=LAWHiAQAPDJMxaY4AoVBxFBcP1 L2wfGE/zOZ9Jvgx3lZTuc2gU37RLAOJc9YtejOYgJz3Z/TQhVhKPGPe18C8SVO4GdNQUuOZNzK340 rkJ5MRc8Q/m94DA5iJPrjr1hts7v6Wc3DM3HYvM5O7dmY6k9INBWuU7uttX/n/MddkmmTHlFJd266 ecXFNTNBZ9kF/WEN5YlwwSHJE755j7E7CfJCFof2j544XiNXHM9rDLTfp7kW4h9j73DHKTEo7YuBn hhydShsvbDGDBRUIx+8jjEog6yWkXkLS+nr2NpxhQqeYfOFM2ri3rvJFPoo9/8qVmRMnScmby6FSz 8ELzFmHw==; From: "J.P." To: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87wmr3321w.fsf@dataswamp.org> (Emanuel Berg's message of "Sat, 17 Feb 2024 09:52:43 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> <87eddfhle8.fsf__42581.6363118187$1707874989$gmane$org@neverwas.me> <87wmr3321w.fsf@dataswamp.org> Date: Tue, 20 Feb 2024 17:11:37 -0800 Message-ID: <87ttm2boza.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 68401 Cc: emacs-erc@gnu.org, 68401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Emanuel Berg 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 20:17:38 2024 Received: (at submit) by debbugs.gnu.org; 21 Feb 2024 01:17:38 +0000 Received: from localhost ([127.0.0.1]:47396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcbEv-00034H-Tx for submit@debbugs.gnu.org; Tue, 20 Feb 2024 20:17:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:44184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcbEt-00034A-W7 for submit@debbugs.gnu.org; Tue, 20 Feb 2024 20:17:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcbEX-0004Hy-Lf for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 20:17:13 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcbEV-0007AW-Tr for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 20:17:13 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rcbES-0003jN-0D for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 02:17:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: bug-gnu-emacs@gnu.org To: bug-gnu-emacs@gnu.org From: Emanuel Berg Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt Followup-To: gmane.emacs.bugs,gmane.emacs.erc.general Date: Wed, 21 Feb 2024 02:16:57 +0100 Message-ID: <87h6i239bq.fsf@dataswamp.org> References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> <87eddfhle8.fsf__42581.6363118187$1707874989$gmane$org@neverwas.me> <87wmr3321w.fsf@dataswamp.org> <87ttm2boza.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:C63GbPMNvWkAp6j8D4FO5nscOdU= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 29 19:19:20 2024 Received: (at 68401-done) by debbugs.gnu.org; 1 Mar 2024 00:19:20 +0000 Received: from localhost ([127.0.0.1]:35692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfqcR-0002Hl-LG for submit@debbugs.gnu.org; Thu, 29 Feb 2024 19:19:19 -0500 Received: from mail-108-mta75.mxroute.com ([136.175.108.75]:37283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfqcP-0002Hd-QC for 68401-done@debbugs.gnu.org; Thu, 29 Feb 2024 19:19:18 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta75.mxroute.com (ZoneMTA) with ESMTPSA id 18df760b6970003bea.002 for <68401-done@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 01 Mar 2024 00:18:47 +0000 X-Zone-Loop: 3224a585543b3f241812e804048a9aa42867a60bdcbd X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UDt/PY+rP/mUMJgeVw8c0Ft2K2jVu0gtXD1TQ2LQWiI=; b=MsxFWyQy0mqyd88uD5yOYXLg8o U/C8aWJR7WJZgL4U01/gtl050LeV8sHFcnSvHhJ0kmWCLGXIQrjPqpi1PAkt1xz+mEucdif9dlvz7 mxauMuDDp6sPYR7CI01TvnKT7mTewI0yMumDR8EjWjI07EY6WaupmkqyNwW2ImR2Sas5cODfmm46S f/RXnBpQ6BwMBy77dFPOYeHViH0OhbTrL1lUzYoZB+IgUdh9y9DqdmhoSY+qmtWpmVIjcePYYLzEA reT4HoW1lsHEGYf3JtyuJ7jkzwU+Vi7lOOLCH5JhYLEdH9lZyNxNPvvNhn/RzVJkmY3mj3WrIRkU5 PxLEuwRw==; From: "J.P." To: 68401-done@debbugs.gnu.org Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt In-Reply-To: <87h6i239bq.fsf@dataswamp.org> (Emanuel Berg's message of "Wed, 21 Feb 2024 02:16:57 +0100") References: <87v87yvnly.fsf@dataswamp.org> <834jfikb4d.fsf@gnu.org> <87mstavias.fsf@dataswamp.org> <87wmseoskl.fsf@dataswamp.org> <87plxyowpg.fsf__13716.8874776521$1705633220$gmane$org@neverwas.me> <87il3ki2tg.fsf@dataswamp.org> <87il3jh8mu.fsf__35629.5012797759$1706056526$gmane$org@neverwas.me> <87il3jh64c.fsf@dataswamp.org> <87jznzf0dz.fsf@dataswamp.org> <87h6j3eyir.fsf@dataswamp.org> <87a5of68c7.fsf@dataswamp.org> <87h6im9ryz.fsf__23711.5776095138$1707191176$gmane$org@neverwas.me> <87h6if4tw2.fsf@dataswamp.org> <87eddj4qzc.fsf@dataswamp.org> <87a5o74pyy.fsf@dataswamp.org> <87eddfhle8.fsf__42581.6363118187$1707874989$gmane$org@neverwas.me> <87wmr3321w.fsf@dataswamp.org> <87ttm2boza.fsf@neverwas.me> <87h6i239bq.fsf@dataswamp.org> Date: Thu, 29 Feb 2024 16:18:43 -0800 Message-ID: <87y1b2x0rg.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68401-done Cc: Emanuel Berg , emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Emanuel Berg 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. From unknown Mon Jun 16 23:43:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Mar 2024 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator