unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gabriel <gabriel376@hotmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Little improvements on pulse.el
Date: Wed, 10 Mar 2021 14:13:35 +0200	[thread overview]
Message-ID: <83ft13p5ow.fsf@gnu.org> (raw)
In-Reply-To: <CH2PR01MB5879637707F4A54A1418825F8B919@CH2PR01MB5879.prod.exchangelabs.com> (message from Gabriel on Wed, 10 Mar 2021 02:39:56 -0300)

> From: Gabriel <gabriel376@hotmail.com>
> Date: Wed, 10 Mar 2021 02:39:56 -0300
> 
> I have been playing with pulse.el in the last few days and some
> ideas/questions come to my mind.

Thanks.

> 1. It can be useful in some cases to pulse the current line by using an
> interactive command, for example, when doing a presentation, a pairing
> with other developer, or to easily find the cursor position. Since
> 'pulse-line-hook-function' is not a good name for an interactive
> function, we can create a new command for that.

How about pulse-line-command?  Or even just pulse-line?

> 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
>                   other-window
>                   windmove-do-window-select
>                   kill-current-buffer
>                   delete-window))
>   (advice-add symbol :after #'pulse-line-hook-function))
> 
> 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.

I'd prefer not to use advices for such a simple job.  For example, how
about defining a new hook, which will receive the argument(s) you want
to pass it?

> 3. I could not find any documentation or usage in emacs source code for
> 'pulse-line-hook-function' and 'pulse-command-advice-flag'. Is the flag
> 'pulse-command-advice-flag' really needed ? The git history says the
> last modification of this code was 12+ years ago.

You will find one usage of the hook in CEDET.  In any case, after so
many years I don't think we should consider removing these without a
good reason.  Is there such a reason?

> 4. Would be nice to have support for 'pulse-highlight-start-face' in the
> themes provided by Emacs, especially on modus-themes.

That's up to the themes, no?  They don't necessarily modify all the
faces.

> 5. The code on 'pulse-lighten-highlight' can be significantly improved
> by replacing 'pulse-int-to-hex' and 'pulse-color-values-to-hex' with
> 'color-gradient' from color.el. The idea is to build the list of color
> gradients beforehand and use a timer to set each color according to
> 'pulse-iterations' and 'pulse-delay'. A very basic example:

I'm not sure I understand the improvement, can you elaborate?



  reply	other threads:[~2021-03-10 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  5:39 Little improvements on pulse.el Gabriel
2021-03-10 12:13 ` Eli Zaretskii [this message]
2021-03-10 13:41   ` Stefan Kangas
2021-03-10 17:18     ` Juri Linkov
2021-03-10 18:51       ` Juri Linkov
2021-03-10 19:11         ` Eli Zaretskii
2021-03-11 23:42   ` Gabriel
2021-03-12  7:29     ` Eli Zaretskii
2021-03-10 18:59 ` Juri Linkov
2021-03-11 15:35 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ft13p5ow.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gabriel376@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).