summary refs log tree commit diff stats
path: root/lisp/acdw-erc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw-erc.el')
-rw-r--r--lisp/acdw-erc.el22
1 files changed, 21 insertions, 1 deletions
diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 92ce6db..8cf9734 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el
@@ -66,6 +66,7 @@ If USE-TLS is non-nil, use TLS."
66(defun erc/connect () 66(defun erc/connect ()
67 "Connect to all the servers in `erc/servers'." 67 "Connect to all the servers in `erc/servers'."
68 (interactive) 68 (interactive)
69 (require 'erc)
69 (mapcar #'connect-to-erc erc/servers)) 70 (mapcar #'connect-to-erc erc/servers))
70 71
71(defun filter-server-buffers () 72(defun filter-server-buffers ()
@@ -79,7 +80,26 @@ If USE-TLS is non-nil, use TLS."
79 (dolist (buffer (filter-server-buffers)) 80 (dolist (buffer (filter-server-buffers))
80 (with-message (format "Killing server buffer: %s" (buffer-name buffer)) 81 (with-message (format "Killing server buffer: %s" (buffer-name buffer))
81 (with-current-buffer buffer 82 (with-current-buffer buffer
82 (erc-quit-server erc/bye-message))))) 83 (erc-quit-server erc/bye-message))))
84 (force-mode-line-update))
85
86(defun acdw-erc/prompt ()
87 "The prompt to show for ERC."
88 ;; Rewrite s-truncate to avoid dependency.
89 (let ((name (buffer-name))
90 (ellipsis "...")
91 (len erc-fill-static-center))
92 (if (and len (> (length name) (- len 2)))
93 (format "%s%s>"
94 (substring name 0 (- len 2 (length ellipsis)))
95 ellipsis)
96 (format "%s%s>" (let ((ss) ; Rewrite s-repeat to avoid dependency.
97 (num (- len 2 (length name))))
98 (while (> num 0)
99 (setq ss (cons " " ss))
100 (setq num (1- num)))
101 (apply #'concat ss))
102 name))))
83 103
84(provide 'acdw-erc) 104(provide 'acdw-erc)
85;;; acdw-erc.el ends here 105;;; acdw-erc.el ends here