Skip to content

Commit

Permalink
Merge pull request #417 from snogge/cleanup
Browse files Browse the repository at this point in the history
Cleanup some obsolete defadvice
  • Loading branch information
wasamasa authored Apr 7, 2024
2 parents cc630eb + bfb786d commit 5c67876
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((emacs-lisp-mode . ((indent-tabs-mode . nil))))
5 changes: 2 additions & 3 deletions circe.el
Original file line number Diff line number Diff line change
Expand Up @@ -1941,8 +1941,8 @@ server's chat buffers."
(current-buffer))))

;; There really ought to be a hook for this
(defadvice select-window (after circe-server-track-select-window
(window &optional norecord))
(define-advice select-window (:after (window &optional _norecord)
circe-server-track-select-window)
"Remember the current buffer as the last active buffer.
This is used by Circe to know where to put spurious messages."
(with-current-buffer (window-buffer window)
Expand All @@ -1951,7 +1951,6 @@ This is used by Circe to know where to put spurious messages."
(ignore-errors
(with-circe-server-buffer
(setq circe-server-last-active-buffer buf)))))))
(ad-activate 'select-window)

(defun circe-reduce-lurker-spam ()
"Return the value of `circe-reduce-lurker-spam'.
Expand Down
6 changes: 4 additions & 2 deletions lui-track.el
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ line to mark last position."
"Enable a bar or fringe indicator in Lui buffers that shows
where you stopped reading."
(interactive)
(defadvice switch-to-buffer (before lui-track activate)
(define-advice switch-to-buffer
(:before (buffer-or-name &optional norecord force-same-window) lui-track)
(when (and (eq lui-track-behavior 'before-switch-to-buffer)
;; Do not move the indicator if the buffer is displayed still
(<= (length (get-buffer-window-list (current-buffer)))
1))
(lui-track-move)))
(defadvice tracking-next-buffer (before lui-track activate)
(define-advice tracking-next-buffer
(:before () lui-track)
(when (eq lui-track-behavior 'before-tracking-next-buffer)
(lui-track-move)))
(add-hook 'lui-pre-input-hook 'lui-track--move-pre-input))
Expand Down

0 comments on commit 5c67876

Please sign in to comment.