From 1c3ebf9205025b1563d72ec5e9ed9abbe08250a8 Mon Sep 17 00:00:00 2001 From: noa@gaiwan.org Date: Thu, 13 Jun 2024 01:04:53 +0000 Subject: Update jabber configuration --- emacs/init.el | 62 +++++++++++++++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) (limited to 'emacs/init.el') diff --git a/emacs/init.el b/emacs/init.el index 6a99140..92eeca6 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -107,38 +107,31 @@ :custom (beacon-mode t)) (use-package jabber - :ensure t - :init - (setq noa/jabber-activity-dont-show '( - "#tildetown%town@irc.hmm.st" - "#meta%tilde.chat@irc.hmm.st" - )) - (defun noa/jabber-activity-show-p (jid) - "Return non-nil if JID should be hidden. + :ensure t + :init + (setq noa/jabber-activity-dont-show '( + "#tildetown%town@irc.hmm.st" + "#meta%tilde.chat@irc.hmm.st" + "hmm@conference.hmm.st")) + (defun noa/jabber-activity-show-p (jid) + "Return non-nil if JID should be hidden. A JID should be hidden when there is an invisible buffer for JID, when JID is not in `noa/jabber-activity-dont-show', and when JID is not in `jabber-activity-banned'." - (let ((buffer (jabber-activity-find-buffer-name jid))) - (and - (buffer-live-p buffer) - (not (get-buffer-window buffer 'visible)) - (not - (cl-dolist (entry jabber-activity-banned) - (when (string-match entry jid) - (cl-return t)))) - (not - (cl-dolist (entry noa/jabber-activity-dont-show) - (when (string-match entry jid) - (cl-return t)))) - ) - ) - ) - :custom - (jabber-history-enabled t) - (jabber-account-list '(("noa@hmm.st"))) - (jabber-keepalive-interval 60) - (jabber-activity-show-p #'noa/jabber-activity-show-p) -) + (let ((buffer (jabber-activity-find-buffer-name jid))) + (and (buffer-live-p buffer) + (not (get-buffer-window buffer 'visible)) + (not (cl-dolist (entry jabber-activity-banned) + (when (string-match entry jid) + (cl-return t)))) + (not (cl-dolist (entry noa/jabber-activity-dont-show) + (when (string-match entry jid) + (cl-return t))))))) + :custom + (jabber-history-enabled t) + (jabber-account-list '(("noa@hmm.st"))) + (jabber-keepalive-interval 60) + (jabber-activity-show-p #'noa/jabber-activity-show-p)) (use-package nov :ensure t @@ -156,11 +149,9 @@ and when JID is not in `jabber-activity-banned'." ;; consult-buffer replaces the buffer menu. as well as listing buffers, it lists bookmarks and recent files. (use-package consult :ensure t - :bind ( - ([remap switch-to-buffer] . consult-buffer) - ([remap yank-pop] . consult-yank-pop) - ([remap goto-line] . consult-goto-line)) - ) + :bind (([remap switch-to-buffer] . consult-buffer) ;; also contains file history, etc + ([remap yank-pop] . consult-yank-pop) ;; like normal yank-pop but with live preview + ([remap goto-line] . consult-goto-line))) (use-package marginalia :ensure t @@ -170,8 +161,7 @@ and when JID is not in `jabber-activity-banned'." (marginalia-max-relative-age most-positive-fixnum) (marginalia-align 'right)) -;; My keyboard has a tab key and an i key. For legacy reasons, by default emacs converts C-i to mean the same thing as the tab key, but i don't really want that. -;; The tab key is called and it gets translated to TAB. C-i is TAB, but i'd rather it by C-i. That's what this decode line does. +;; My keyboard has a tab key and an i key. For legacy reasons, by default emacs converts C-i to mean the same thing as the tab key, but i don't really want that. The tab key is called and it gets translated to TAB. C-i is TAB, but i'd rather it by C-i. That's what this decode line does. (define-key input-decode-map [?\C-i] [C-i]) ;; Now that tab and C-i are properly distinguished, i can bind C-i to completion at point. (global-set-key (kbd "") 'completion-at-point) -- cgit 1.4.1-2-gfad0