detection overly complex and produced uneven results when toggling
stamp visibility.
+*** Invisible message insertions not automatically made 'intangible'.
+Previously, when 'erc-display-message' and friends spotted the
+'invisible' text property with a value of t anywhere in text to be
+inserted, it would apply that property to the entire message, along
+with a t-valued 'intangible' property. Beginning with ERC 5.6, users
+expecting this behavior will have to instead perform the treatment
+themselves. To help with the transition, a temporary escape hatch has
+been made available to regain this behavior, but its existence is only
+guaranteed for this one minor version alone. See source code in the
+vicinity of 'erc-insert-line' for more.
+
*** Date stamps have become independent messages.
ERC now inserts "date stamps" generated from the option
'erc-timestamp-format-left' as separate, standalone messages. This
(unless (eq end erc-insert-marker)
(set-marker end nil)))
+(defvar erc--insert-invisible-as-intangible-p nil
+ "When non-nil, ensure certain invisible messages are also intangible.
+That is, single out any message inserted via `erc-insert-line'
+that lacks a trailing newline but has a t-valued `invisible'
+property anywhere along its length, and ensure it's both
+`invisible' t and `intangible' t throughout. Note that this is
+merely an escape hatch for accessing aberrant pre-5.6 behavior
+that ERC considers a bug because it applies a practice described
+as obsolete in the manual, and it does so heavy-handedly. That
+the old behavior only acted when the input lacked a trailing
+newline was likely accidental but is ultimately incidental. See
+info node `(elisp) Special Properties' for specifics. Beware
+that this flag and the behavior it restores may disappear at any
+time, so if you need them, please let ERC know with \\[erc-bug].")
+
(defvar erc--insert-line-function nil
"When non-nil, an alterntive to `insert' for inserting messages.")
modification hooks)."
(when string
(with-current-buffer (or buffer (process-buffer erc-server-process))
- (let ((insert-position (marker-position erc-insert-marker)))
- (let ((string string) ;; FIXME! Can this be removed?
- (buffer-undo-list t)
+ (let (insert-position)
+ ;; Initialize ^ below to thwart rogue `erc-insert-pre-hook'
+ ;; members that dare to modify the buffer's length.
+ (let ((buffer-undo-list t)
(inhibit-read-only t))
- (unless (string-match "\n$" string)
+ (unless (string-suffix-p "\n" string)
(setq string (concat string "\n"))
- (when (erc-string-invisible-p string)
+ (when (and erc--insert-invisible-as-intangible-p
+ (erc-string-invisible-p string))
(erc-put-text-properties 0 (length string)
'(invisible intangible) string)))
(erc-log (concat "erc-display-message: " string