From 10b8c209782448bdc0ca4abcc19cda32ce41505b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 23 Sep 2021 17:09:46 -0500 Subject: Add circe-command-SHORTEN --- lisp/acdw-irc.el | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el index 305dc93..1fc7482 100644 --- a/lisp/acdw-irc.el +++ b/lisp/acdw-irc.el @@ -139,6 +139,41 @@ already been connected to." circe-chat-target "ACTION" line)))) +(defun circe-command-SHORTEN (url) + "Shorten URL using `0x0-shorten-uri'." + (interactive "sURL to shorten: ") + ;; TODO: enable /shorten URL comment syntax + (let ((short-url (0x0-shorten-uri (0x0--choose-server) url))) + (circe-command-SAY short-url))) + +(defun circe-part@kill-buffer (&rest _) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer))) + +(defun circe-quit@kill-buffer (&rest _) + ;; `circe-server-killed-confirmation' set to nil, and manually + ;; deleting all chat buffers, pending Github issue #402 + ;; (https://github.com/emacs-circe/circe/issues/402) + (let ((circe-server-killed-confirmation nil)) + (with-circe-server-buffer + (dolist (buf (circe-server-chat-buffers)) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer buf))) + (kill-buffer)))) + +(defun circe-gquit@kill-buffer (&rest _) + ;; `circe-server-killed-confirmation' set to nil, and manually + ;; deleting all chat buffers, pending Github issue #402 + ;; (https://github.com/emacs-circe/circe/issues/402) + (let ((circe-server-killed-confirmation nil)) + (dolist (buf (circe-server-buffers)) + (with-current-buffer buf + (dolist (buf (circe-server-chat-buffers)) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer buf))) + (message "%s: %s" buf circe-server-killed-confirmation) + (kill-buffer))))) + (provide 'acdw-irc) ;;; acdw-irc.el ends here -- cgit 1.4.1-21-gabe81