diff options
author | F. Jason Park <jp@neverwas.me> | 2023-02-22 06:24:17 -0800 |
---|---|---|
committer | F. Jason Park <jp@neverwas.me> | 2023-02-22 06:33:12 -0800 |
commit | db7096a532ca031687f9411df621900e869e9e98 (patch) | |
tree | 3ebc17604347d5cbde6fb79fb399096fbac0179f /lisp/erc/erc-backend.el | |
parent | db21c84bc9458a1ebaf93a4ff5d289ff96ddd33d (diff) | |
download | emacs-db7096a532ca031687f9411df621900e869e9e98.tar.gz |
Yield to erc-move-to-prompt before unhiding prompt
* lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth from 0
to 91 to allow the `move-to-prompt' module to do its thing. This
feature was added by bug#54826 and first appeared in Emacs 29.
* lisp/erc/erc-common.el (erc-server-user): Remove erroneous comment.
The `buffers' field is a list of buffers.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Use `erc--target'
instead of `erc-default-recipients' because this is new code.
Diffstat (limited to 'lisp/erc/erc-backend.el')
-rw-r--r-- | lisp/erc/erc-backend.el | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index cf0b734bd28..567443f5329 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -883,24 +883,22 @@ Conditionally try to reconnect and take appropriate action." (erc--unhide-prompt))) (defun erc--hide-prompt (proc) - (erc-with-all-buffers-of-server - proc nil ; sorta wish this was indent 2 - (when (and erc-hide-prompt - (or (eq erc-hide-prompt t) - ;; FIXME use `erc--target' after bug#48598 - (memq (if (erc-default-target) - (if (erc-channel-p (car erc-default-recipients)) - 'channel - 'query) - 'server) - erc-hide-prompt)) - (marker-position erc-insert-marker) - (marker-position erc-input-marker) - (get-text-property erc-insert-marker 'erc-prompt)) - (with-silent-modifications - (add-text-properties erc-insert-marker (1- erc-input-marker) - `(display ,erc-prompt-hidden))) - (add-hook 'pre-command-hook #'erc--unhide-prompt-on-self-insert 0 t)))) + (erc-with-all-buffers-of-server proc nil + (when (and erc-hide-prompt + (or (eq erc-hide-prompt t) + (memq (if erc--target + (if (erc--target-channel-p erc--target) + 'channel + 'query) + 'server) + erc-hide-prompt)) + (marker-position erc-insert-marker) + (marker-position erc-input-marker) + (get-text-property erc-insert-marker 'erc-prompt)) + (with-silent-modifications + (add-text-properties erc-insert-marker (1- erc-input-marker) + `(display ,erc-prompt-hidden))) + (add-hook 'pre-command-hook #'erc--unhide-prompt-on-self-insert 91 t)))) (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." |