From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Add 'pulsar' package Date: Sun, 20 Mar 2022 11:29:35 +0000 Message-ID: <87k0con9pc.fsf@posteo.net> References: <87pmmpasom.fsf@protesilaos.com> <87ee359c2e.fsf@posteo.net> <871qz5x72t.fsf@protesilaos.com> <87v8wg1o7b.fsf@posteo.net> <87zglqdrht.fsf@protesilaos.com> <87h77x51d6.fsf@posteo.net> <87o821f7js.fsf@protesilaos.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5777"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Protesilaos Stavrou Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 20 12:31:31 2022 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 1nVtmV-0001LO-97 for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Mar 2022 12:31:31 +0100 Original-Received: from localhost ([::1]:33782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVtmT-0003z9-VK for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Mar 2022 07:31:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVtks-0003Av-Ra for emacs-devel@gnu.org; Sun, 20 Mar 2022 07:29:52 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:51869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVtkq-00078h-E1 for emacs-devel@gnu.org; Sun, 20 Mar 2022 07:29:50 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 204CB240039 for ; Sun, 20 Mar 2022 12:29:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647775785; bh=Ac8nD+faSa8h5sIUYwSD+Up8XPFDHUSw/KGNNyyNwv4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=iKJp1iVWGryBwG7riWCvOCH9d07jfLVuJfUF0owvTAFckzyXRP4O9xsHNtR+eIJKP sW6y87Po58vH9Y1MjPX5BToKU5b7386BEhrNDK6zwF9oQcUxtOwzwuUURA4h8abCJz sLX5kMkWK/Er9kV27VSbYjKOOaXEM0TEF59JU+D1l0PFzVjD5wBRsQQkc8l4OZrrB7 7+Dw+M5cMxxWRdQ9/jbyTIP4UuKWiyVjgXsX3knyUpTFBLECxf5XMapJY18y4Pb1Ct hH815vnBOPxzuqMrPQFI4WjRqF8cBMqtUGVFNTRg9QpL7OlrZ8GQzqPXI5ca4BMTVT Zu340qG83/aCg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KLwWm40Jbz6tpd; Sun, 20 Mar 2022 12:29:40 +0100 (CET) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <87o821f7js.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Sun, 20 Mar 2022 08:43:19 +0200") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:287316 Archived-At: --=-=-= Content-Type: text/plain Protesilaos Stavrou writes: > On 2022-03-16, 16:05 +0000, Philip Kaludercic wrote: > >>>> I have no real opinion on this, I just wanted to bring it up in case you >>>> hadn't considered it before (and also because in this case, at least from >>>> what I understand the package does, it should be rather easy). >>> >>> I think a standalone package and a patch for 'master' are not mutually >>> exclusive. As I wrote before, we can deprecate pulsar when Emacs 29 is >>> the new stable and has this functionality built-in. >>> >>> As for whether such a patch would be easy, I admit that I do not know >>> how best to implement it. If you or anyone else can write such a patch, >>> please do it. >> >> I guess it might depend on how many features you want to re-implement in >> the core. Please don't misinterpret this, but I think that the core >> functionality, pulsing a line after certain commands, could be done by >> providing a single user option, with a custom setter. > > As I wrote before, I do not know how best to do this in core. This is > not me faking ignorance to support a different opinion: I genuinely do > not know how to do this with a single option. Please do it if you > can---it will also help me learn something new. This is a quick sketch: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index f7af10887c..97803d08c1 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -102,6 +102,22 @@ pulse-delay :group 'pulse :type 'number) +;;;###autoload +(defcustom pulse-after-commands '() + "List of commands to pulse the current line after invocation." + :set (lambda (sym val) + (funcall (if val #'add-hook #'remove-hook) + 'post-command-hook + #'pulse--after-command) + (set-default sym val)) + :group 'pulse + :type '(repeat symbol)) + +(defun pulse--after-command () + "Pulse if the current command is in `pulse-after-commands'." + (when (memq this-command pulse-after-commands) + (pulse-momentary-highlight-one-line))) + ;;; Convenience Functions ;; (defvar pulse-momentary-overlay nil --=-=-= Content-Type: text/plain This can be extended by allowing regular expressions to match sets of commands, or cons-cells to configure additional details (color, duration, multiple pulses, ...) for specific case. > At any rate, this is not what this thread is about. I think pulsar > belongs in the archive. I post on emacs-devel to give others a chance > to point out any obvious flaws with the package. If there are none, the > patch must be installed in elpa.git (I have write access and can do that > myself, if needed). > > There are people who are already using pulsar and I believe there is no > technical reason why it should not be in GNU ELPA. In any case, I don't want to object, especially if others find the package useful. I just wanted to be sure that the alternative was mentioned. Unless anyone objects, there shouldn't be any problem if you push your patch to elpa.git. > To your point though about patching the core, I repeat what I already > stated in unequivocal terms: I will deprecate pulsar when the Emacs > version that includes its functionality becomes the stable version of > Emacs. Until then, the package has a good reason to exist and be > readily available. I don't even think this is necessary. IMO there is nothing wrong with having a package on ELPA that extends or improves on a core feature. -- Philip Kaludercic --=-=-=--