From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Little improvements on pulse.el Date: Wed, 10 Mar 2021 14:13:35 +0200 Message-ID: <83ft13p5ow.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9567"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Gabriel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 10 13:14:22 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJxjJ-0002NH-5x for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 13:14:21 +0100 Original-Received: from localhost ([::1]:52962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJxjI-0005e2-4O for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 07:14:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJxie-00057K-Ry for emacs-devel@gnu.org; Wed, 10 Mar 2021 07:13:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59973) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJxid-0004m9-3M; Wed, 10 Mar 2021 07:13:39 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1965 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lJxic-0007ox-Hw; Wed, 10 Mar 2021 07:13:38 -0500 In-Reply-To: (message from Gabriel on Wed, 10 Mar 2021 02:39:56 -0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266268 Archived-At: > From: Gabriel > 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?