* [ELPA] Add 'pulsar' package @ 2022-03-14 7:39 Protesilaos Stavrou 2022-03-14 8:24 ` Philip Kaludercic 0 siblings, 1 reply; 10+ messages in thread From: Protesilaos Stavrou @ 2022-03-14 7:39 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 536 bytes --] Good day everyone! I have a small package called "pulsar". It builds on top of pulse.el to temporarily highlight the current line either on demand or automatically after another function is invoked. Regarding the latter case, a user option is provided to specify the list of functions. Other user options set the desired face and control the duration of the pulse effect. Please see the attached patch for elpa.git. What do you think? All the best, Protesilaos (or simply "Prot") -- Protesilaos Stavrou https://protesilaos.com [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-elpa-packages-pulsar-New-package.patch --] [-- Type: text/x-patch, Size: 912 bytes --] From 120d09b5e018fe9303b089d14a00910ee1deb117 Mon Sep 17 00:00:00 2001 Message-Id: <120d09b5e018fe9303b089d14a00910ee1deb117.1647243192.git.info@protesilaos.com> From: Protesilaos Stavrou <info@protesilaos.com> Date: Mon, 14 Mar 2022 09:32:54 +0200 Subject: [PATCH] * elpa-packages (pulsar): New package --- elpa-packages | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elpa-packages b/elpa-packages index 8e72795e52..b7d8cfa7f2 100644 --- a/elpa-packages +++ b/elpa-packages @@ -475,6 +475,10 @@ ;; git reset \$GIT_COMMIT -- pspp-mode.el" \ ;; -- -- pspp-mode.el ("pspp-mode" :url nil) ;; Was "https://git.sv.gnu.org/r/pspp.git" + ("pulsar" :url "https://gitlab.com/protesilaos/pulsar" + :auto-sync t + :news "CHANGELOG.org" + :ignored-files ("COPYING" "doclicense.texi")) ("pyim" :url "https://github.com/tumashu/pyim.git" :auto-sync t) -- 2.35.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-14 7:39 [ELPA] Add 'pulsar' package Protesilaos Stavrou @ 2022-03-14 8:24 ` Philip Kaludercic 2022-03-14 8:38 ` Protesilaos Stavrou 0 siblings, 1 reply; 10+ messages in thread From: Philip Kaludercic @ 2022-03-14 8:24 UTC (permalink / raw) To: Protesilaos Stavrou; +Cc: emacs-devel Protesilaos Stavrou <info@protesilaos.com> writes: > Good day everyone! > > I have a small package called "pulsar". It builds on top of pulse.el to > temporarily highlight the current line either on demand or automatically > after another function is invoked. Regarding the latter case, a user > option is provided to specify the list of functions. > > Other user options set the desired face and control the duration of the > pulse effect. > > Please see the attached patch for elpa.git. > > What do you think? I don't know if you plan to extend the package a lot more, but couldn't this also be re-modelled into a patch for pulse.el? > All the best, > Protesilaos (or simply "Prot") -- Philip Kaludercic ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-14 8:24 ` Philip Kaludercic @ 2022-03-14 8:38 ` Protesilaos Stavrou 2022-03-14 16:41 ` Philip Kaludercic 0 siblings, 1 reply; 10+ messages in thread From: Protesilaos Stavrou @ 2022-03-14 8:38 UTC (permalink / raw) To: Philip Kaludercic; +Cc: emacs-devel Hello Philip! On 2022-03-14, 08:24 +0000, Philip Kaludercic <philipk@posteo.net> wrote: > Protesilaos Stavrou <info@protesilaos.com> writes: > >> Good day everyone! >> >> I have a small package called "pulsar". It builds on top of pulse.el to >> temporarily highlight the current line either on demand or automatically >> after another function is invoked. Regarding the latter case, a user >> option is provided to specify the list of functions. >> >> Other user options set the desired face and control the duration of the >> pulse effect. >> >> Please see the attached patch for elpa.git. >> >> What do you think? > > I don't know if you plan to extend the package a lot more, but couldn't > this also be re-modelled into a patch for pulse.el? In principle yes. I had this discussion before regarding another small package I tried to submit: lin.[1] The suggestion was to patch hl-line directly. To cut the long story short: I could not write a good patch, so we got neither the patch nor the package on GNU ELPA. If pulsar makes sense both as a standalone package and an enhancement for pulse.el (or whatever) I prefer to have both. We can always deprecate/discontinue the package when the time is right (e.g. Emacs 29 is the new stable). In the meantime, a package provides the convenience of being readily available. What do you think? [1] <https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg00442.html> -- Protesilaos Stavrou https://protesilaos.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-14 8:38 ` Protesilaos Stavrou @ 2022-03-14 16:41 ` Philip Kaludercic 2022-03-16 12:14 ` Protesilaos Stavrou 0 siblings, 1 reply; 10+ messages in thread From: Philip Kaludercic @ 2022-03-14 16:41 UTC (permalink / raw) To: Protesilaos Stavrou; +Cc: emacs-devel Protesilaos Stavrou <info@protesilaos.com> writes: > Hello Philip! > > On 2022-03-14, 08:24 +0000, Philip Kaludercic <philipk@posteo.net> wrote: > >> Protesilaos Stavrou <info@protesilaos.com> writes: >> >>> Good day everyone! >>> >>> I have a small package called "pulsar". It builds on top of pulse.el to >>> temporarily highlight the current line either on demand or automatically >>> after another function is invoked. Regarding the latter case, a user >>> option is provided to specify the list of functions. >>> >>> Other user options set the desired face and control the duration of the >>> pulse effect. >>> >>> Please see the attached patch for elpa.git. >>> >>> What do you think? >> >> I don't know if you plan to extend the package a lot more, but couldn't >> this also be re-modelled into a patch for pulse.el? > > In principle yes. > > I had this discussion before regarding another small package I tried to > submit: lin.[1] The suggestion was to patch hl-line directly. To cut > the long story short: I could not write a good patch, so we got neither > the patch nor the package on GNU ELPA. > > If pulsar makes sense both as a standalone package and an enhancement > for pulse.el (or whatever) I prefer to have both. We can always > deprecate/discontinue the package when the time is right (e.g. Emacs 29 > is the new stable). In the meantime, a package provides the convenience > of being readily available. > > What do you think? 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). > [1] <https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg00442.html> -- Philip Kaludercic ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-14 16:41 ` Philip Kaludercic @ 2022-03-16 12:14 ` Protesilaos Stavrou 2022-03-16 16:05 ` Philip Kaludercic 0 siblings, 1 reply; 10+ messages in thread From: Protesilaos Stavrou @ 2022-03-16 12:14 UTC (permalink / raw) To: Philip Kaludercic; +Cc: emacs-devel On 2022-03-14, 16:41 +0000, Philip Kaludercic <philipk@posteo.net> wrote: >>> I don't know if you plan to extend the package a lot more, but couldn't >>> this also be re-modelled into a patch for pulse.el? >> >> In principle yes. >> >> I had this discussion before regarding another small package I tried to >> submit: lin.[1] The suggestion was to patch hl-line directly. To cut >> the long story short: I could not write a good patch, so we got neither >> the patch nor the package on GNU ELPA. >> >> If pulsar makes sense both as a standalone package and an enhancement >> for pulse.el (or whatever) I prefer to have both. We can always >> deprecate/discontinue the package when the time is right (e.g. Emacs 29 >> is the new stable). In the meantime, a package provides the convenience >> of being readily available. >> >> What do you think? > > 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. At any rate, I just published version 0.2.0 of pulsar.el. The release notes: <https://protesilaos.com/codelog/2022-03-16-pulsar-0.2.0/>. -- Protesilaos Stavrou https://protesilaos.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-16 12:14 ` Protesilaos Stavrou @ 2022-03-16 16:05 ` Philip Kaludercic 2022-03-20 6:43 ` Protesilaos Stavrou 0 siblings, 1 reply; 10+ messages in thread From: Philip Kaludercic @ 2022-03-16 16:05 UTC (permalink / raw) To: Protesilaos Stavrou; +Cc: emacs-devel Protesilaos Stavrou <info@protesilaos.com> writes: > On 2022-03-14, 16:41 +0000, Philip Kaludercic <philipk@posteo.net> wrote: > >>>> I don't know if you plan to extend the package a lot more, but couldn't >>>> this also be re-modelled into a patch for pulse.el? >>> >>> In principle yes. >>> >>> I had this discussion before regarding another small package I tried to >>> submit: lin.[1] The suggestion was to patch hl-line directly. To cut >>> the long story short: I could not write a good patch, so we got neither >>> the patch nor the package on GNU ELPA. >>> >>> If pulsar makes sense both as a standalone package and an enhancement >>> for pulse.el (or whatever) I prefer to have both. We can always >>> deprecate/discontinue the package when the time is right (e.g. Emacs 29 >>> is the new stable). In the meantime, a package provides the convenience >>> of being readily available. >>> >>> What do you think? >> >> 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. Perhaps we could add a stripped down version to pulse.el and the full package to ELPA, perhaps both referring to one another? > At any rate, I just published version 0.2.0 of pulsar.el. The release > notes: <https://protesilaos.com/codelog/2022-03-16-pulsar-0.2.0/>. -- Philip Kaludercic ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-16 16:05 ` Philip Kaludercic @ 2022-03-20 6:43 ` Protesilaos Stavrou 2022-03-20 11:29 ` Philip Kaludercic 0 siblings, 1 reply; 10+ messages in thread From: Protesilaos Stavrou @ 2022-03-20 6:43 UTC (permalink / raw) To: Philip Kaludercic; +Cc: emacs-devel On 2022-03-16, 16:05 +0000, Philip Kaludercic <philipk@posteo.net> 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. 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. 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. -- Protesilaos Stavrou https://protesilaos.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-20 6:43 ` Protesilaos Stavrou @ 2022-03-20 11:29 ` Philip Kaludercic 2022-03-22 10:37 ` Protesilaos Stavrou 0 siblings, 1 reply; 10+ messages in thread From: Philip Kaludercic @ 2022-03-20 11:29 UTC (permalink / raw) To: Protesilaos Stavrou; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 1313 bytes --] Protesilaos Stavrou <info@protesilaos.com> writes: > On 2022-03-16, 16:05 +0000, Philip Kaludercic <philipk@posteo.net> 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: [-- Attachment #2: Type: text/plain, Size: 831 bytes --] 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 [-- Attachment #3: Type: text/plain, Size: 1337 bytes --] 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 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-20 11:29 ` Philip Kaludercic @ 2022-03-22 10:37 ` Protesilaos Stavrou 2022-03-23 9:03 ` Philip Kaludercic 0 siblings, 1 reply; 10+ messages in thread From: Protesilaos Stavrou @ 2022-03-22 10:37 UTC (permalink / raw) To: Philip Kaludercic; +Cc: emacs-devel On 2022-03-20, 11:29 +0000, Philip Kaludercic <philipk@posteo.net> wrote: >> 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: > > 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 > > 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. That's neat. Thanks for sharing! In the original version of my code I was using an advice, but changed it to post-command-hook following feedback from Daniel Mendler. Will you include a variant of this in pulse.el? Then I can reference it in pulsar's manual and tell people to use it if they want. >> 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. You did the right thing in that regard. > Unless anyone objects, there shouldn't be any problem if you push your > patch to elpa.git. I think we have given this sufficient time. I am pushing the change now. I want to do the same for lin, which is another small package I maintain and which I recently refined: <https://protesilaos.com/emacs/lin>. >> 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. Okay. I stand by my commitment and will adapt to what core Emacs is doing. -- Protesilaos Stavrou https://protesilaos.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ELPA] Add 'pulsar' package 2022-03-22 10:37 ` Protesilaos Stavrou @ 2022-03-23 9:03 ` Philip Kaludercic 0 siblings, 0 replies; 10+ messages in thread From: Philip Kaludercic @ 2022-03-23 9:03 UTC (permalink / raw) To: Protesilaos Stavrou; +Cc: emacs-devel Protesilaos Stavrou <info@protesilaos.com> writes: > On 2022-03-20, 11:29 +0000, Philip Kaludercic <philipk@posteo.net> wrote: > >>> 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: >> >> 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 >> >> 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. > > That's neat. Thanks for sharing! In the original version of my code I > was using an advice, but changed it to post-command-hook following > feedback from Daniel Mendler. > > Will you include a variant of this in pulse.el? Then I can reference it > in pulsar's manual and tell people to use it if they want. I am currently short on time, and have other projects with higher priorities, so finding the time to implement and discuss a feature I am not personally interested in is a bit difficult right now. >>> 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. > > Okay. I stand by my commitment and will adapt to what core Emacs is > doing. In that case the above patch should certainly be expanded, so that it is even in a position to eventually deprecate pulsar. -- Philip Kaludercic ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-03-23 9:03 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-03-14 7:39 [ELPA] Add 'pulsar' package Protesilaos Stavrou 2022-03-14 8:24 ` Philip Kaludercic 2022-03-14 8:38 ` Protesilaos Stavrou 2022-03-14 16:41 ` Philip Kaludercic 2022-03-16 12:14 ` Protesilaos Stavrou 2022-03-16 16:05 ` Philip Kaludercic 2022-03-20 6:43 ` Protesilaos Stavrou 2022-03-20 11:29 ` Philip Kaludercic 2022-03-22 10:37 ` Protesilaos Stavrou 2022-03-23 9:03 ` Philip Kaludercic
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.