From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME Date: Thu, 11 Jan 2024 21:34:15 -0800 Message-ID: <871qanp12g.fsf__35629.0631972783$1705037744$gmane$org@neverwas.me> References: <87h6jjw58t.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5064"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 68395@debbugs.gnu.org, emacs-erc@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 12 06:35:36 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rOACd-00016e-0s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Jan 2024 06:35:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOACB-0000VC-3v; Fri, 12 Jan 2024 00:35:07 -0500 Original-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 1rOAC9-0000Tz-4j for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 00:35:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOAC8-0004OO-8j for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 00:35:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOAC5-0004Rk-PF for bug-gnu-emacs@gnu.org; Fri, 12 Jan 2024 00:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jan 2024 05:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68395 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68395-submit@debbugs.gnu.org id=B68395.170503766717037 (code B ref 68395); Fri, 12 Jan 2024 05:35:01 +0000 Original-Received: (at 68395) by debbugs.gnu.org; 12 Jan 2024 05:34:27 +0000 Original-Received: from localhost ([127.0.0.1]:34602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOABW-0004Qi-OX for submit@debbugs.gnu.org; Fri, 12 Jan 2024 00:34:27 -0500 Original-Received: from mail-108-mta59.mxroute.com ([136.175.108.59]:44945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOABR-0004QW-1o for 68395@debbugs.gnu.org; Fri, 12 Jan 2024 00:34:24 -0500 Original-Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta59.mxroute.com (ZoneMTA) with ESMTPSA id 18cfc29fd450003727.001 for <68395@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 12 Jan 2024 05:34:19 +0000 X-Zone-Loop: ea14847403c411fa9239d99856b81145620cad2aac43 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: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KoiXJPGQHHXp9RZOmoI9XclMVCX1+DaF4fmco2gGCG8=; b=QGawe7QSILG/LnPM9tvYVvgloq zpCQcLNAVP+rmcmxOeiI9T+tq6FRz9eumGUSUL0w9dyrVwjmtTDrlWTWsJzHvp6RpNvXgO0fFeW1I XmfAmhQhJRg1+HvO86mXuR6sJAlQoJ6eyye4kqufT6pd5YEAorgOxU61E0fEYl6J2EjBHpYxIeFMu 4ld4aDzDS6j8OonnfoupTtES0fvkQ4XGkdpzEO/n3ZG36/MoVgPoFh4VqpZARnB0zYKJS+mWIqkXE 8hyhxWccrasjebDvpgTRcIxRiX/LPyLmjk47O17lHqClgU+kG3HFVCcq04qQGBOj2jNYgq97s731i ENGU6/Ow==; In-Reply-To: <87h6jjw58t.fsf@dataswamp.org> (Emanuel Berg's message of "Fri, 12 Jan 2024 05:22:10 +0100") X-Authenticated-Id: masked@neverwas.me X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277987 Archived-At: Emanuel Berg writes: > Patch I think debbugs wants the full "Tags: patch". > From 2aea60a6ab47431fa7da913a8de8d325d1c62030 Mon Sep 17 00:00:00 2001 > From: Emanuel Berg > Date: Fri, 12 Jan 2024 05:16:11 +0100 > Subject: [PATCH] `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME' and > `erc-cmd-AME'. At some point, you'll need to include a commit message. Please see "** Commit messages" in CONTRIBUTE. > --- > lisp/erc/erc.el | 156 ++++++++++++++++++++++++++++-------------------- > 1 file changed, 90 insertions(+), 66 deletions(-) > > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 478683a77f5..12078f6970d 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -2003,10 +2003,10 @@ erc-get-buffer > (defun erc--buffer-p (buf predicate proc) > (with-current-buffer buf > (and (derived-mode-p 'erc-mode) > - (or (not proc) > - (eq proc erc-server-process)) > - (funcall predicate) > - buf))) > + (or (not proc) > + (eq proc erc-server-process)) > + (funcall predicate) > + buf))) I haven't looked at the proposed commands yet, but can you remove all these hopefully inadvertent white space changes in the meantime, please? Both vc and Magit should have tools for helping with this. Assuming "[PATCH] `erc-cmd-GMSG' ..." sits on HEAD, you'd do something like this in manual Git: 1. $ git reset --patch @^ 2. Mark all offending hunks as "y" in the interactive menu 3. $ git restore '*' 4. $ git commit --amend 5. Provide a commit message that accords with CONTRIBUTE Or, alternatively: 1. $ git revert @ 2. Reinstate only the intended changes, which I think I've found below 3. $ git add -A 4. $ git commit --amend 5. Replace generated message > (defun erc-buffer-filter (predicate &optional proc) > "Return a list of `erc-mode' buffers matching certain criteria. > @@ -2021,7 +2021,7 @@ erc-buffer-filter > nil > (mapcar (lambda (buf) > (when (buffer-live-p buf) > - (erc--buffer-p buf predicate proc))) > + (erc--buffer-p buf predicate proc))) > (buffer-list))))) > > (defalias 'erc-buffer-do 'erc-buffer-filter > @@ -2042,14 +2042,14 @@ erc-buffer-list > (define-obsolete-function-alias 'erc-iswitchb #'erc-switch-to-buffer "25.1") > (defun erc--switch-to-buffer (&optional arg) > (read-buffer "Switch to ERC buffer: " > - (when (boundp 'erc-modified-channels-alist) > - (buffer-name (caar (last erc-modified-channels-alist)))) > - t > - ;; Only allow ERC buffers in the same session. > - (let ((proc (unless arg erc-server-process))) > - (lambda (bufname) > - (let ((buf (if (consp bufname) > - (cdr bufname) (get-buffer bufname)))) > + (when (boundp 'erc-modified-channels-alist) > + (buffer-name (caar (last erc-modified-channels-alist)))) > + t > + ;; Only allow ERC buffers in the same session. > + (let ((proc (unless arg erc-server-process))) > + (lambda (bufname) > + (let ((buf (if (consp bufname) > + (cdr bufname) (get-buffer bufname)))) > (and buf (erc--buffer-p buf (lambda () t) proc))))))) > (defun erc-switch-to-buffer (&optional arg) > "Prompt for an ERC buffer to switch to. > @@ -2581,7 +2581,7 @@ erc-initialize-log-marker > (unless (markerp erc-last-saved-position) > (setq erc-last-saved-position (make-marker)) > (move-marker erc-last-saved-position > - (1- (marker-position erc-insert-marker)))))) > + (1- (marker-position erc-insert-marker)))))) > > ;; interactive startup > > @@ -3590,7 +3590,7 @@ erc-display-message-highlight > (erc-put-text-property > 0 (length string) > 'font-lock-face (or (intern-soft > - (concat "erc-" (symbol-name type) "-face")) > + (concat "erc-" (symbol-name type) "-face")) > 'erc-default-face) > string) > string))) > @@ -3667,8 +3667,8 @@ erc-lurker-cleanup > (maphash > (lambda (nick last-PRIVMSG-time) > (when > - (time-less-p erc-lurker-threshold-time > - (time-since last-PRIVMSG-time)) > + (time-less-p erc-lurker-threshold-time > + (time-since last-PRIVMSG-time)) > (remhash nick hash))) > hash) > (if (zerop (hash-table-count hash)) > @@ -3735,8 +3735,8 @@ erc-lurker-p > (gethash (erc-lurker-maybe-trim nick) > (gethash server erc-lurker-state (make-hash-table))))) > (or (null last-PRIVMSG-time) > - (time-less-p erc-lurker-threshold-time > - (time-since last-PRIVMSG-time))))) > + (time-less-p erc-lurker-threshold-time > + (time-since last-PRIVMSG-time))))) > > (defcustom erc-common-server-suffixes > '(("openprojects.net\\'" . "OPN") > @@ -3760,7 +3760,7 @@ erc-canonicalize-server-name > > (defun erc-add-targets (scope target-list) > (let ((targets > - (mapcar (lambda (targets) (member scope targets)) target-list))) > + (mapcar (lambda (targets) (member scope targets)) target-list))) > (cdr (apply #'append (delete nil targets))))) > > (defun erc-hide-current-message-p (parsed) > @@ -3776,16 +3776,16 @@ erc-hide-current-message-p > (sender (car (erc-parse-user (erc-response.sender parsed)))) > (channel (car (erc-response.command-args parsed))) > (network (or (and (erc-network) (erc-network-name)) > - (erc-shorten-server-name > - (or erc-server-announced-name > - erc-session-server)))) > - (current-hide-list > - (when erc-network-hide-list > - (erc-add-targets network erc-network-hide-list))) > - (current-hide-list > - (append current-hide-list > - (when erc-channel-hide-list > - (erc-add-targets channel erc-channel-hide-list))))) > + (erc-shorten-server-name > + (or erc-server-announced-name > + erc-session-server)))) > + (current-hide-list > + (when erc-network-hide-list > + (erc-add-targets network erc-network-hide-list))) > + (current-hide-list > + (append current-hide-list > + (when erc-channel-hide-list > + (erc-add-targets channel erc-channel-hide-list))))) > (or (member command erc-hide-list) > (member command current-hide-list) > (and (member command erc-lurker-hide-list) (erc-lurker-p sender))))) > @@ -3871,9 +3871,9 @@ erc-display-message > (erc--route-insertion string buffer) > (unless (erc-hide-current-message-p parsed) > (erc-put-text-property 0 (length string) 'erc-parsed parsed string) > - (when (erc-response.tags parsed) > - (erc-put-text-property 0 (length string) 'tags (erc-response.tags parsed) > - string)) > + (when (erc-response.tags parsed) > + (erc-put-text-property 0 (length string) 'tags (erc-response.tags parsed) > + string)) > (erc--route-insertion string buffer))))) > > (defun erc-message-type-member (position list) > @@ -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) I'm guessing this hunk is the only one you intended to add? At first glance, it appears to be the right location for such commands. Anyway, please resubit once the white space issues have been resolved. Thanks. > + > (defun erc-cmd-SAY (line) > "Send LINE to the current query or channel as a message, not a command. > > @@ -5213,8 +5237,8 @@ erc-cmd-TOPIC > (topic (match-string 2 topic))) > ;; Ignore all-whitespace topics. > (unless (equal (string-trim topic) "") > - (erc-log (format "cmd: TOPIC [%s]: %s" ch topic)) > - (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))) > + (erc-log (format "cmd: TOPIC [%s]: %s" ch topic)) > + (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))) > t) > ;; /topic #channel > ((string-match "^\\s-*\\([&#+!]\\S-+\\)" topic) > @@ -5493,7 +5517,7 @@ erc-input-message > (read-map minibuffer-local-map)) > (insert (read-from-minibuffer "Message: " > (string last-command-event) > - read-map)) > + read-map)) > (erc-send-current-line))) > > (defvar erc-action-history-list () > @@ -5776,11 +5800,11 @@ erc-wash-quit-reason > (or (when (string-match (concat "^\\(Read error\\) to " > nick "\\[" host "\\]: " > "\\(.+\\)$") > - reason) > + reason) > (concat (match-string 1 reason) ": " (match-string 2 reason))) > (when (string-match (concat "^\\(Ping timeout\\) for " > nick "\\[" host "\\]$") > - reason) > + reason) > (match-string 1 reason)) > reason)) > > @@ -5820,7 +5844,7 @@ erc-nickname-in-use > ;; server's setting if we haven't > ;; established a connection yet > (- 9 (length erc-nick-uniquifier)))) > - erc-nick-uniquifier))) > + erc-nick-uniquifier))) > (erc--nickname-in-use-make-request nick newnick) > (erc-display-error-notice > nil > @@ -6801,30 +6825,30 @@ erc-channel-receive-names > (adm-ch (cdr (assq ?a prefix))) > (own-ch (cdr (assq ?q prefix))) > (names (delete "" (split-string names-string))) > - name op voice halfop admin owner) > + name op voice halfop admin owner) > (let ((erc-channel-members-changed-hook nil)) > (dolist (item names) > (let ((updatep t) > - (ch (aref item 0))) > + (ch (aref item 0))) > (setq name item op 'off voice 'off halfop 'off admin 'off owner 'off) > (if (rassq ch prefix) > (if (= (length item) 1) > - (setq updatep nil) > - (setq name (substring item 1)) > - (setf (pcase ch > - ((pred (eq voice-ch)) voice) > - ((pred (eq hop-ch)) halfop) > - ((pred (eq op-ch)) op) > - ((pred (eq adm-ch)) admin) > - ((pred (eq own-ch)) owner) > - (_ (message "Unknown prefix char `%S'" ch) voice)) > - 'on))) > + (setq updatep nil) > + (setq name (substring item 1)) > + (setf (pcase ch > + ((pred (eq voice-ch)) voice) > + ((pred (eq hop-ch)) halfop) > + ((pred (eq op-ch)) op) > + ((pred (eq adm-ch)) admin) > + ((pred (eq own-ch)) owner) > + (_ (message "Unknown prefix char `%S'" ch) voice)) > + 'on))) > (when updatep > - ;; If we didn't issue the NAMES request (consider two clients > - ;; talking to an IRC proxy), `erc-channel-begin-receiving-names' > - ;; will not have been called, so we have to do it here. > - (unless erc-channel-new-member-names > - (erc-channel-begin-receiving-names)) > + ;; If we didn't issue the NAMES request (consider two clients > + ;; talking to an IRC proxy), `erc-channel-begin-receiving-names' > + ;; will not have been called, so we have to do it here. > + (unless erc-channel-new-member-names > + (erc-channel-begin-receiving-names)) > (puthash (erc-downcase name) t > erc-channel-new-member-names) > (erc-update-current-channel-member > @@ -7767,7 +7791,7 @@ erc-send-current-line > (let ((now (current-time))) > (if (or (not erc-accidental-paste-threshold-seconds) > (time-less-p erc-accidental-paste-threshold-seconds > - (time-subtract now erc-last-input-time))) > + (time-subtract now erc-last-input-time))) > (save-restriction > ;; If there's an abbrev at the end of the line, expand it. > (when (and abbrev-mode > @@ -7909,8 +7933,8 @@ erc-send-input > (defvar str)) > (let ((str input) > (erc-insert-this t) > - (erc-send-this t) > - state) > + (erc-send-this t) > + state) > ;; The calling convention of `erc-send-pre-hook' is that it > ;; should change the dynamic variable `str' or set > ;; `erc-send-this' to nil. This has now been deprecated: > @@ -7918,8 +7942,8 @@ erc-send-input > ;; allow both changing and suppressing the string. > (run-hook-with-args 'erc-send-pre-hook input) > (setq state (make-erc-input :string str ;May be != from `input' now! > - :insertp erc-insert-this > - :sendp erc-send-this)) > + :insertp erc-insert-this > + :sendp erc-send-this)) > (run-hook-with-args 'erc-pre-send-functions state) > (when (and (erc-input-sendp state) > erc-send-this) > -- > 2.39.2