Skip to content

Commit

Permalink
Replace defadvice with define-advice in enable-lui-track
Browse files Browse the repository at this point in the history
Resolves
lui-track.el: Warning: ‘defadvice’ is an obsolete macro (as of 30.1); use ‘advice-add’ or ‘define-advice’
lui-track.el: Warning: ‘defadvice’ is an obsolete macro (as of 30.1); use ‘advice-add’ or ‘define-advice’
  • Loading branch information
snogge committed Mar 5, 2024
1 parent 4b8fe00 commit f2c4971
Showing 1 changed file with 4 additions and 2 deletions.
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 f2c4971

Please sign in to comment.