From f2613f703f3e4fa49a0efb3e120b493bb0731c53 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 20 Feb 2023 00:05:34 -0800 Subject: [PATCH 0/8] *** NOT A PATCH *** *** BLURB HERE *** F. Jason Park (8): [5.6] Refactor marker initialization in erc-open [5.6] Adjust some old text properties in ERC buffers [5.6] Expose insertion time as text prop in erc-stamp [5.6] Make some erc-stamp functions more limber [5.6] Put display properties to better use in erc-stamp [5.6] Convert erc-fill minor mode into a proper module [5.6] Add variant for erc-match invisibility spec [5.6] Add erc-fill style based on visual-line-mode lisp/erc/erc-compat.el | 57 +++ lisp/erc/erc-fill.el | 307 +++++++++++++++-- lisp/erc/erc-match.el | 31 +- lisp/erc/erc-stamp.el | 210 ++++++++++-- lisp/erc/erc.el | 127 ++++--- test/lisp/erc/erc-fill-tests.el | 324 ++++++++++++++++++ .../erc-scenarios-base-local-module-modes.el | 211 ++++++++++++ .../erc/erc-scenarios-base-local-modules.el | 99 ------ test/lisp/erc/erc-stamp-tests.el | 265 ++++++++++++++ test/lisp/erc/erc-tests.el | 79 ++++- .../fill/snapshots/monospace-01-start.eld | 1 + .../fill/snapshots/monospace-02-right.eld | 1 + .../fill/snapshots/monospace-03-left.eld | 1 + .../fill/snapshots/monospace-04-reset.eld | 1 + 14 files changed, 1497 insertions(+), 217 deletions(-) create mode 100644 test/lisp/erc/erc-fill-tests.el create mode 100644 test/lisp/erc/erc-scenarios-base-local-module-modes.el create mode 100644 test/lisp/erc/erc-stamp-tests.el create mode 100644 test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld create mode 100644 test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld create mode 100644 test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld create mode 100644 test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld Interdiff: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 95d374b121e..b04386c6a3b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1976,22 +1976,12 @@ erc--initialize-markers erc-input-marker (make-marker)) (if continued-session (progn - ;; Respect existing multiline input after prompt. Expect any - ;; text preceding it on the same line, including whitespace, - ;; to be part of the prompt itself. - (goto-char (point-max)) - (forward-line 0) - (while (and (not (get-text-property (point) 'erc-prompt)) - (zerop (forward-line -1)))) - (cl-assert (not (= (point) (point-min)))) - (set-marker erc-insert-marker (point)) - ;; If the input area is clean, this search should fail and - ;; return point max. Otherwise, it should return the position - ;; after the last char with the `erc-prompt' property, as per - ;; the doc string for `next-single-property-change'. + ;; Trust existing markers. + (set-marker erc-insert-marker + (alist-get 'erc-insert-marker continued-session)) (set-marker erc-input-marker - (next-single-property-change (point) 'erc-prompt nil - (point-max))) + (alist-get 'erc-input-marker continued-session)) + (goto-char erc-insert-marker) (cl-assert (= (field-end) erc-input-marker)) (goto-char old-point) (erc--unhide-prompt)) @@ -2043,7 +2033,8 @@ erc-open (and-let* (((not target)) (m (buffer-local-value 'erc-input-marker buffer)) - ((marker-position m))))))) + ((marker-position m))) + (buffer-local-variables buffer))))) (when connect (run-hook-with-args 'erc-before-connect server port nick)) (set-buffer buffer) (setq old-point (point)) -- 2.39.1