[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Little improvements on pulse.el
From: |
Juri Linkov |
Subject: |
Re: Little improvements on pulse.el |
Date: |
Wed, 10 Mar 2021 20:59:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
> 2. The name and the docstring mention the use with hooks, but would be
> nice to use with advices as well. For example, to highlight the current
> line when the cursor, buffer or window changes:
>
> (dolist (symbol '(scroll-up-command
> scroll-down-command
> recenter-top-bottom
Scrolling commands can be handled by this hook:
(add-hook 'window-scroll-functions #'pulse-line)
> other-window
> windmove-do-window-select
(add-hook 'window-configuration-change-hook #'pulse-line)
> kill-current-buffer
> delete-window))
(add-hook 'window-state-change-functions #'pulse-line)
> The code above does not work, since 'pulse-line-hook-function' does not
> accept any argument (sent by the advice function). We can make it accept
> optional arguments, but again the name will not be the best one.
A new command could ignore its arguments:
(defun pulse-line (&rest _)
(interactive)
(pulse-momentary-highlight-one-line (point)))
Re: Little improvements on pulse.el,
Juri Linkov <=
Re: Little improvements on pulse.el, Stefan Monnier, 2021/03/11