summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-12 21:09:06 +0100
committerjao <jao@gnu.org>2022-09-12 21:09:06 +0100
commitf9f4e70278e2052900c70965dcf9099087565a1a (patch)
tree7228f0018de1afc1f4dc4929db7450b5e52df06b
parent4fe17709a2abc20d3abab05f17770682cd79c2ec (diff)
downloadelibs-f9f4e70278e2052900c70965dcf9099087565a1a.tar.gz
elibs-f9f4e70278e2052900c70965dcf9099087565a1a.tar.bz2
the matrix has you
-rw-r--r--init.el16
-rw-r--r--lib/eos/jao-tracking.el8
2 files changed, 21 insertions, 3 deletions
diff --git a/init.el b/init.el
index 087770a..901b884 100644
--- a/init.el
+++ b/init.el
@@ -2904,6 +2904,22 @@
(pop-to-buffer telega-root-buffer-name)
(telega)))
+;;;; ement
+(use-package ement
+ :ensure t
+ :init (setq ement-save-sessions t)
+
+ :config
+ (defun jao-ement-track (event room session)
+ (when (run-hook-with-args-until-success
+ 'ement-notify-notification-predicates event room session)
+ (when-let ((n (ement-room--buffer-name room))
+ (b (get-buffer n)))
+ (tracking-add-buffer b))))
+
+ (add-hook 'ement-event-hook #'jao-ement-track)
+ (jao-shorten-modes 'ement-room-mode))
+
;;;; startup
(defun jao-chats (&optional p)
(interactive "P")
diff --git a/lib/eos/jao-tracking.el b/lib/eos/jao-tracking.el
index 5fca653..29a60a8 100644
--- a/lib/eos/jao-tracking.el
+++ b/lib/eos/jao-tracking.el
@@ -33,8 +33,9 @@
(defun jao-tracking--clean-slack (s)
(let* ((s (replace-regexp-in-string
"^\\*Slack - .*? : \\(mpdm-\\)?\\([^ ]+\\)\\( \\(T\\)\\)?.*"
- "#\\2\\4"
+ "\\2\\4"
s))
+ (s (replace-regexp-in-string "^\\*Ement Room: \\(.+\\)\\*" "\\1" s))
(s (replace-regexp-in-string "logstash-\\([^-]+\\)-\\(.+\\)"
"\\2-\\1"
s)))
@@ -139,11 +140,12 @@
(let ((n (jao-afio-frame-no)))
(unless (eq 0 n) (setq jao-tracking--start-frame n))
(cond (tracking-buffers
- (let ((b (car tracking-buffers)))
+ (let ((bs tracking-buffers))
(if (eq 0 n)
(tracking-next-buffer)
(jao-afio-goto-scratch)
- (when b (pop-to-buffer b))
+ (when (and (car bs) (not (memq (current-buffer) bs)))
+ (pop-to-buffer (car bs)))
(tracking-remove-visible-buffers))))
(jao-tracking--start-frame
(jao-afio-goto-nth jao-tracking--start-frame)