emacs/lisp/erc
F. Jason Park cf9728c4be Only perform erc-log-insert-log-on-open setup once
* etc/ERC-NEWS: Add entry for option `erc-log-insert-log-on-open'.
Mention deprecation of `erc-log-setup-logging'.
* lisp/erc/erc-log.el (erc-log-insert-log-on-open): Expand type from
boolean to choice of boolean, predicate, and new function item
`erc-log-new-target-buffer-p'.
(erc-log-mode, erc-log-enable, erc-log-disable): Replace
`erc-log-setup-logging' on `erc-connect-pre-hook' with
`erc-log--insert-log-on-open' at depth 80.  Replace calls to
`erc-log-setup-logging' with ones to `erc-log--setup'.
(erc-log-new-target-buffer-p): New function.  While the name could
perhaps do more to indicate that it's only useful when called from
`erc-open', that's the only place ERC typically sets up new target
buffers.
(erc-log-setup-logging): Deprecate and replace body with adapter that
calls `erc-log--setup' and `erc-log--insert-log-on-open'.
(erc-log--setup): New function whose body is mostly from the
"nondestructive" portion of `erc-log-setup-logging'.  Instead of moving
the `erc-saved-last-position' marker to the old value, expect it not to
have been initialized by `erc-initialize-log-marker' because
`erc-connect-pre-hook' now runs after this code, which is now
incorporated more judiciously into the module's "enable body".
(erc-log--insert-log-on-open): New function whose body is mostly from
the "destructive" portion of the previous incarnation of
`erc-log-setup-logging'.  Unlike the original, if option
`erc-log-insert-log-on-open' is a function, call it to decide whether to
insert a log file atop its buffer.  Also, don't advance the marker
`erc-last-saved-position' to the prompt area, where it can get stuck and
prevent logs from being saved when `erc-log-insert-log-on-open' is
non-nil.  Thanks to Libera user Lionyx for reporting the bug, which has
been around since at least ERC 5.4 and Emacs 28.1.
(erc-log-disable-logging): Remove `erc-save-buffer-in-logs' from
`write-file-functions' to undo its buffer-local addition in what is now
`erc--log-setup'.
* test/lisp/erc/erc-scenarios-log-options.el: New file.  (Bug#79665)
2026-04-30 15:46:42 -07:00
..
ChangeLog.1 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.2 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-autoaway.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-backend.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-button.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-capab.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-common.el Use seq-doseq for iterating over strings in ERC 2026-01-11 05:25:03 -08:00
erc-compat.el Rename 'any' to 'member-if' and deprecate 'cl-member-if' 2026-03-04 14:43:05 +00:00
erc-dcc.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-desktop-notifications.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-ezbounce.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-fill.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-goodies.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-ibuffer.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-identd.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-imenu.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-join.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-lang.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-list.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-log.el Only perform erc-log-insert-log-on-open setup once 2026-04-30 15:46:42 -07:00
erc-match.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-menu.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-netsplit.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-networks.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-nicks.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-notify.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-page.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-pcomplete.el Define variable alias for erc-completion-mode 2026-04-30 15:46:34 -07:00
erc-replace.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-ring.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-sasl.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-services.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-sound.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-speedbar.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-spelling.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-stamp.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-status-sidebar.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-track.el Fix erc-track-faces-normal-list regression 2026-03-23 18:14:57 -07:00
erc-truncate.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc-xdcc.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
erc.el Avoid nested erc-display-message in alert utility 2026-03-23 18:13:28 -07:00