about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-erc.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 7517d0e..6e06325 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el
@@ -81,6 +81,23 @@ If USE-TLS is non-nil, use TLS."
81 (with-message (format "Killing server buffer: %s" (buffer-name buffer)) 81 (with-message (format "Killing server buffer: %s" (buffer-name buffer))
82 (with-current-buffer buffer 82 (with-current-buffer buffer
83 (erc-quit-server erc/bye-message))))) 83 (erc-quit-server erc/bye-message)))))
84(defun acdw-erc/prompt ()
85 "The prompt to show for ERC."
86 ;; Rewrite s-truncate to avoid dependency.
87 (let ((name (buffer-name))
88 (ellipsis "...")
89 (len erc-fill-static-center))
90 (if (and len (> (length name) (- len 2)))
91 (format "%s%s>"
92 (substring name 0 (- len 2 (length ellipsis)))
93 ellipsis)
94 (format "%s%s>" (let ((ss) ; Rewrite s-repeat to avoid dependency.
95 (num (- len 2 (length name))))
96 (while (> num 0)
97 (setq ss (cons " " ss))
98 (setq num (1- num)))
99 (apply #'concat ss))
100 name))))
84 101
85(provide 'acdw-erc) 102(provide 'acdw-erc)
86;;; acdw-erc.el ends here 103;;; acdw-erc.el ends here