(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."
(should (looking-at-p (regexp-quote erc-prompt)))
(setq erc-server-process (buffer-local-value 'erc-server-process
(get-buffer "ServNet"))
- erc-default-recipients '("#chan")))
+ erc--target (erc--target-from-string "#chan")))
(with-current-buffer (get-buffer-create "bob")
(erc-tests--send-prep)
(should (looking-at-p (regexp-quote erc-prompt)))
(setq erc-server-process (buffer-local-value 'erc-server-process
(get-buffer "ServNet"))
- erc-default-recipients '("bob")))
+ erc--target (erc--target-from-string "bob")))
(ert-info ("Value: t (default)")
(should (eq erc-hide-prompt t))