summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-06-07 14:10:24 -0500
committerCase Duckworth2021-06-07 14:10:24 -0500
commit924d0fc4c78ba59e2360ae0e774c8f70d36cb931 (patch)
treea0afe39604248de11cab23b74454079035c5803b /lisp
parentMake Emacs work at work (diff)
parentChange ERC config (diff)
downloademacs-924d0fc4c78ba59e2360ae0e774c8f70d36cb931.tar.gz
emacs-924d0fc4c78ba59e2360ae0e774c8f70d36cb931.zip
Merge branch 'main' of tildegit.org:acdw/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-erc.el22
-rw-r--r--lisp/acdw.el4
2 files changed, 25 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
diff --git a/lisp/acdw.el b/lisp/acdw.el index 48e754d..2f878a9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -410,6 +410,10 @@ Prompt only if there are unsaved changes."
410 (custom-set-faces '(fringe 410 (custom-set-faces '(fringe
411 ((t (:foreground "dim gray")))))) 411 ((t (:foreground "dim gray"))))))
412 412
413(defun acdw/require-private ()
414 "Require `acdw-private', which is in private.el."
415 (require 'acdw-private "private.el"))
416
413 417
414;;; URL regexp 418;;; URL regexp
415;; really, I just want to add gemini:// protocol, but I'm going to do some 419;; really, I just want to add gemini:// protocol, but I'm going to do some