all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
@ 2024-01-12  4:22 Emanuel Berg
  2024-01-12  5:34 ` J.P.
  0 siblings, 1 reply; 7+ messages in thread
From: Emanuel Berg @ 2024-01-12  4:22 UTC (permalink / raw)
  To: 68395; +Cc: emacs-erc

[-- Attachment #1: Type: text/plain, Size: 9513 bytes --]


Patch


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

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
  buffer-read-only: t
  transient-mark-mode: t
  auto-composition-mode: linux
  auto-compression-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:
(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 2152585 504049) (symbols 48 65163 12)
 (strings 32 367483 49126) (string-bytes 1 17762473)
 (vectors 16 137706) (vector-slots 8 3475772 228026)
 (floats 8 968 4004) (intervals 56 35411 7018)
 (buffers 976 263))


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-erc-cmd-GMSG-erc-cmd-AMSG-erc-cmd-GME-and-erc-cmd-AM.patch --]
[-- Type: text/x-diff, Size: 13380 bytes --]

From 2aea60a6ab47431fa7da913a8de8d325d1c62030 Mon Sep 17 00:00:00 2001
From: Emanuel Berg <moasenwood@zoho.eu>
Date: Fri, 12 Jan 2024 05:16:11 +0100
Subject: [PATCH] `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME' and
 `erc-cmd-AME'.

---
 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)))
 
 (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)
+
 (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


[-- Attachment #3: Type: text/plain, Size: 61 bytes --]


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
  2024-01-12  4:22 bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME Emanuel Berg
@ 2024-01-12  5:34 ` J.P.
  2024-01-12  5:52   ` Emanuel Berg
  2024-01-12  6:53   ` Emanuel Berg
  0 siblings, 2 replies; 7+ messages in thread
From: J.P. @ 2024-01-12  5:34 UTC (permalink / raw)
  To: 68395, emacs-erc

Emanuel Berg <incal@dataswamp.org> writes:

> Patch

I think debbugs wants the full "Tags: patch".

> From 2aea60a6ab47431fa7da913a8de8d325d1c62030 Mon Sep 17 00:00:00 2001
> From: Emanuel Berg <moasenwood@zoho.eu>
> 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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
  2024-01-12  5:34 ` J.P.
@ 2024-01-12  5:52   ` Emanuel Berg
  2024-01-12 10:49     ` Emanuel Berg
                       ` (2 more replies)
  2024-01-12  6:53   ` Emanuel Berg
  1 sibling, 3 replies; 7+ messages in thread
From: Emanuel Berg @ 2024-01-12  5:52 UTC (permalink / raw)
  To: 68395

J.P. wrote:

>> Patch
>
> I think debbugs wants the full "Tags: patch".

It is there, what you cite is just what I wrote in the message
instead of a bug report.

> At some point, you'll need to include a commit message.

I added a message, if not 'git commit' wouldn't have worked.

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

Ah, you are using tabs in the source, saving the buffer
changed them to whitespace. This is what happens if you use
tabs! But you are right it wasn't intended for the patch.

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
  2024-01-12  5:34 ` J.P.
  2024-01-12  5:52   ` Emanuel Berg
@ 2024-01-12  6:53   ` Emanuel Berg
  1 sibling, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2024-01-12  6:53 UTC (permalink / raw)
  To: 68395

J.P. wrote:

> 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

Maybe better to redo the whole thing?

Since the patches produced after these steps (both methods)
also include data on the whitespace.

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
  2024-01-12  5:52   ` Emanuel Berg
@ 2024-01-12 10:49     ` Emanuel Berg
  2024-01-19  2:53     ` J.P.
       [not found]     ` <87v87qowym.fsf@neverwas.me>
  2 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2024-01-12 10:49 UTC (permalink / raw)
  To: 68395

I created a better patch without the whitespace changes.

Unfortunately I didn't think of this thread, but submitted it
as a new bug.

But anyway it should arrive anytime now, check it out. I guess
this thread has no value then.

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
  2024-01-12  5:52   ` Emanuel Berg
  2024-01-12 10:49     ` Emanuel Berg
@ 2024-01-19  2:53     ` J.P.
       [not found]     ` <87v87qowym.fsf@neverwas.me>
  2 siblings, 0 replies; 7+ messages in thread
From: J.P. @ 2024-01-19  2:53 UTC (permalink / raw)
  To: 68395; +Cc: Emanuel Berg, emacs-erc

Emanuel Berg <incal@dataswamp.org> writes:

> J.P. wrote:
>
>>> Patch
>>
>> I think debbugs wants the full "Tags: patch".
>
> It is there, what you cite is just what I wrote in the message
> instead of a bug report.

AFAICT, instead of a "pseudo header" [1], your bug report included a
"real header", which Debbugs appears to have ignored.

Before control message (sent by me):

  Id    State        Submitter          Title
  68395 normal       Emanuel Berg       30.0.50; ERC 5.6-git ...

After:

  Id    State        Submitter          Title
  68395 normal,patch Emanuel Berg       30.0.50; ERC 5.6-git ...

I believe you can also trigger detection by prefixing the subject of the
email (not the patch itself) with "[PATCH] ".

[1] https://debbugs.gnu.org/Reporting.html#pseudoheader

>> At some point, you'll need to include a commit message.
>
> I added a message, if not 'git commit' wouldn't have worked.

Git calls the first line of a commit message the "subject," but there's
also the "body," which is often needed to comply with a project's
guidelines. AFAIK, the githooks(5) provided by Emacs only validate the
existence of "* listed/files", but they don't yet check for a nonempty
body. Nor do they enforce the ChangeLog-style format demanded by the
project. As mentioned in CONTRIBUTE, "scaffolding" tools exist to
prepopulate a COMMIT_EDITMSG buffer. And these days folks surely use AI
tools for this purpose as well.

>>> ---
>>>  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?
>
> Ah, you are using tabs in the source,

Not sure who "you" refers to here, but the tabs you see all reside in
areas that predate modern standards regarding white space. Since ERC is
legacy software, "preserving the blame" usually takes precedence over
conveniences, like automated indentation, because research expeditions
are the norm [2], and useful insights provided by mailing list
discussions, change logs, and surviving code comments are sparse.

For these same reasons, "new work," which uses spaces exclusively for
indentation, should also avoid reflowing surrounding code solely for
readability unless the resulting distraction is extreme, in which case
reformatting can be performed after code review is complete. And while
it's true that Git is smart enough to ignore white space when presenting
diffs of blobs it knows about, that doesn't really help for previewing
attachments in message-mode buffers.

[2] https://en.wikipedia.org/wiki/Software_archaeology

> saving the buffer changed them to whitespace.

Perhaps you ought to disable that feature when editing files in the
Emacs tree. Using a .dir-locals-2.el may help.

> J.P. wrote:
>
>> 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
>
> Maybe better to redo the whole thing?
>
> Since the patches produced after these steps (both methods)
> also include data on the whitespace.

FWIW, both methods worked for me in a contrived setting. Should you
someday need to try the second one again, maybe use emacs -Q or
git-add(1) with the "--patch" flag to select only the hunks you intend
to share.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME
       [not found]     ` <87v87qowym.fsf@neverwas.me>
@ 2024-01-22  8:23       ` Emanuel Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2024-01-22  8:23 UTC (permalink / raw)
  To: 68395; +Cc: emacs-erc

J.P. wrote:

>>>> Patch
>>>
>>> I think debbugs wants the full "Tags: patch".
>>
>> It is there, what you cite is just what I wrote in the
>> message instead of a bug report.
>
> AFAICT, instead of a "pseudo header" [1], your bug report
> included a "real header", which Debbugs appears to
> have ignored [...]

Aha, that explains it. Debbugs should maybe look for a real
header as well, but it is always fun to learn of
a new concept, so I can do the pseudo header and "[PATCH]" in
the subject line as well in the future then.

>>> At some point, you'll need to include a commit message.
>>
>> I added a message, if not 'git commit' wouldn't have worked.
>
> As mentioned in CONTRIBUTE, "scaffolding" tools exist to
> prepopulate a COMMIT_EDITMSG buffer. And these days folks
> surely use AI tools for this purpose as well.

Maybe it is easier to just input them manually.

These tools seems to try to automate further then just asking
for data and then putting it together in a conformant way.

This syntax doesn't seem so difficult, maybe it would be even
more easy if it was described in CONTRIBUTE with a focus on
the syntax where the different parts had names instead of an
example, but after looking at it, most people will probably
get the idea.

Here is the example provided.

Deactivate shifted region

Do not silently extend a region that is not highlighted;
this can happen after a shift (Bug#19003).
* doc/emacs/mark.texi (Shift Selection): Document the change.
* lisp/window.el (handle-select-window):
* src/frame.c (Fhandle_switch_frame, Fselected_frame):
Deactivate the mark.

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-22  8:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-12  4:22 bug#68395: 30.0.50; ERC 5.6-git: erc-cmd-GMSG, erc-cmd-AMSG, erc-cmd-GME, erc-cmd-AME Emanuel Berg
2024-01-12  5:34 ` J.P.
2024-01-12  5:52   ` Emanuel Berg
2024-01-12 10:49     ` Emanuel Berg
2024-01-19  2:53     ` J.P.
     [not found]     ` <87v87qowym.fsf@neverwas.me>
2024-01-22  8:23       ` Emanuel Berg
2024-01-12  6:53   ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.