summaryrefslogtreecommitdiffhomepage
path: root/lib/eos/jao-tracking.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-04-06 15:51:29 +0100
committerjao <jao@gnu.org>2024-04-06 15:51:29 +0100
commit35aab378bc0e53a35ff50dac469bf7c31ad29ce8 (patch)
tree09921ca967641ba79245c945241908d291f575b4 /lib/eos/jao-tracking.el
parent96da00113dfa9531551a54369f7355ac144953a3 (diff)
downloadelibs-35aab378bc0e53a35ff50dac469bf7c31ad29ce8.tar.gz
elibs-35aab378bc0e53a35ff50dac469bf7c31ad29ce8.tar.bz2
tracking nits
Diffstat (limited to 'lib/eos/jao-tracking.el')
-rw-r--r--lib/eos/jao-tracking.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/eos/jao-tracking.el b/lib/eos/jao-tracking.el
index da01018..2af868c 100644
--- a/lib/eos/jao-tracking.el
+++ b/lib/eos/jao-tracking.el
@@ -1,6 +1,6 @@
;; jao-minibuffer-tracking.el --- Tracking notifications -*- lexical-binding: t; -*-
-;; Copyright (C) 2021, 2022 jao
+;; Copyright (C) 2021, 2022, 2024 jao
;; Author: jao <mail@jao.io>
;; Keywords: convenience
@@ -159,12 +159,21 @@
(tracking-next-buffer))
(jao-tracking-update-minibuffer))
-;;;###autoload
-(defun jao-tracking-setup ()
+(defun jao-tracking-add-to-minibuffer ()
+ (interactive)
(jao-minibuffer-add-variable 'jao-tracking-string -10)
(add-variable-watcher 'tracking-mode-line-buffers #'jao-tracking-echo)
- ;; since we're using the minibuffer, forget the mode line
- (advice-add #'tracking-mode :override (lambda (&optional _) (interactive)))
+ (advice-add #'tracking-mode :override (lambda (&optional _) (interactive))))
+
+(defun jao-tracking-remove-from-minibuffer ()
+ (interactive)
+ (jao-minibuffer-remove-variable 'jao-tracking-string)
+ (remove-variable-watcher 'tracking-mode-line-buffers #'jao-tracking-echo)
+ (advice-remove #'tracking-mode (lambda (&optional _) (interactive))))
+
+;;;###autoload
+(defun jao-tracking-setup (&optional minibuffer)
+ (when minibuffer (jao-tracking-add-to-minibuffer))
(add-hook 'jao-afio-switch-hook #'jao-tracking--remove-visible-buffers)
(global-set-key (kbd "C-c C-SPC") #'jao-tracking-next-buffer)
(define-key tracking-mode-map (kbd "C-c C-SPC") #'jao-tracking-next-buffer))