From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 21 15:10:17 2024 Received: (at submit) by debbugs.gnu.org; 21 Dec 2024 20:10:17 +0000 Received: from localhost ([127.0.0.1]:47770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP5nk-0005iE-JD for submit@debbugs.gnu.org; Sat, 21 Dec 2024 15:10:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:56330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP5nh-0005i5-VQ for submit@debbugs.gnu.org; Sat, 21 Dec 2024 15:10:14 -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 1tP5nh-0001xU-LJ for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2024 15:10:13 -0500 Received: from ns.lapseofthought.com ([50.0.39.240] helo=mail.lapseofthought.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tP5nf-0007lJ-Co for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2024 15:10:13 -0500 Received: from awb-mbp-m3.local (unknown [IPv6:2601:646:4200:73a0:d8a7:9834:3c87:e621]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4YFwPS1mDJz3pp4G for ; Sat, 21 Dec 2024 12:10:04 -0800 (PST) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek To: bug-gnu-emacs@gnu.org Subject: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status X-Debbugs-CC: emacs-erc@gnu.org Date: Sat, 21 Dec 2024 12:10:02 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=50.0.39.240; envelope-from=alex@bochannek.com; helo=mail.lapseofthought.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) --=-=-= Content-Type: text/plain This small function is intended as an easy way to mark all channels as "read." This is useful when returning to an ERC session with multiple modified channels that are not displayed in a window. Their status is indicated in the mode line and in the ERC status sidebar, both of which this function clears. If this is a common enough task, it makes sense to bind this function to a key sequence, e.g.: (keymap-global-set "C-c e c" 'erc-modified-channels-clear) Note: I am not familiar with the ERC code base, so if calling the function something else makes more sense (I originally called it `erc-reset-modified-channels') I have no objection to it. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-interactive-function-to-clear-ERC-channels-modif.patch >From 65cbc68d2fcdff8654df53d8d9a0f4c7aeb12529 Mon Sep 17 00:00:00 2001 From: Alex Bochannek Date: Sat, 21 Dec 2024 11:39:08 -0800 Subject: [PATCH] Add interactive function to clear ERC channels' modified status status --- lisp/erc/erc-track.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 97fb7e726bd..8d6f804a42b 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -900,6 +900,13 @@ erc-modified-channels-remove-buffer (when (called-interactively-p 'interactive) (erc-modified-channels-display))) +(defun erc-modified-channels-clear () + "Remove all buffers from `erc-modified-channels-alist'." + (interactive) + (setq erc-modified-channels-alist nil) + (when (called-interactively-p 'interactive) + (erc-modified-channels-display))) + (defun erc-track-find-face (faces) "Return the face to use in the mode line." (declare (obsolete erc-track-select-mode-line-face "28.1")) -- 2.39.5 (Apple Git-154) --=-=-= Content-Type: text/plain -- Alex. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 22 15:24:03 2024 Received: (at 75014) by debbugs.gnu.org; 22 Dec 2024 20:24:03 +0000 Received: from localhost ([127.0.0.1]:52086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPSUc-0007qu-8u for submit@debbugs.gnu.org; Sun, 22 Dec 2024 15:24:02 -0500 Received: from mail-108-mta244.mxroute.com ([136.175.108.244]:38853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPSUZ-0007qb-Cp for 75014@debbugs.gnu.org; Sun, 22 Dec 2024 15:24:00 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta244.mxroute.com (ZoneMTA) with ESMTPSA id 193f00a7528000310e.002 for <75014@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 22 Dec 2024 20:23:57 +0000 X-Zone-Loop: f8b8e6cf4d4358fd94bda84082450bdb13f5fd631c09 X-Originating-IP: [136.175.111.3] 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=/fE4BAOfhyrnIFdHDhOPkX5Yj6U4ofzbb41/jC2zvCE=; b=Ln9eoTU0i6OgT6n6q+ude5quwG 8gE8qBGgOjYK5yRl7eps0s0xgWiCpIHKmior5F60JqbSYsVY/nv0pnT2jGGaIkrcITYletIyn6mYm FtYhlBp9byKSY87dnzAUWrh8UHNibQ8WH5DYnkui1vwNbFdkFDXf+CLZ12no188/UnE/1lfgJsIgQ a3HjA8OSqjCQIV8IdXnESQ1/YgUItVh/gFI/kLNdvmhacxMZBIz/hYDHYvHE4FwHwvAzj+YKpDblB rZsulDd0M/KswdfgakxK66C2+Ek/E9p5SEtG5OCy69mD1psms4xAvOOmjLbm878SuQMBrfRx543ou Qf2yaetw==; From: "J.P." To: Alex Bochannek Subject: Re: bug#75014: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status In-Reply-To: (Alex Bochannek's message of "Sat, 21 Dec 2024 12:10:02 -0800") References: Date: Sun, 22 Dec 2024 12:23:53 -0800 Message-ID: <87jzbr4gbq.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: 75014 Cc: 75014@debbugs.gnu.org, 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 (-) Hi Alex, Alex Bochannek writes: > This small function is intended as an easy way to mark all channels as > "read." This is useful when returning to an ERC session with multiple > modified channels that are not displayed in a window. Their status is > indicated in the mode line and in the ERC status sidebar, both of which > this function clears. Thanks for the patch. It seems quite useful. Administrative note: this change should probably go in ERC 5.7 instead of the upcoming 5.6.1 because, AFAIK, new features in point releases should only address unfinished (and ideally pressing) business from the current release or at least have some tenuous connection to a feature introduced there. That said, this command is pretty basic, so maybe we can squeeze it in without anyone complaining (although we should probably still mention it in etc/ERC-NEWS). > > If this is a common enough task, it makes sense to bind this function to > a key sequence, e.g.: > > (keymap-global-set "C-c e c" 'erc-modified-channels-clear) FTR, I'd rather ERC avoid modifying the global keymap (not to say that's what you were suggesting here). However, if people really need a predefined binding, I suppose we could maybe add something like this to `erc-track-minor-mode-map'. As for the keys themselves, I've been told there's a tacit convention these days to avoid "C-c {alnum}" because such keys are quasi reserved for a user's own config and that we should instead favor "C-c {modifier-sequence}-{alnum}" or a binding outside the "C-c" prefix space. (Not sure how widely followed this practice is, though.) A safer, perhaps more cowardly approach might be to just recommend a binding in the command's doc string. > Note: I am not familiar with the ERC code base, so if calling the > function something else makes more sense (I originally called it > `erc-reset-modified-channels') I have no objection to it. As it happens, ERC hails from a time before prefixing a library's symbols with its provided feature and/or group prefix was widely adopted. For better or worse, we tend to abide by this convention nowadays in new code, even though it may hamper discoverability at times. IOW, we should probably ensure the name begins with "erc-track-". Beyond that, I think it makes sense for related symbols within a library to share a common prefix. But since doing so often affects readability by contravening natural spoken syntax, e.g., "modified-channels-clear" vs. "clear-modified-channels," I tend to reserve such rigid alignment for "internal" symbols (those with two hyphens). I mention this because abandoning the association with `erc-modified-channels-alist' means there's no need to retain "channels" in the name, which may be more faithful to reality, since the command affects mode-line indicators for query and server buffers as well. As for "reset" vs. "clear," I have no real preference, but "clear" maybe sounds more definitive because "reset" might make someone wonder "reset to what"? (Or not.) > From 65cbc68d2fcdff8654df53d8d9a0f4c7aeb12529 Mon Sep 17 00:00:00 2001 > From: Alex Bochannek > Date: Sat, 21 Dec 2024 11:39:08 -0800 > Subject: [PATCH] Add interactive function to clear ERC channels' modified status > status > > --- > lisp/erc/erc-track.el | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el > index 97fb7e726bd..8d6f804a42b 100644 > --- a/lisp/erc/erc-track.el > +++ b/lisp/erc/erc-track.el > @@ -900,6 +900,13 @@ erc-modified-channels-remove-buffer > (when (called-interactively-p 'interactive) > (erc-modified-channels-display))) > > +(defun erc-modified-channels-clear () > + "Remove all buffers from `erc-modified-channels-alist'." Should we also mention that this clears the mode line segment, or maybe that's already obvious enough? > + (interactive) > + (setq erc-modified-channels-alist nil) > + (when (called-interactively-p 'interactive) > + (erc-modified-channels-display))) > + Perhaps we should just remove the conditional `when' construct and run `erc-modified-channels-display' unguarded, the assumption being that users doing this in Lisp code can set `erc-modified-channels-alist' to nil as needed. Otherwise, if keeping the `when', should we heed the scary admonition in the doc string for `called-interactively-p' and accommodate keyboard macros as well, or is there a reason to exclude them? > (defun erc-track-find-face (faces) > "Return the face to use in the mode line." > (declare (obsolete erc-track-select-mode-line-face "28.1")) > -- > 2.39.5 (Apple Git-154) Thanks, J.P. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 27 18:29:45 2024 Received: (at 75014-done) by debbugs.gnu.org; 27 Dec 2024 23:29:45 +0000 Received: from localhost ([127.0.0.1]:47986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRJm5-0006T5-9z for submit@debbugs.gnu.org; Fri, 27 Dec 2024 18:29:45 -0500 Received: from mail-108-mta145.mxroute.com ([136.175.108.145]:41599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRJm3-0006Sx-4P for 75014-done@debbugs.gnu.org; Fri, 27 Dec 2024 18:29:44 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta145.mxroute.com (ZoneMTA) with ESMTPSA id 1940a743f09000310e.002 for <75014-done@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 27 Dec 2024 23:29:38 +0000 X-Zone-Loop: 5bf09efa9f464f44f939d04eb4b27b3f0a078d3f36d9 X-Originating-IP: [136.175.111.3] 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=vei1RbPhiDOtGoJJjXEjcep6aVQzJaje8zJMm7suxfY=; b=FSG2FJEM3xW+ll+hfivr2k3p9/ xCjVO5QacoJDTb9ztcLNg5PRn6ua8qpsgsNwh+gEu+XGzOf1P10quZg07YTUsnfu30odgVdl9BP5l fase+ai6j3vtsnxVEuaf74/Txbc19w0GAvi028KQ4qaVlFHU+YBNb8KCrDQN2Lzchlm0Xh23KJbVs qUEvGS6PlwVGDYDQo6RuKowR/JzbY46/NmGEEjMnnBPqe0xkwS5MRLlIJBZs7lv2xFaNh2gl4LTxT wlaEV7sgypcEuuZm5TzQxg8oPucpnYHPK5DzPCA4W4UE1BilnlHbevsPGFMLIIh9sMVxtqNT98WM6 oTNs1uIA==; From: "J.P." To: Alex Bochannek Subject: Re: bug#75014: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status In-Reply-To: <87jzbr4gbq.fsf@neverwas.me> (J. P.'s message of "Sun, 22 Dec 2024 12:23:53 -0800") References: <87jzbr4gbq.fsf@neverwas.me> Date: Fri, 27 Dec 2024 15:29:33 -0800 Message-ID: <87ttao3dsy.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: 75014-done Cc: 75014-done@debbugs.gnu.org, 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 (-) I installed a slightly altered version of this on master as https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=63cc335a Thanks and closing. P.S. Feel free to reopen if the alterations seem unwise or unfair. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 00:02:36 2025 Received: (at 75014-done) by debbugs.gnu.org; 7 Jan 2025 05:02:36 +0000 Received: from localhost ([127.0.0.1]:41421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tV1jc-000817-9y for submit@debbugs.gnu.org; Tue, 07 Jan 2025 00:02:36 -0500 Received: from ns.lapseofthought.com ([50.0.39.240]:5434 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tV1jW-00080p-84 for 75014-done@debbugs.gnu.org; Tue, 07 Jan 2025 00:02:30 -0500 Received: from awb-mbp-m3.local (unknown [IPv6:2601:646:4200:73a0:70d7:c3b6:96f:fee7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4YRzSG3tBXz3pvW2; Mon, 6 Jan 2025 21:02:22 -0800 (PST) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com From: Alex Bochannek To: "J.P." Subject: Re: bug#75014: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status In-Reply-To: <87ttao3dsy.fsf@neverwas.me> (J. P.'s message of "Fri, 27 Dec 2024 15:29:33 -0800") References: <87jzbr4gbq.fsf@neverwas.me> <87ttao3dsy.fsf@neverwas.me> Date: Mon, 06 Jan 2025 21:02:21 -0800 Message-ID: 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: 75014-done Cc: 75014-done@debbugs.gnu.org, 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 (-) J.P., Thanks for adapting and installing this change. Thank you also for your detailed explanations on conventions for keymaps and function naming. I agree that it is probably not necessary to check for interactive use. This all made perfect sense and I had been meaning to respond to it, but the holidays go in the way. Thank you! "J.P." writes: > I installed a slightly altered version of this on master as > > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=63cc335a > > Thanks and closing. > > P.S. Feel free to reopen if the alterations seem unwise or unfair. -- Alex. From unknown Wed Jun 18 23:13:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Feb 2025 12:24:07 +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