summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-03-11 18:48:58 -0400
committerJakob L. Kreuze2019-03-11 18:48:58 -0400
commit998f48d137e20c61d09fecb3ad868fdc36bf0046 (patch)
tree0548979fe59dce04d3eb4bd85212704e44840e12
parent764ad5e779453128f06062184cdca6ae5d282e25 (diff)
Replace ERC tracking bar with erc-keep-place
-rw-r--r--jakob.org52
1 files changed, 5 insertions, 47 deletions
diff --git a/jakob.org b/jakob.org
index c4ce1b1..982f3c6 100644
--- a/jakob.org
+++ b/jakob.org
@@ -1244,10 +1244,11 @@ including =truncate=, but omitting =autojoin=.
:straight nil
:config
(setq erc-modules '(button completion fill
- irccontrols list match
- menu move-to-prompt netsplit
- networks noncommands readonly
- ring stamp track truncate))
+ irccontrols keep-place list
+ match menu move-to-prompt
+ netsplit networks noncommands
+ readonly ring stamp track
+ truncate))
(erc-update-modules)
#+END_SRC
@@ -2015,46 +2016,3 @@ line.
(setq erc-modified-channels-alist nil)
(erc-modified-channels-display))
#+END_SRC
-
-ERC tracking bar. Not mine. Shamelessly lifted from [[https://www.emacswiki.org/emacs/ErcBar][EmacsWiki]].
-
-#+BEGIN_SRC elisp
-(eval-after-load 'erc-track
- '(progn
- (defun erc-bar-move-back (n)
- "Moves back n message lines. Ignores wrapping, and server messages."
- (interactive "nHow many lines ? ")
- (re-search-backward "^.*<.*>" nil t n))
-
- (defun erc-bar-update-overlay ()
- "Update the overlay for current buffer, based on the content of
-erc-modified-channels-alist. Should be executed on window change."
- (interactive)
- (let* ((info (assq (current-buffer) erc-modified-channels-alist))
- (count (cadr info)))
- (if (and info (> count erc-bar-threshold))
- (save-excursion
- (end-of-buffer)
- (when (erc-bar-move-back count)
- (let ((inhibit-field-text-motion t))
- (move-overlay erc-bar-overlay
- (line-beginning-position)
- (line-end-position)
- (current-buffer)))))
- (delete-overlay erc-bar-overlay))))
-
- (defvar erc-bar-threshold 1
- "Display bar when there are more than erc-bar-threshold unread messages.")
- (defvar erc-bar-overlay nil
- "Overlay used to set bar")
- (setq erc-bar-overlay (make-overlay 0 0))
- (overlay-put erc-bar-overlay 'face '(:underline "red"))
- ;;put the hook before erc-modified-channels-update
- (defadvice erc-track-mode (after erc-bar-setup-hook
- (&rest args) activate)
- ;;remove and add, so we know it's in the first place
- (remove-hook 'window-configuration-change-hook 'erc-bar-update-overlay)
- (add-hook 'window-configuration-change-hook 'erc-bar-update-overlay))
- (add-hook 'erc-send-completed-hook (lambda (str)
- (erc-bar-update-overlay)))))
-#+END_SRC

© 2015 - 2026 Jakob L. Kreuze