From 43bed1f97e6f1a229553d7a25dc437741326772e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 May 2023 13:08:35 -0500 Subject: Bankruptcy 10 --- lisp/acdw-chat.el | 206 ------------------------------------------------------ 1 file changed, 206 deletions(-) delete mode 100644 lisp/acdw-chat.el (limited to 'lisp/acdw-chat.el') diff --git a/lisp/acdw-chat.el b/lisp/acdw-chat.el deleted file mode 100644 index 9294ffe..0000000 --- a/lisp/acdw-chat.el +++ /dev/null @@ -1,206 +0,0 @@ -;;; acdw-chat.el --- Chat applications (mostly jabber) -*- lexical-binding: t; -*- - -;;; Code: - -(defcustom jabber-prefix-width 10 - "Width of jabber prompts and other prefixes." - :type 'number - :group 'jabber) - -(defun jabber-ui-setup () - "Setup the `jabber' user interface." - (visual-fill-column-mode) - (electric-pair-local-mode -1) - (auto-fill-mode -1) - (setq-local wrap-prefix (make-string (+ 3 jabber-prefix-width) #x20) - visual-fill-column-extra-text-width `(,(+ 3 jabber-prefix-width) - . 1))) - -(defcustom jabber-biboumi-server "localhost" - "Biboumi server for `jabber-biboumi-muc-connect'." - :type 'string - :group 'jabber) - -(defcustom jabber-biboumi-irc-servers '("irc.libera.chat") - "IRC servers for the user to choose from with `jabber-biboumi-muc-connect'." - :type '(repeat string) - :group 'jabber) - -(defcustom jabber-biboumi-default-nick "" - "Default nick for biboumi rooms." - :type 'string - :group 'jabber) - -(defun jabber-biboumi-muc-connect (channel server nick &optional biboumi-server) - "Connect to a biboumi (IRC gateway) server MUC. -CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to -`jabber-muc-join'. If BIBOUMI-SERVER isn't given, -`jabber-biboumi-server' is used." - (interactive (list (concat "#" (string-remove-prefix "#" (read-string - "Channel: "))) - (completing-read "Server: " jabber-biboumi-irc-servers) - (read-string (format "Nick [%s]: " - jabber-biboumi-default-nick) - nil nil jabber-biboumi-default-nick))) - (let ((room (format "%s%%%s@%s" channel server (or biboumi-server - jabber-biboumi-server)))) - (if (assoc room *jabber-active-groupchats*) - (switch-to-buffer (jabber-muc-get-buffer room)) - (jabber-muc-join (jabber-read-account) - room - nick - 'popup)))) - -(defalias 'jabber-irc-join 'jabber-biboumi-muc-connect) - -(defun jabber-connect-all* (&optional arg) - "Run `jabber-connect-all'. -With a prefix ARG, disconnect first." - (interactive "p") - (when arg - (jabber-disconnect)) - (jabber-connect-all)) - -(defun jabber-group-yank-join-url () - "Yank a url for joining the focused group." - (interactive) - (let ((s (format "xmpp:%s?join" jabber-group))) - (kill-new s) - (message s))) - - -;;; Packages - -(use-package jabber - :load-path "~/src/jabber.el/" - :custom-face - (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign - :foreground unspecified - :weight normal))) - (jabber-activity-personal-face ((t :inherit jabber-chat-prompt-local - :foreground unspecified - :weight bold))) - (jabber-chat-prompt-local ((t :inherit minibuffer-prompt - :foreground unspecified - :weight normal - :slant italic))) - (jabber-chat-prompt-foreign ((t :inherit warning - :foreground unspecified - :weight normal))) - (jabber-chat-prompt-system ((t :inherit font-lock-doc-face - :foreground unspecified))) - (jabber-rare-time-face ((t :inherit font-lock-comment-face - :foreground unspecified - :underline nil))) - :bind-keymap ("C-c j" . jabber-global-keymap) - :bind (("C-c C-SPC" . jabber-activity-switch-to)) - :config - (setq jabber-account-list '(("acdw@hmm.st")) - jabber-auto-reconnect t - jabber-biboumi-server "irc.hmm.st" - jabber-biboumi-irc-servers '("irc.libera.chat" - "irc.oftc.net" - "irc.tilde.chat" - "tilde.town" - "m455.casa" - "irc.twitch.tv") - jabber-biboumi-default-nick "acdw" - jabber-last-read-marker (make-string fill-column ?.) - jabber-muc-decorate-presence-patterns - '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil) - ("Mode #.*" . jabber-muc-presence-dim) - ("." . jabber-muc-presence-dim)) - jabber-activity-make-strings #'jabber-activity-make-strings-shorten - jabber-rare-time-format " - - - - - - %H:%M %F" - jabber-chat-header-line-format - '("" (jabber-chat-buffer-show-avatar - (:eval - (let ((buddy (jabber-jid-symbol jabber-chatting-with))) - (jabber-propertize " " - 'display (get buddy 'avatar))))) - (:eval (replace-regexp-in-string "%" "%%" - (jabber-jid-displayname - jabber-chatting-with))) - "\t" (:eval (let ((buddy (jabber-jid-symbol jabber-chatting-with))) - (propertize - (or - (cdr (assoc (get buddy 'show) jabber-presence-strings)) - (get buddy 'show)) - 'face - (or (cdr (assoc (get buddy 'show) jabber-presence-faces)) - 'jabber-roster-user-online)))) - "\t" (:eval (jabber-fix-status (get (jabber-jid-symbol jabber-chatting-with) 'status))) - "\t" jabber-events-message - "\t" jabber-chatstates-message) - jabber-muc-header-line-format - '(" " (:eval (replace-regexp-in-string "%" "%%" - (jabber-jid-displayname - jabber-group))) - " / " jabber-muc-topic) - ;; buffer name formats - jabber-chat-buffer-format "*xmpp* %n" - jabber-browse-buffer-format "*xmpp-browse* %n" - jabber-groupchat-buffer-format "*xmpp-muc* %n" - jabber-muc-private-buffer-format "*xmpp-muc-private* %n" - ;; "prompt" (speaker) formats - jabber-groupchat-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-chat-local-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-chat-foreign-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-muc-private-foreign-prompt-format "\n%g/%n . ") - ;; jabber muc nick coloring - ;; wgreenhous | I found 1.5 ok for saturation and 2.0 for value (modus) - ;; (setopt jabber-muc-nick-value 1.0 - ;; jabber-muc-nick-saturation 1.0 - ;; jabber-muc-colorize-local t - ;; jabber-muc-colorize-foreign t) - ;; When changing the above values, make sure to - ;; (setq jabber-muc-participant-colors nil) - (add-hook 'jabber-chat-mode-hook #'jabber-ui-setup) - (keymap-global-set "C-x C-j" #'dired-jump) ; Extremely annoying fix - ;; For each binding in `jabber-global-keymap', also bind the non-control - ;; character (lowercase) - (map-keymap (lambda (key command) - (define-key jabber-global-keymap (vector (+ key #x60)) command)) - jabber-global-keymap) - (define-key jabber-global-keymap "c" #'jabber-connect-all*) - (require 'jabber-httpupload nil t) - (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons) - (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo) - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo) - (add-hook 'jabber-alert-muc-hooks - (defun jabber@highlight-acdw (&optional _ _ buf _ _) - (when buf - (with-current-buffer buf - (let ((regexp (rx word-boundary - "acdw" ; maybe get from the config? - word-boundary))) - (hi-lock-unface-buffer regexp) - (highlight-regexp regexp 'jabber-chat-prompt-local)))))) - (add-hook 'jabber-chat-mode-hook - (defun jabber-chat@leave-when-kill () - (add-hook 'kill-buffer-hook - (defun @jabber-leave@kill () - (ignore-errors - (apply #'jabber-muc-leave (jabber-muc-argument-list)))) - nil :local))) - (when (fboundp 'jabber-chat-update-focus) - (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)) - (with-eval-after-load 'consult - (defvar jabber-chat-buffer-source - `( :name "Jabber" - :hidden nil - :narrow ?j - :category buffer - :state ,#'consult--buffer-state - :items ,(lambda () - (mapcar #'buffer-name - (seq-filter (lambda (buf) - (with-current-buffer buf - (eq major-mode 'jabber-chat-mode))) - (buffer-list)))))) - (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append) - (consult-customize - consult-buffer :preview-key "M-."))) - -(provide 'acdw-chat) -;;; acdw-chat.el ends here -- cgit 1.4.1-21-gabe81