diff options
| author | F. Jason Park | 2023-11-25 19:23:55 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-11-26 14:25:27 -0800 |
| commit | 2407f810136739da376ff0929b247a49dc196299 (patch) | |
| tree | 3475b93b1548bb75631adaaf11c6c289b1873729 /lisp/erc | |
| parent | 01e7178917743470d05a5b1a5d883d07191e3014 (diff) | |
| download | emacs-2407f810136739da376ff0929b247a49dc196299.tar.gz emacs-2407f810136739da376ff0929b247a49dc196299.zip | |
Restore prompt correctly when reconnecting in ERC
* lisp/erc/erc.el (erc--initialize-markers): Commit 0d6c8d41ab7 "Use
overlay instead of text prop to hide ERC's prompt" introduced a bug
that caused the prompt to remain hidden upon reconnecting because the
stashed overlay would get clobbered by ERC's major-mode setup.
Binding its old value while unhiding fixes the issue.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Don't permanently set
the default value of `erc-hide-prompt'.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--join-network-id): Add assertions for prompt
hiding and unhiding on reconnect. (Bug#51082)
Diffstat (limited to 'lisp/erc')
| -rw-r--r-- | lisp/erc/erc.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index a2f4562d333..616129bf780 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -2394,7 +2394,9 @@ nil." | |||
| 2394 | (set-marker-insertion-type erc-insert-marker t) | 2394 | (set-marker-insertion-type erc-insert-marker t) |
| 2395 | (cl-assert (= (field-end erc-insert-marker) erc-input-marker)) | 2395 | (cl-assert (= (field-end erc-insert-marker) erc-input-marker)) |
| 2396 | (goto-char old-point) | 2396 | (goto-char old-point) |
| 2397 | (erc--unhide-prompt)) | 2397 | (let ((erc--hidden-prompt-overlay |
| 2398 | (alist-get 'erc--hidden-prompt-overlay continued-session))) | ||
| 2399 | (erc--unhide-prompt))) | ||
| 2398 | (cl-assert (not (get-text-property (point) 'erc-prompt))) | 2400 | (cl-assert (not (get-text-property (point) 'erc-prompt))) |
| 2399 | ;; In the original version from `erc-open', the snippet that | 2401 | ;; In the original version from `erc-open', the snippet that |
| 2400 | ;; handled these newline insertions appeared twice close in | 2402 | ;; handled these newline insertions appeared twice close in |