From f82922a9fc9bf5e5255de30d8d1d72797c048e51 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 10 Jun 2024 21:56:02 -0700 Subject: [PATCH] ; Amend some doc strings in ERC * lisp/erc/erc-backend.el (define-erc-response-handler): Mention important distinction between aliases for handlers and hooks, and note expected type for the latter. * lisp/erc/erc.el (erc--define-channel-user-status-compat-getter): Mention that these accessors are not inlined like those generated by `cl-defstruct'. (cherry picked from commit bbac7b9fa398254e64e5ee3e8aca2f59adcfda50) --- lisp/erc/erc-backend.el | 4 ++++ lisp/erc/erc.el | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index e2b7c0b6f48..a4a78c66b02 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1649,6 +1649,10 @@ Would expand to: See also `erc-server-311'.\")) + Note that while all ALIASES share the same handler function, each gets + its own distinct hook variable. The default value of these variables + may be a list or a function. Robust code should handle both. + \(fn (NAME &rest ALIASES) &optional EXTRA-FN-DOC EXTRA-VAR-DOC &rest FN-BODY)" (declare (debug (&define [&name "erc-response-handler@" ;; No `def-edebug-elem-spec' in 27. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 3ccbcd696c5..5a35ee41b7a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -676,10 +676,11 @@ Also remove members from the server table if this was their only buffer." (erc-remove-channel-users))) (defmacro erc--define-channel-user-status-compat-getter (name c d) - "Define a gv getter for historical `erc-channel-user' status slot NAME. -Expect NAME to be a string, C to be its traditionally associated -letter, and D to be its fallback power-of-2 integer for non-ERC -buffers." + "Define accessor with gv getter for historical `erc-channel-user' slot NAME. +Expect NAME to be a string, C to be its traditionally associated letter, +and D to be its fallback power-of-2 integer for non-ERC buffers. Unlike +pre-ERC-5.6 accessors, do not bother generating a compiler macro for +inlining calls to these adapters." `(defun ,(intern (concat "erc-channel-user-" name)) (u) ,(format "Get equivalent of pre-5.6 `%s' slot for `erc-channel-user'." name) -- 2.39.2