From 6b355568b075c1cb90c622299c4edba4e65e98dd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 25 Jan 2022 16:55:44 -0600 Subject: Customize jabber --- init.el | 12 +++++++++++- lisp/+modeline.el | 22 ++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/init.el b/init.el index ed7252e..fe5630a 100644 --- a/init.el +++ b/init.el @@ -1318,11 +1318,21 @@ See also `crux-reopen-as-root-mode'." "jabber-pkg.el") :fork (:repo "https://tildegit.org/acdw/emacs-jabber" :host nil))) + (:also-load +jabber) + (:option jabber-account-list '(("acdw@hmm.st")) + jabber-groupchat-buffer-format "%n" + jabber-chat-buffer-format "%n" + jabber-muc-private-buffer-format "%n (%g)" + jabber-activity-show-p #'ignore) (dolist (mode '(jabber-chat-mode jabber-browse-mode jabber-roster-mode jabber-console-mode)) - (add-hook (intern (format "%s-hook" mode)) #'visual-fill-column-mode))) + (add-hook (intern (format "%s-hook" mode)) #'visual-fill-column-mode)) + (add-hook 'jabber-activity-mode-hook 'tracking-mode) + (:+leader "C-j" jabber-global-keymap) + (advice-add 'jabber-activity-add :after #'+jabber-tracking-add) + (advice-add 'jabber-activity-add-muc :after #'+jabber-tracking-add-muc)) (setup (:straight-when keychain-environment (executable-find "keychain")) diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 7683269..4217d13 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el @@ -57,16 +57,22 @@ This function makes a lambda, so you can throw it straight into ;;; Modeline segments +(defun +modeline-sanitize-string (string) + "Sanitize a string for `format-mode-line'." + (when string + (string-replace "%" "%%" string))) + (defun +modeline-buffer-name (&optional spacer) ; gonsie "Display the buffer name." - (concat (or spacer +modeline-default-spacer) - (propertize - (truncate-string-to-width (buffer-name) - (min 24 (/ (window-width) 3)) - nil ?\ t) - 'help-echo (or (buffer-file-name) - (buffer-name)) - 'mouse-face 'mode-line-highlight))) + (let ((bufname (string-replace "%" "" (buffer-name)))) + (concat (or spacer +modeline-default-spacer) + (propertize + (truncate-string-to-width bufname + (min 24 (/ (window-width) 3)) + nil ?\ t) + 'help-echo (or (buffer-file-name) + (buffer-name)) + 'mouse-face 'mode-line-highlight)))) (defcustom +modeline-minions-icon "&" "The \"icon\" for `+modeline-minions' button." -- cgit 1.4.1-21-gabe81