diff options
| author | F. Jason Park | 2023-11-26 18:24:48 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-12-17 20:17:55 -0800 |
| commit | 49bfea4386fd8d1a0885ebfd1f81cc8fee6ef136 (patch) | |
| tree | 5d3905a4ac4ea43b10d5aebc438f79a2c9f6515c /test | |
| parent | 236a416be76cbb0b79ad46c06652f6cbf8788fcb (diff) | |
| download | emacs-49bfea4386fd8d1a0885ebfd1f81cc8fee6ef136.tar.gz emacs-49bfea4386fd8d1a0885ebfd1f81cc8fee6ef136.zip | |
Use templates for formatting chat messages in ERC
* doc/misc/erc.texi: Replace option `erc-format-nick-function' with
`erc-show-speaker-membership-status'.
* etc/ERC-NEWS: Mention shift to template-based speaker formatting.
Also mention in-buffer STATUSMSG support and various name changes and
new formatting-related options.
* lisp/erc/erc-backend.el (erc-format-privmessage): Remove forward
declaration.
(erc--determine-speaker-message-format-args): Add forward declaration.
(erc--statusmsg-target): New utility function for detecting whether
the current target is status-prefixed.
(erc-current-message-catalog): Move here from lisp/erc/erc.el.
(erc--message-speaker-catalog): New variable.
(erc--speaker-status-prefix-wanted-p): New variable specifically for
the function `erc-format-@nick' to signal it wants status-prefixes
prepended to the displayed nick.
(erc-server-PRIVMSG): Initialize `let'-bound value of
`erc--msg-prop-overrides' to a dummy `erc--tmp' property with a null
value that `erc-display-message' will "strip" before calling its
hooks. Move away from the rather blunt symbol `msg' as a useful value
for `erc--msg'. Instead, allow `erc-display-message' to assign the
most appropriate value based on context. Also, bind the variable
`erc-current-message-catalog' to whatever the buffer's
`erc--message-speaker-catalog' happens to be. Future internal modules
can set this to alternative catalogs as needed. Additionally, detect
STATUSMSG prefixes on targets and inform the formatting logic of the
verdict. Lastly, and most importantly, use the function
`erc--determine-speaker-message-format-args' instead of
`erc-format-privmessage' for message formatting. Pass along the
returned "catalog key" and spec parameters to `erc-display-message'.
However, for NOTICEs, continue to render the string, as before, for
the two "echo notice" hooks.
* lisp/erc/erc-common.el (erc--ctcp-response): New "subsclass" of
`erc-response' for smuggling extra information to CTCP query handlers
in a mostly backwards-compatible way. The same approach could be
taken with the "echo notice" hooks mentioned above.
* lisp/erc/erc-dcc.el (erc-dcc-chat-filter): Add `erc--spkr' and
`erc--speaker' properties even though these chat buffers are not
`erc-mode' buffers.
* lisp/erc/erc-fill.el (erc-fill--wrap-last-msg,
erc-fill--wrap-max-lull): Add doc strings.
(erc-fill--wrap-continued-message-p): Rework to look for `erc--spkr'-
`erc--msg' combinations as indicators of speaker continuity.
(erc-fill--wrap-rejigger-region): Remove reference to the no longer
relevant `erc-stamp-type'. Instead, use the `erc--msg' property
combined with the `erc-timestamp' field to detect date stamps because
all are currently left-sided.
* lisp/erc/erc-stamp.el (erc-stamp--propertize-left-date-stamp): Don't
add superfluous `erc-stamp-type' property.
* lisp/erc/erc.el (erc--msg-props): Revise purpose and meaning of
`erc--msg' by removing possible value `msg', which was previously
meant to indicate that a message had a "speaker". Instead, rely on
the separate `erc--spkr' property to convey this information, with
`erc--msg' now expressing a "type" or "role".
(erc--use-language-catalog-for-ctcp-action-p): New variable, a
compatibility switch to help transition from the `ACTION' entry of the
language catalog to the `ctcp-action' family of entries in the new
`-speaker' catalog.
(erc--ensure-spkr-prop): Update to include any passed-in environmental
overrides.
(erc--send-action-display): Restore pre-5.6 behavior when
compatibility flag enabled. Otherwise, use new `-speaker' catalog for
formatting inserted message.
(erc--send-message-external): Overhaul to behave more faithfully in
mimicking a line submitted at the prompt of the current target buffer.
(erc--own-property-names): Remove `erc-stamp-type'.
(erc-ensure-target-buffer-on-privmsg): Add new choice variant for old
default behavior and change meaning of default to mean "except for
STATUSMSGs". This option is newly revived for ERC 5.6.
(erc--message-speaker-statusmsg, erc--message-speaker-statusmsg-input,
erc--message-speaker-input, erc--message-speaker-input-chan-privmsg,
erc--message-speaker-input-chan-notice,
erc--message-speaker-input-query-privmsg,
erc--message-speaker-input-query-notice,
erc--message-speaker-chan-privmsg, erc--message-speaker-query-privmsg,
erc--message-speaker-chan-notice, erc--message-speaker-query-notice,
erc--message-speaker-ctcp-action,
erc--message-speaker-ctcp-action-input,
erc--message-speaker-ctcp-action-statusmsg,
erc--message-speaker-ctcp-action-statusmsg-input): New variables for
new `speaker' format-template catalog.
(erc--speakerize-nick): New helper function.
(erc--determine-speaker-message-format-args): New function to find the
appropriate format key from various contextual parameters. Could
become the default of a function-valued variable for internal use.
(erc-show-speaker-membership-status): New option.
(erc-format-nick-function, erc-speaker-from-channel-member-function):
Declare former as an obsolete alias for the latter, and redefine
purpose slightly.
(erc-format-nick-function, erc-determine-speaker-from-user): Rename
former to latter and obsolete the old name.
(erc-format-nick, erc-determine-speaker-from-user): Rename former to
latter and obsolete old name.
(erc-format-@nick): Deprecate and adapt for use with new
template-based formatting paradigm.
(erc-format-my-nick): Move `erc-speaker' text prop toward head of
list, meaning it will end up beneath `font-lock-face' in the final
output.
(erc--format-speaker-input-message): New function to replace
`erc-format-my-nick' in-tree.
(erc-process-ctcp-query): Don't bind `erc--msg' to `msg'. Instead,
rely on `erc-display-message' to set it to the current template key.
(erc-ctcp-query-ACTION): Prefer using formatting template, but attempt
to simulate pre-5.6 behavior when compatibility flag enabled.
(erc-display-msg): Use `erc--format-speaker-input-message' instead of
`erc-format-my-nick'. Ignore `erc--msg-prop-overrides' with null
values.
(erc-current-message-catalog): Move to erc-backend.el.
* test/lisp/erc/erc-scenarios-base-statusmsg.el: New file.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--left/display-margin-mode): Expect format catalog
key instead of unhelpful `msg' as value of `erc--msg' prop.
* test/lisp/erc/erc-tests.el (erc-message): Render format template in
mock function and expect string in assertions.
(erc-tests--format-privmessage): New function, a helper for the
following test.
(erc-format-privmessage, erc--determine-speaker-message-format-args):
Rename former to latter and suppress deprecation warning.
(erc--determine-speaker-message-format-args/queries,
erc--determine-speaker-message-format-args/queries-as-channel): New
tests.
(erc-tests--format-my-nick): New helper function for the following
test.
(erc--format-speaker-input-message): New test.
* test/lisp/erc/resources/base/display-message/statusmsg.eld: New
file. (Bug#67677)
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld:
; Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
; Update.
Diffstat (limited to 'test')
7 files changed, 353 insertions, 36 deletions
diff --git a/test/lisp/erc/erc-scenarios-base-statusmsg.el b/test/lisp/erc/erc-scenarios-base-statusmsg.el new file mode 100644 index 00000000000..80582e0cf80 --- /dev/null +++ b/test/lisp/erc/erc-scenarios-base-statusmsg.el | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | ;;; erc-scenarios-base-statusmsg.el --- statusmsg tests -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2023 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Code: | ||
| 21 | |||
| 22 | (require 'ert-x) | ||
| 23 | (eval-and-compile | ||
| 24 | (let ((load-path (cons (ert-resource-directory) load-path))) | ||
| 25 | (require 'erc-scenarios-common))) | ||
| 26 | |||
| 27 | (ert-deftest erc-scenarios-base-statusmsg () | ||
| 28 | |||
| 29 | (erc-scenarios-common-with-cleanup | ||
| 30 | ((erc-scenarios-common-dialog "base/display-message") | ||
| 31 | (dumb-server (erc-d-run "localhost" t 'statusmsg)) | ||
| 32 | (erc-autojoin-channels-alist '((foonet "#mine"))) | ||
| 33 | (erc-modules (cons 'fill-wrap erc-modules)) | ||
| 34 | (port (process-contact dumb-server :service)) | ||
| 35 | (erc-show-speaker-membership-status nil) | ||
| 36 | (erc-server-flood-penalty 0.1) | ||
| 37 | (expect (erc-d-t-make-expecter))) | ||
| 38 | |||
| 39 | (ert-info ("Connect") | ||
| 40 | (with-current-buffer (erc :server "127.0.0.1" | ||
| 41 | :port port | ||
| 42 | :nick "tester" | ||
| 43 | :user "tester" | ||
| 44 | :full-name "tester") | ||
| 45 | (funcall expect 5 "This server is in debug mode"))) | ||
| 46 | |||
| 47 | (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#mine")) | ||
| 48 | |||
| 49 | (ert-info ("Receive status messages unprefixed") | ||
| 50 | (funcall expect 5 "+dummy") | ||
| 51 | (funcall expect 5 "(dummy+) hello") | ||
| 52 | (should (eq 'statusmsg (erc--get-inserted-msg-prop 'erc--msg))) | ||
| 53 | (should (equal "dummy" (erc--get-inserted-msg-prop 'erc--spkr))) | ||
| 54 | (should (eq (get-text-property (1- (point)) 'font-lock-face) | ||
| 55 | 'erc-default-face)) | ||
| 56 | (funcall expect 5 "(dummy+) there") | ||
| 57 | (should (equal "" (get-text-property (pos-bol) 'display))) | ||
| 58 | |||
| 59 | ;; CTCP ACTION | ||
| 60 | (funcall expect 5 "* (dummy+) sad") | ||
| 61 | (should (eq 'ctcp-action-statusmsg | ||
| 62 | (erc--get-inserted-msg-prop 'erc--msg))) | ||
| 63 | (should (eq (get-text-property (1- (point)) 'font-lock-face) | ||
| 64 | 'erc-action-face)) | ||
| 65 | (funcall expect 5 "* (dummy+) glad") | ||
| 66 | (should (equal "" (get-text-property (pos-bol) 'display)))) | ||
| 67 | |||
| 68 | (ert-info ("Send status messages") | ||
| 69 | ;; We don't have `echo-message' yet, so ERC doesn't currently | ||
| 70 | ;; insert commands like "/msg +#mine foo". | ||
| 71 | (let ((erc-default-recipients '("+#mine"))) | ||
| 72 | (erc-send-message "howdy")) | ||
| 73 | (funcall expect 5 "(@tester+) howdy") | ||
| 74 | (should (eq 'statusmsg-input (erc--get-inserted-msg-prop 'erc--msg))) | ||
| 75 | (should (equal "tester" (erc--get-inserted-msg-prop 'erc--spkr))) | ||
| 76 | (should (eq (get-text-property (1- (point)) 'font-lock-face) | ||
| 77 | 'erc-input-face)) | ||
| 78 | (let ((erc-default-recipients '("+#mine"))) | ||
| 79 | (erc-send-message "tenderfoot")) | ||
| 80 | (funcall expect 5 "(@tester+) tenderfoot") | ||
| 81 | (should (equal "" (get-text-property (pos-bol) 'display))) | ||
| 82 | |||
| 83 | ;; Simulate some "echoed" CTCP ACTION messages since we don't | ||
| 84 | ;; actually support that yet. | ||
| 85 | (funcall expect 5 "* (@tester+) mad") | ||
| 86 | (should (eq 'ctcp-action-statusmsg-input | ||
| 87 | (erc--get-inserted-msg-prop 'erc--msg))) | ||
| 88 | (should (equal (get-text-property (1- (point)) 'font-lock-face) | ||
| 89 | '(erc-input-face erc-action-face))) | ||
| 90 | (funcall expect 5 "* (@tester+) chad") | ||
| 91 | (should (equal "" (get-text-property (pos-bol) 'display)))) | ||
| 92 | |||
| 93 | (ert-info ("Receive status messages prefixed") | ||
| 94 | (setq erc-show-speaker-membership-status t) | ||
| 95 | (erc-scenarios-common-say "/me ready") ; sync | ||
| 96 | (funcall expect 5 "* @tester ready") | ||
| 97 | (funcall expect 5 "(+dummy+) okie") | ||
| 98 | |||
| 99 | ;; CTCP ACTION | ||
| 100 | (funcall expect 5 "* (+dummy+) dokie") | ||
| 101 | (funcall expect 5 "* +dummy out"))))) | ||
| 102 | |||
| 103 | ;;; erc-scenarios-base-statusmsg.el ends here | ||
diff --git a/test/lisp/erc/erc-scenarios-stamp.el b/test/lisp/erc/erc-scenarios-stamp.el index bb3a4195e0d..e4788f78654 100644 --- a/test/lisp/erc/erc-scenarios-stamp.el +++ b/test/lisp/erc/erc-scenarios-stamp.el | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | (ert-info ("Stamps appear in left margin and are invisible") | 68 | (ert-info ("Stamps appear in left margin and are invisible") |
| 69 | (should (eq 'erc-timestamp (field-at-pos (pos-bol)))) | 69 | (should (eq 'erc-timestamp (field-at-pos (pos-bol)))) |
| 70 | (should (= (pos-bol) (field-beginning (pos-bol)))) | 70 | (should (= (pos-bol) (field-beginning (pos-bol)))) |
| 71 | (should (eq 'msg (get-text-property (pos-bol) 'erc--msg))) | 71 | (should (eq 'query-notice (get-text-property (pos-bol) 'erc--msg))) |
| 72 | (should (eq 'NOTICE (get-text-property (pos-bol) 'erc--cmd))) | 72 | (should (eq 'NOTICE (get-text-property (pos-bol) 'erc--cmd))) |
| 73 | (should (= ?- (char-after (field-end (pos-bol))))) | 73 | (should (= ?- (char-after (field-end (pos-bol))))) |
| 74 | (should (equal (get-text-property (1+ (field-end (pos-bol))) | 74 | (should (equal (get-text-property (1+ (field-end (pos-bol))) |
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 94ba724ac43..b7e0cdcaa21 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el | |||
| @@ -2285,7 +2285,8 @@ | |||
| 2285 | calls | 2285 | calls |
| 2286 | erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) | 2286 | erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) |
| 2287 | (cl-letf (((symbol-function 'erc-display-message) | 2287 | (cl-letf (((symbol-function 'erc-display-message) |
| 2288 | (lambda (_ _ _ line) (push line calls))) | 2288 | (lambda (_ _ _ msg &rest args) |
| 2289 | (push (apply #'erc-format-message msg args) calls))) | ||
| 2289 | ((symbol-function 'erc-server-send) | 2290 | ((symbol-function 'erc-server-send) |
| 2290 | (lambda (line _) (push line calls))) | 2291 | (lambda (line _) (push line calls))) |
| 2291 | ((symbol-function 'erc-server-buffer) | 2292 | ((symbol-function 'erc-server-buffer) |
| @@ -2327,7 +2328,7 @@ | |||
| 2327 | (should-not erc-server-last-peers) | 2328 | (should-not erc-server-last-peers) |
| 2328 | (erc-message "PRIVMSG" ". hi") | 2329 | (erc-message "PRIVMSG" ". hi") |
| 2329 | (should-not erc-server-last-peers) | 2330 | (should-not erc-server-last-peers) |
| 2330 | (should (eq 'no-target (pop calls))) | 2331 | (should (equal "No target" (pop calls))) |
| 2331 | (erc-message "PRIVMSG" ", hi") | 2332 | (erc-message "PRIVMSG" ", hi") |
| 2332 | (should-not erc-server-last-peers) | 2333 | (should-not erc-server-last-peers) |
| 2333 | (should (string-match "alice :hi" (pop calls))))) | 2334 | (should (string-match "alice :hi" (pop calls))))) |
| @@ -2360,42 +2361,208 @@ | |||
| 2360 | (kill-buffer "ExampleNet") | 2361 | (kill-buffer "ExampleNet") |
| 2361 | (kill-buffer "#chan"))) | 2362 | (kill-buffer "#chan"))) |
| 2362 | 2363 | ||
| 2363 | (ert-deftest erc-format-privmessage () | 2364 | ;; This is an adapter that uses formatting templates from the |
| 2364 | ;; Basic PRIVMSG | 2365 | ;; `-speaker' catalog to mimic `erc-format-privmessage', for testing |
| 2365 | (should (erc-tests--equal-including-properties | 2366 | ;; purposes. |
| 2366 | (erc-format-privmessage (copy-sequence "bob") | 2367 | (defun erc-tests--format-privmessage (nick msg privp msgp &optional inputp pfx) |
| 2367 | (copy-sequence "oh my") | 2368 | (let ((erc-current-message-catalog erc--message-speaker-catalog)) |
| 2368 | nil 'msgp) | 2369 | (apply #'erc-format-message |
| 2369 | #("<bob> oh my" | 2370 | (erc--determine-speaker-message-format-args nick msg privp msgp |
| 2370 | 0 1 (font-lock-face erc-default-face) | 2371 | inputp nil pfx)))) |
| 2371 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) | 2372 | |
| 2372 | 4 11 (font-lock-face erc-default-face)))) | 2373 | ;; This asserts that `erc--determine-speaker-message-format-args' |
| 2373 | 2374 | ;; behaves identically to `erc-format-privmessage', the function whose | |
| 2374 | ;; Basic NOTICE | 2375 | ;; role it basically replaced. |
| 2375 | (should (erc-tests--equal-including-properties | 2376 | (ert-deftest erc--determine-speaker-message-format-args () |
| 2376 | (erc-format-privmessage (copy-sequence "bob") | 2377 | ;; Basic PRIVMSG. |
| 2377 | (copy-sequence "oh my") | 2378 | (let ((expect #("<bob> oh my" |
| 2378 | nil nil) | 2379 | 0 1 (font-lock-face erc-default-face) |
| 2379 | #("-bob- oh my" | 2380 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) |
| 2380 | 0 1 (font-lock-face erc-default-face) | 2381 | 4 11 (font-lock-face erc-default-face))) |
| 2381 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) | 2382 | (args (list (concat "bob") (concat "oh my") nil 'msgp))) |
| 2382 | 4 11 (font-lock-face erc-default-face)))) | 2383 | (should (erc-tests--equal-including-properties |
| 2383 | 2384 | (apply #'erc-format-privmessage args) | |
| 2384 | ;; Prefixed PRIVMSG | 2385 | expect)) |
| 2385 | (let* ((user (make-erc-server-user :nickname (copy-sequence "Bob"))) | 2386 | (should (erc-tests--equal-including-properties |
| 2387 | (apply #'erc-tests--format-privmessage args) | ||
| 2388 | expect))) | ||
| 2389 | |||
| 2390 | ;; Basic NOTICE. | ||
| 2391 | (let ((expect #("-bob- oh my" | ||
| 2392 | 0 1 (font-lock-face erc-default-face) | ||
| 2393 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) | ||
| 2394 | 4 11 (font-lock-face erc-default-face))) | ||
| 2395 | (args (list (copy-sequence "bob") (copy-sequence "oh my") nil nil))) | ||
| 2396 | (should (erc-tests--equal-including-properties | ||
| 2397 | (apply #'erc-format-privmessage args) | ||
| 2398 | expect)) | ||
| 2399 | (should (erc-tests--equal-including-properties | ||
| 2400 | (apply #'erc-tests--format-privmessage args) | ||
| 2401 | expect))) | ||
| 2402 | |||
| 2403 | ;; Status-prefixed PRIVMSG. | ||
| 2404 | (let* ((expect | ||
| 2405 | #("<@Bob> oh my" | ||
| 2406 | 0 1 (font-lock-face erc-default-face) | ||
| 2407 | 1 2 (font-lock-face erc-nick-prefix-face help-echo "operator") | ||
| 2408 | 2 5 (erc--speaker "Bob" font-lock-face erc-nick-default-face) | ||
| 2409 | 5 12 (font-lock-face erc-default-face))) | ||
| 2410 | (user (make-erc-server-user :nickname (copy-sequence "Bob"))) | ||
| 2386 | (cuser (make-erc-channel-user :op t)) | 2411 | (cuser (make-erc-channel-user :op t)) |
| 2387 | (erc-channel-users (make-hash-table :test #'equal))) | 2412 | (erc-channel-users (make-hash-table :test #'equal))) |
| 2388 | (puthash "bob" (cons user cuser) erc-channel-users) | 2413 | (puthash "bob" (cons user cuser) erc-channel-users) |
| 2389 | 2414 | ||
| 2415 | (with-suppressed-warnings ((obsolete erc-format-@nick)) | ||
| 2416 | (should (erc-tests--equal-including-properties | ||
| 2417 | (erc-format-privmessage (erc-format-@nick user cuser) | ||
| 2418 | (copy-sequence "oh my") | ||
| 2419 | nil 'msgp) | ||
| 2420 | expect))) | ||
| 2421 | (let ((nick "Bob") | ||
| 2422 | (msg "oh my")) | ||
| 2423 | (should (erc-tests--equal-including-properties | ||
| 2424 | (erc-tests--format-privmessage nick msg nil 'msgp nil cuser) | ||
| 2425 | expect)) ; overloaded on PREFIX arg | ||
| 2426 | (should (erc-tests--equal-including-properties | ||
| 2427 | (erc-tests--format-privmessage nick msg nil 'msgp nil t) | ||
| 2428 | expect)) | ||
| 2429 | ;; The new version makes a copy instead of adding properties to | ||
| 2430 | ;; the input. | ||
| 2431 | (should-not | ||
| 2432 | (text-property-not-all 0 (length nick) 'font-lock-face nil nick)) | ||
| 2433 | (should-not | ||
| 2434 | (text-property-not-all 0 (length msg) 'font-lock-face nil msg))))) | ||
| 2435 | |||
| 2436 | (ert-deftest erc--determine-speaker-message-format-args/queries-as-channel () | ||
| 2437 | (should erc-format-query-as-channel-p) | ||
| 2438 | |||
| 2439 | (with-current-buffer (get-buffer-create "bob") | ||
| 2440 | (erc-mode) | ||
| 2441 | (setq erc--target (erc--target-from-string "alice")) | ||
| 2442 | |||
| 2443 | (insert "PRIVMSG\n" | ||
| 2444 | (erc-tests--format-privmessage "bob" "oh my" 'queryp 'msgp)) | ||
| 2445 | (should (erc-tests--equal-including-properties | ||
| 2446 | #("<bob> oh my" | ||
| 2447 | 0 1 (font-lock-face erc-default-face) | ||
| 2448 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) | ||
| 2449 | 4 11 (font-lock-face erc-default-face)) | ||
| 2450 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2451 | |||
| 2452 | (insert "\nNOTICE\n" | ||
| 2453 | (erc-tests--format-privmessage "bob" "oh my" 'queryp nil)) | ||
| 2454 | (should (erc-tests--equal-including-properties | ||
| 2455 | #("-bob- oh my" | ||
| 2456 | 0 1 (font-lock-face erc-default-face) | ||
| 2457 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-default-face) | ||
| 2458 | 4 11 (font-lock-face erc-default-face)) | ||
| 2459 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2460 | |||
| 2461 | (insert "\nInput PRIVMSG\n" | ||
| 2462 | (erc-tests--format-privmessage "bob" "oh my" | ||
| 2463 | 'queryp 'privmsgp 'inputp)) | ||
| 2464 | (should (erc-tests--equal-including-properties | ||
| 2465 | #("<bob> oh my" | ||
| 2466 | 0 1 (font-lock-face erc-default-face) | ||
| 2467 | 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) | ||
| 2468 | 4 6 (font-lock-face erc-default-face) | ||
| 2469 | 6 11 (font-lock-face erc-input-face)) | ||
| 2470 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2471 | |||
| 2472 | (insert "\nInput NOTICE\n" | ||
| 2473 | (erc-tests--format-privmessage "bob" "oh my" 'queryp nil 'inputp)) | ||
| 2390 | (should (erc-tests--equal-including-properties | 2474 | (should (erc-tests--equal-including-properties |
| 2391 | (erc-format-privmessage (erc-format-@nick user cuser) | 2475 | #("-bob- oh my" |
| 2392 | (copy-sequence "oh my") | ||
| 2393 | nil 'msgp) | ||
| 2394 | #("<@Bob> oh my" | ||
| 2395 | 0 1 (font-lock-face erc-default-face) | 2476 | 0 1 (font-lock-face erc-default-face) |
| 2396 | 1 2 (font-lock-face erc-nick-prefix-face help-echo "operator") | 2477 | 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) |
| 2397 | 2 5 (erc--speaker "Bob" font-lock-face erc-nick-default-face) | 2478 | 4 6 (font-lock-face erc-default-face) |
| 2398 | 5 12 (font-lock-face erc-default-face)))))) | 2479 | 6 11 (font-lock-face erc-input-face)) |
| 2480 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2481 | |||
| 2482 | (when noninteractive (kill-buffer)))) | ||
| 2483 | |||
| 2484 | (ert-deftest erc--determine-speaker-message-format-args/queries () | ||
| 2485 | (should erc-format-query-as-channel-p) | ||
| 2486 | |||
| 2487 | (with-current-buffer (get-buffer-create "bob") | ||
| 2488 | (erc-mode) | ||
| 2489 | (setq-local erc-format-query-as-channel-p nil) | ||
| 2490 | (setq erc--target (erc--target-from-string "alice")) | ||
| 2491 | |||
| 2492 | (insert "PRIVMSG\n" | ||
| 2493 | (erc-tests--format-privmessage "bob" "oh my" 'queryp 'msgp)) | ||
| 2494 | (should (erc-tests--equal-including-properties | ||
| 2495 | #("*bob* oh my" | ||
| 2496 | 0 1 (font-lock-face erc-direct-msg-face) | ||
| 2497 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-msg-face) | ||
| 2498 | 4 11 (font-lock-face erc-direct-msg-face)) | ||
| 2499 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2500 | |||
| 2501 | (insert "\nNOTICE\n" | ||
| 2502 | (erc-tests--format-privmessage "bob" "oh my" 'queryp nil)) | ||
| 2503 | (should (erc-tests--equal-including-properties | ||
| 2504 | #("-bob- oh my" | ||
| 2505 | 0 1 (font-lock-face erc-direct-msg-face) | ||
| 2506 | 1 4 (erc--speaker "bob" font-lock-face erc-nick-msg-face) | ||
| 2507 | 4 11 (font-lock-face erc-direct-msg-face)) | ||
| 2508 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2509 | |||
| 2510 | (insert "\nInput PRIVMSG\n" | ||
| 2511 | (erc-tests--format-privmessage "bob" "oh my" | ||
| 2512 | 'queryp 'privmsgp 'inputp)) | ||
| 2513 | (should (erc-tests--equal-including-properties | ||
| 2514 | #("*bob* oh my" | ||
| 2515 | 0 1 (font-lock-face erc-direct-msg-face) | ||
| 2516 | 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) | ||
| 2517 | 4 6 (font-lock-face erc-direct-msg-face) | ||
| 2518 | 6 11 (font-lock-face erc-input-face)) | ||
| 2519 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2520 | |||
| 2521 | (insert "\nInput NOTICE\n" | ||
| 2522 | (erc-tests--format-privmessage "bob" "oh my" 'queryp nil 'inputp)) | ||
| 2523 | (should (erc-tests--equal-including-properties | ||
| 2524 | #("-bob- oh my" | ||
| 2525 | 0 1 (font-lock-face erc-direct-msg-face) | ||
| 2526 | 1 4 (erc--speaker "bob" font-lock-face erc-my-nick-face) | ||
| 2527 | 4 6 (font-lock-face erc-direct-msg-face) | ||
| 2528 | 6 11 (font-lock-face erc-input-face)) | ||
| 2529 | (buffer-substring (pos-bol) (pos-eol)))) | ||
| 2530 | |||
| 2531 | (when noninteractive (kill-buffer)))) | ||
| 2532 | |||
| 2533 | (defun erc-tests--format-my-nick (message) | ||
| 2534 | (concat (erc-format-my-nick) | ||
| 2535 | (propertize message 'font-lock-face 'erc-input-face))) | ||
| 2536 | |||
| 2537 | ;; This tests that the default behavior of the replacement formatting | ||
| 2538 | ;; function for prompt input, `erc--format-speaker-input-message' | ||
| 2539 | ;; matches that of the original being replaced, `erc-format-my-nick', | ||
| 2540 | ;; though it only handled the speaker portion. | ||
| 2541 | (ert-deftest erc--format-speaker-input-message () | ||
| 2542 | ;; No status prefix. | ||
| 2543 | (let ((erc-server-current-nick "tester") | ||
| 2544 | (expect #("<tester> oh my" | ||
| 2545 | 0 1 (font-lock-face erc-default-face) | ||
| 2546 | 1 7 (font-lock-face erc-my-nick-face erc--speaker "tester") | ||
| 2547 | 7 9 (font-lock-face erc-default-face) | ||
| 2548 | 9 14 (font-lock-face erc-input-face)))) | ||
| 2549 | (should (equal (erc-tests--format-my-nick "oh my") expect)) | ||
| 2550 | (should (equal (erc--format-speaker-input-message "oh my") expect))) | ||
| 2551 | |||
| 2552 | ;; With channel-operator status prefix. | ||
| 2553 | (let* ((erc-server-current-nick "tester") | ||
| 2554 | (cmem (cons (make-erc-server-user :nickname "tester") | ||
| 2555 | (make-erc-channel-user :op t))) | ||
| 2556 | (erc-channel-users (map-into (list "tester" cmem) | ||
| 2557 | '(hash-table :test equal))) | ||
| 2558 | (expect #("<@tester> oh my" | ||
| 2559 | 0 1 (font-lock-face erc-default-face) | ||
| 2560 | 1 2 (font-lock-face erc-my-nick-prefix-face) | ||
| 2561 | 2 5 (font-lock-face erc-my-nick-face erc--speaker "bob") | ||
| 2562 | 5 7 (font-lock-face erc-default-face) | ||
| 2563 | 7 12 (font-lock-face erc-input-face)))) | ||
| 2564 | (should (equal (erc-tests--format-my-nick "oh my") expect)) | ||
| 2565 | (should (equal (erc--format-speaker-input-message "oh my") expect)))) | ||
| 2399 | 2566 | ||
| 2400 | (ert-deftest erc--route-insertion () | 2567 | (ert-deftest erc--route-insertion () |
| 2401 | (erc-tests--send-prep) | 2568 | (erc-tests--send-prep) |
diff --git a/test/lisp/erc/resources/base/display-message/statusmsg.eld b/test/lisp/erc/resources/base/display-message/statusmsg.eld new file mode 100644 index 00000000000..7c42117080c --- /dev/null +++ b/test/lisp/erc/resources/base/display-message/statusmsg.eld | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | ||
| 2 | ((nick 10 "NICK tester")) | ||
| 3 | ((user 10 "USER tester 0 * :tester") | ||
| 4 | (0.00 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") | ||
| 5 | (0.02 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version ergo-v2.11.1") | ||
| 6 | (0.01 ":irc.foonet.org 003 tester :This server was created Thu, 07 Dec 2023 08:04:35 UTC") | ||
| 7 | (0.00 ":irc.foonet.org 004 tester irc.foonet.org ergo-v2.11.1 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") | ||
| 8 | (0.00 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# CHATHISTORY=1000 ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX :are supported by this server") | ||
| 9 | (0.01 ":irc.foonet.org 005 tester KICKLEN=390 MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8ONLY WHOX :are supported by this server") | ||
| 10 | (0.01 ":irc.foonet.org 005 tester draft/CHATHISTORY=1000 :are supported by this server") | ||
| 11 | (0.00 ":irc.foonet.org 251 tester :There are 0 users and 4 invisible on 1 server(s)") | ||
| 12 | (0.00 ":irc.foonet.org 252 tester 0 :IRC Operators online") | ||
| 13 | (0.00 ":irc.foonet.org 253 tester 0 :unregistered connections") | ||
| 14 | (0.00 ":irc.foonet.org 254 tester 2 :channels formed") | ||
| 15 | (0.00 ":irc.foonet.org 255 tester :I have 4 clients and 0 servers") | ||
| 16 | (0.02 ":irc.foonet.org 265 tester 4 5 :Current local users 4, max 5") | ||
| 17 | (0.00 ":irc.foonet.org 266 tester 4 5 :Current global users 4, max 5") | ||
| 18 | (0.00 ":irc.foonet.org 422 tester :MOTD File is missing") | ||
| 19 | (0.00 ":irc.foonet.org 221 tester +i") | ||
| 20 | (0.00 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) | ||
| 21 | |||
| 22 | ((mode-tester 10 "MODE tester +i")) | ||
| 23 | |||
| 24 | ((join-mine 10 "JOIN #mine") | ||
| 25 | (0.01 ":irc.foonet.org 221 tester +i") | ||
| 26 | (0.00 ":tester!~u@2jv6nwu4af69s.irc JOIN #mine") | ||
| 27 | (0.02 ":irc.foonet.org 353 tester = #mine :@tester +dummy") | ||
| 28 | (0.01 ":irc.foonet.org 366 tester #mine :End of NAMES list")) | ||
| 29 | |||
| 30 | ((mode-mine 10 "MODE #mine") | ||
| 31 | (0.00 ":irc.foonet.org 324 tester #mine +Cnt") | ||
| 32 | (0.02 ":irc.foonet.org 329 tester #mine 1702026418") | ||
| 33 | (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :hello") | ||
| 34 | (0.03 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :there") | ||
| 35 | (0.05 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION sad\1") | ||
| 36 | (0.03 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION glad\1")) | ||
| 37 | |||
| 38 | ((privmsg-statusmsg 10 "PRIVMSG +#mine :howdy")) | ||
| 39 | ((privmsg-statusmsg-action 10 "PRIVMSG +#mine :tenderfoot") | ||
| 40 | ;; These are simulated "echoed messages" | ||
| 41 | (0.05 ":tester!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION mad\1") | ||
| 42 | (0.05 ":tester!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION chad\1")) | ||
| 43 | |||
| 44 | ((privmsg-prefixed 10 "PRIVMSG #mine :\1ACTION ready\1") | ||
| 45 | (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :okie") | ||
| 46 | (0.05 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG +#mine :\1ACTION dokie\1") | ||
| 47 | (0.04 ":dummy!~u@2jv6nwu4af69s.irc PRIVMSG #mine :\1ACTION out\1")) | ||
diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld index 9f648915d5c..feaba85ec90 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld | |||
| @@ -1 +1 @@ | |||
| #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file | #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file | ||
diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld index a63fcad3d38..ed1488c8595 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld | |||
| @@ -1 +1 @@ | |||
| #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file | #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 0)) display #8="") 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #10=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #10#) 499 505 (wrap-prefix #1# line-prefix #10#) 505 506 (display #("~\n" 0 2 (font-lock-face shadow))) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 0)) display #8#) 507 510 (wrap-prefix #1# line-prefix #11# display #8#) 510 512 (wrap-prefix #1# line-prefix #11# display #8#) 512 515 (wrap-prefix #1# line-prefix #11#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #12=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #12#) 518 521 (wrap-prefix #1# line-prefix #12#) 521 527 (wrap-prefix #1# line-prefix #12#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #13=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #13#) 532 539 (wrap-prefix #1# line-prefix #13#)) \ No newline at end of file | ||
diff --git a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld index 7cbabfd0581..a3530a6c44d 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld | |||
| @@ -1 +1 @@ | |||
| #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--ts 0 erc--spkr "alice" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--ts 0 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--ts 1680332400 erc--spkr "bob" erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file | #("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n<bob> alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n<bob> zero.[07:00]\n<bob> 0.5\n* bob one.\n<bob> two.\n<bob> 2.5\n* bob three\n<bob> four.\n" 2 3 (erc--msg datestamp erc--ts 0 field erc-timestamp) 3 20 (field erc-timestamp wrap-prefix #1=(space :width 27) line-prefix (space :width (- 27 (18)))) 21 22 (erc--msg notice erc--ts 0 wrap-prefix #1# line-prefix #2=(space :width (- 27 (4)))) 22 183 (wrap-prefix #1# line-prefix #2#) 183 190 (field erc-timestamp wrap-prefix #1# line-prefix #2# display (#5=(margin right-margin) #("[00:00]" 0 7 (invisible timestamp)))) 191 192 (erc--msg msg erc--spkr "alice" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #3=(space :width (- 27 (8)))) 192 197 (wrap-prefix #1# line-prefix #3#) 197 199 (wrap-prefix #1# line-prefix #3#) 199 202 (wrap-prefix #1# line-prefix #3#) 202 315 (wrap-prefix #1# line-prefix #3#) 316 348 (wrap-prefix #1# line-prefix #3#) 349 350 (erc--msg msg erc--spkr "bob" erc--ts 0 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #4=(space :width (- 27 (6)))) 350 353 (wrap-prefix #1# line-prefix #4#) 353 355 (wrap-prefix #1# line-prefix #4#) 355 360 (wrap-prefix #1# line-prefix #4#) 360 435 (wrap-prefix #1# line-prefix #4#) 436 437 (erc--msg datestamp erc--ts 1680307200 field erc-timestamp) 437 454 (field erc-timestamp wrap-prefix #1# line-prefix (space :width (- 27 (18)))) 455 456 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #6=(space :width (- 27 (6)))) 456 459 (wrap-prefix #1# line-prefix #6#) 459 466 (wrap-prefix #1# line-prefix #6#) 466 473 (field erc-timestamp wrap-prefix #1# line-prefix #6# display (#5# #("[07:00]" 0 7 (invisible timestamp)))) 474 475 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #7=(space :width (- 27 #10=(2))) display #8=#("> " 0 1 (font-lock-face shadow))) 475 478 (wrap-prefix #1# line-prefix #7# display #8#) 478 480 (wrap-prefix #1# line-prefix #7# display #8#) 480 483 (wrap-prefix #1# line-prefix #7#) 484 485 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #9=(space :width (- 27 (6)))) 485 486 (wrap-prefix #1# line-prefix #9#) 486 489 (wrap-prefix #1# line-prefix #9#) 489 494 (wrap-prefix #1# line-prefix #9#) 495 496 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #11=(space :width (- 27 (6)))) 496 499 (wrap-prefix #1# line-prefix #11#) 499 505 (wrap-prefix #1# line-prefix #11#) 506 507 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #12=(space :width (- 27 #10#)) display #8#) 507 510 (wrap-prefix #1# line-prefix #12# display #8#) 510 512 (wrap-prefix #1# line-prefix #12# display #8#) 512 515 (wrap-prefix #1# line-prefix #12#) 516 517 (erc--msg ctcp-action erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG erc--ctcp ACTION wrap-prefix #1# line-prefix #13=(space :width (- 27 (2)))) 517 518 (wrap-prefix #1# line-prefix #13#) 518 521 (wrap-prefix #1# line-prefix #13#) 521 527 (wrap-prefix #1# line-prefix #13#) 528 529 (erc--msg msg erc--spkr "bob" erc--ts 1680332400 erc--cmd PRIVMSG wrap-prefix #1# line-prefix #14=(space :width (- 27 (6)))) 529 532 (wrap-prefix #1# line-prefix #14#) 532 539 (wrap-prefix #1# line-prefix #14#)) \ No newline at end of file | ||