all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Bochannek <alex@bochannek.com>
To: 75014@debbugs.gnu.org
Cc: emacs-erc@gnu.org
Subject: bug#75014: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status
Date: Sat, 21 Dec 2024 12:10:02 -0800	[thread overview]
Message-ID: <m2h66whk6d.fsf@bochannek.com> (raw)

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

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-interactive-function-to-clear-ERC-channels-modif.patch --]
[-- Type: text/x-patch, Size: 1031 bytes --]

From 65cbc68d2fcdff8654df53d8d9a0f4c7aeb12529 Mon Sep 17 00:00:00 2001
From: Alex Bochannek <alex@bochannek.com>
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)


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

-- 
Alex.

             reply	other threads:[~2024-12-21 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-21 20:10 Alex Bochannek [this message]
2024-12-22 20:23 ` bug#75014: [PATCH] 30.0.92; ERC 5.6.0.30.1: Add interactive function to clear ERC channels' modified status J.P.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h66whk6d.fsf@bochannek.com \
    --to=alex@bochannek.com \
    --cc=75014@debbugs.gnu.org \
    --cc=emacs-erc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.